I would imagine you would need to use some basic LUA to do this. I can't think of anything specific in the engine that lets you keep track of this kind of variable, and add to it over time.
don't let this put you off though, it should be pretty simple to do the variable math in an lua script then use the IF condition actions within the engine to check where the NPC has got too off screen:
- Create a variable for the scene the NPC is on.
- Create a variable for the scene position of the npc between 0 and the screen width
- Increase this value every second by an amount similar to the NPC walking speed
- Each time this number reaches the screen width, update the screen number variable +1
This means you will have variables being updated in the background by LUA, which you can check as you enter each scene in the engine.
So using an "on enter scene" action in the engine, you would check the scene variable to see if the npc should be in this scene, and if so, position him at the position variable. If the NPC isn't in the current scene then don't show him.
Hopefully this gives you some insight into how you can use LUA to do some simple math, and adding to variables, and use the intuitive action system in the engine to check the status of those variables.
Hope this helps, and doesn't just confuse further