Hello, i see the wiki and i found the "getSelectedNames()" function, but this function always return a of all tokens selected ORDERED by name. I tested with differents selects orders, 1 by 1, etc. And always returned the same.
My intention is select first the "attacker" token and second the "defensive" token, and with a macro referencing his weapons and armours and automate calculate damage, etc.
Any else idea has welcome. Many Thanks.
How to obtain "selectedTokens()" but ordered with order of tokens selection
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice
Re: How to obtain "selectedTokens()" but ordered with order of tokens selection
this has been done in the past as well. There are several methods. I guess 'impersonated' vs 'selected' is easiest. The other method is to select the attacker, open form (that has onChangeSelection function embedded) and use that to select the target.
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
- Full Bleed
- Demigod
- Posts: 4736
- Joined: Sun Feb 25, 2007 11:53 am
- Location: FL
Re: How to obtain "selectedTokens()" but ordered with order of tokens selection
Select both and determine who is the Attacker and who is the Defender based on who has initiative.Sawejkr wrote: ↑Sun May 29, 2022 10:37 amHello, i see the wiki and i found the "getSelectedNames()" function, but this function always return a of all tokens selected ORDERED by name. I tested with differents selects orders, 1 by 1, etc. And always returned the same.
My intention is select first the "attacker" token and second the "defensive" token, and with a macro referencing his weapons and armours and automate calculate damage, etc.
Any else idea has welcome. Many Thanks.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."