Author Topic: Movements automatically change NPC's animation and direction?  (Read 57 times)

alexgleason

  • Jr. Member
  • **
  • Posts: 72
  • Vegan on a Desert Island
    • View Profile
    • Vegan on a Desert Island
Movements automatically change NPC's animation and direction?
« on: October 31, 2018, 05:12:46 pm »
I'm experimenting with making NPCs shiver back and forth when I use my vacuum item on them. It's a pixel movement that jitters an entity left and right by 2px.

When I try it, it says: Error: Illegal direction 3 for sprite 'animals/seagull_trash2' in animation 'walking'

I'm guessing that using a movement on an NPC is "smart" and makes the NPC automatically change direction toward the movement and try to walk that way. Am I right? If so, is there an easy way to override it?

It's not a big deal, and I might just not do this in my game. It doesn't seem documented though, and kinda surprised me.
RIP Aaron Swartz

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1144
    • View Profile
Re: Movements automatically change NPC's animation and direction?
« Reply #1 on: October 31, 2018, 06:33:52 pm »
You are right, sprites of NPCs automatically take the direction of the NPC's movement. But there are two types of NPCs: usual NPCs, that have this behavior, and generalized NPCs, that have no automatic behavior. So just set your NPC as a generalized one (in the quest editor) and you will be fine.