Bob the Hamster wrote:
It has been a while since I have worked on the caterpillar code, but if I remember correctly, when caterpillar mode is enabled, heroes 1, 2, 3 are not really walking at all, they are just "ghosting" over the history of movements that hero 0 has made in the past 3 steps.
If confirmed to be the case this does seem like a bug, and I think that if caterpillar is enabled it would be most appropriate for all heroes to simultaneously return the same results for "hero is walking"
If confirmed to be the case this does seem like a bug, and I think that if caterpillar is enabled it would be most appropriate for all heroes to simultaneously return the same results for "hero is walking"
Oh yes, I had completely forgotten than xgo/ygo aren't used in this case. That explains it. We can just add a special case to check hero 0's movement regardless of which one is requested.
Quote:
Also what do you mean by "Beware that this script will break in lots of edge cases!"
The ones listed, for example multiple NPCs on one tile, trying to walk over the edge of a wrapping map but you can't because there's an NPC in the way, walls or obstruction suspended. In all of these cases you would get the wrong spriteset shown. Also it doesn't change to the walking spriteset when you use "walk hero"; you would have to do so manually.
Quote:
Because of this I wondered how I'd go about an "NPC will move." Since there is not player control input, what function would I have to use in order for the program to know which way the NPC will move so as to adjust the NPC's sprite accordingly?
Don't even try this. There is only one solution that would work without any graphical artefacts, and that's to wait for each-frame scripts. (I'm halfway through the interpreter overhaul already anyway.)
sheamkennedy wrote:
Now I'll show you a video of the result, notice that there is a slight fault in which occasionally the character appears to be sliding in to the next tile.
Looks nice!
Well, what can I say? I've already solved this problem in my script. It's a result of you not using "hero will move" in the each-step script. (If you don't want to use that script for some reason, you can copy the set of keyispressed conditions instead.)



