ok given it a bit more thought and came up with the following:
as the add-on works with ghost tokens, it will need to not only create a ghost token of the teleported token, but also of the tokens left behind a ghost token needs to be created on the new map so that all players 'keep in view'. If I use the teleport moment as the event (cause thats a macro where I can place a hook), then the following needs to happen:
-Map A (starting point)
-Map B (destination point)
-OTokA (original toks on map A)
-GTokB (ghost toks on map B)
Lets say there are 4 players (P1,P2,P3,P4), each with one player token (1,2,3,4).
When a token 1 teleports from A to B
- a GTok1A is created on A and the OTok1B appears on B.
- GTok2B, GTok3B, GTok4B are created on B.
- all GToks are given the (hidden?) 'Ghost' state (which might interfere with FW states, so a better name needs to be found, any suggestions??)
- the GToks are given a property w42.mtt.ghostMap where the map name is stored where the OToks reside.
- the GTok is given 2 properties w42.mtt.TelCoordX/Y where the X/Y coords of the teleport on A are stored.
- the OTok is given a property w42.mtt.ghostMap where the map name is stored where the GTok resides.
- the OTok is given 2 properties w42.mtt.TelCoordX/Y where the X/Y coords of the teleport on B are stored.
When OTokB moves
first there is a check whether w42.mtt.ghostMap exists, if so then the following happens:
- the position offset versus the XY of the teleport are calculated
- the first token is picked from the resulting list of: getTokens(with state 'Ghost' AND w42.mtt.ghostMap==currentMap)
- The owner of that token is retrieved and a autoExec broadcast is send to that owner that:
- - asserts(the owner is on the correct map)
- - moves the GhostToken to the position with the same offset vs the teleport coords stored there.
In case of multiple owners, each owner will be send this update, however because the move offset is fixed in stead of relative, the Ghost Token will always be placed on the same spot.
When a OTokA moves the same happens but than the other way round.
When 1 eg OTok2A also moves to map B then in addition to the above, the GTok2B needs to be removed
When ALL OTokA are moved to map B then ALL GToks on map A need to be deleted.
Any comments? Gaps, critics, failures, missed stuff, etc.?
Now the one thing Im still wondering about is: what happens when e.g OTok3A does not teleport to map B but to map C...
Excel Tools: Table editor and Illumination Generator
MT Tools: Dungeon Builder Tool, Bag of Tricks: Teleport pads, Pits, Traps and Warded Areas and onMouseOverEvent
Framework: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade and Only War
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow
My dropbox referral. If you use this then both you and me get 500Mb extra space. 2.5Gb total.