This gives me ideas for a lot of things that I want to fix or improve on the engine's side, to make these scripts work better or make improvements possible.
Yes, either you want to resume the old path from where you left off, or re-path towards the new destination, and in either case can reconstruct the path. For Blood Ledger it would be sufficient to just remember the location when pathing was interrupted, and the path segment (destination).
But it does give me ideas for more path commands: one to compute a path and append (or prepend) a new path onto the existing one, so that you can build up a path that passes through a series of waypoints. For that to actually be useful, there would also have be commands to tell an NPC or hero to follow a computed path (currently, pathfinding NPCs/heroes always recompute the path every step). But that's far from necessary, probably not worth adding right now.
What if we have just one set of path commands, instead of duplicating them for heroes and npcs? NPC references are < 0, hero caterpillar ranks are >= 0. Though that means that you wouldn't be able to use NPC IDs, unlike every other command that operates on NPCs.
I think maybe the x/y positions should be in pixels to future-proof it.
These pathing commands don't have anyting to do with "move slice with wallchecking".
Regarding diagonal walls and diamonds, I confused myself. I should have said taking a shortcut of 20 pixels, not 10 pixels. And forget about octagons for the moment.
The idea is that if there's a wall at * which can be corner-cut around, then you could move diagonally from any of A/B/C/D to any of the others except the opposite one.
Code: Select all
A
B*C
D
A diagonal wall wouldn't allow that. It would allow A to B and C to D but not A to C and B to D; or vice versa.
This is fine for tile-based movement, but how does that translate to pixel-based (e.g. "move slice with wallchecking")? It's like a superposition of two diagonal walls. It's not actually a diamond, but more like a point at the center of the tile - except that would let you overlap the tile by 10px, which shouldn't be allowed. An ordinary diagonal wall has no trouble translating to pixel-based movement.