Hi
When I use getLastPath() on a valid movement path it gives me a json array holding all the squares moved over including the initial one:
[{"x":12,"y":16},{"x":13,"y":17},{"x":14,"y":18},{"x":15,"y":19},{"x":16,"y":20}]
However, if the movement is invalid It just gives me the start and the end of the movement:
[{"x":9,"y":17},{"x":12,"y":16,"fail":1}]
Is this the intended behaviour? I would expect it to still give me every square moved over but just flag the invalid move as failed.
I am trying to set up a map where all the buildings have a roof (using Hill VBL), and to put a teleport pad in the roof above where the door would be. The onTokenMove macro would then check that only the last square of movement was invalid before moving the token to the interior map. Is there a better way of doing this?
Thanks
Ian
getLastPath()
Moderators: dorpond, trevor, Azhrei
Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior.
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior.
- Full Bleed
- Demigod
- Posts: 4736
- Joined: Sun Feb 25, 2007 11:53 am
- Location: FL
Re: getLastPath()
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."
Re: getLastPath()
indeed, better to ask on discord. But yes: that is intended behaviour. If you turn off the AI you'll get the entire path. You might have noticed the 'fail' indicator in the lastpath which gives you a hint that this really is as intended: if the path 'failed' it will tell you start and finish and that not path could be found to bridge those to points.iSax wrote: ↑Fri Mar 11, 2022 6:13 pmHi
When I use getLastPath() on a valid movement path it gives me a json array holding all the squares moved over including the initial one:
[{"x":12,"y":16},{"x":13,"y":17},{"x":14,"y":18},{"x":15,"y":19},{"x":16,"y":20}]
However, if the movement is invalid It just gives me the start and the end of the movement:
[{"x":9,"y":17},{"x":12,"y":16,"fail":1}]
Is this the intended behaviour? I would expect it to still give me every square moved over but just flag the invalid move as failed.
I am trying to set up a map where all the buildings have a roof (using Hill VBL), and to put a teleport pad in the roof above where the door would be. The onTokenMove macro would then check that only the last square of movement was invalid before moving the token to the interior map. Is there a better way of doing this?
Thanks
Ian
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS