Custom entity and stairs

Started by Dragon_noir, June 05, 2015, 04:56:35 PM

Previous topic - Next topic
I've made a custom entity representing a npc following the hero.

But it doesn't go up and down the stairs.

Is there a way to make it so?

I am working on doing that too.

Have you tried coding the NPC with the hero like an item?

You could also code the maps to spawn the NPC in the next room after the NPC interaction is suppose too.

If I get mine working I'll post the code.

Sorry I missed this message.
Stairs are an obstacle for NPCs. So you have to control the movement with a script. It is not straightforward.

While the hero is taking stairs (you can detect that from the hero:on_state_changed() event), I would create different movement for the NPC, maybe of type target_movement.

Another way to do that is to implement the NPC as a custom entity instead, because with a custom entity you can clearly set which entity types can be traversed (and allow to traverse stairs in this case).

Either way, you also have to change the layer of your entity when the layer of the hero is changed by stairs. (Which is a more general problem; how do you do with jumpers?)