I want to make a macro that copies a token on a map and puts the where a PC is on another map.
I have so far copied the token and moved it to the new map but the copy of the token is placed at the same coordinates as it has on the original map and not where the PC token is.
Here is my macro so far. (The broadcasts are just there so I know if the X and Y coordinates are changing. They all broadcast the coordinates of the PC token calling the macro - which is what I want).
----------------------------------------------------------------------
[h: x = getTokenX(0)]
[h: y = getTokenY(0)]
[h: updates="{
name: 'dropped backpack'
}"]
[h: broadcast(x)]
[h: broadcast(y)]
[h: copyToken('Backpack', 1, "BASE", updates)]
[h: moveTokenFromMap('dropped backpack', "BASE", x, y)]
[h: broadcast(x)]
[h: broadcast(y)]
------------------------------------------------------------------------
So, what I'm confused about is why the 'dropped backpack' token is not moving to the location of the PC token and is instead moving to the same location but just on the new map.
Trouble with moveTokenFromMap macro
Moderators: dorpond, trevor, Azhrei, Gamerdude
-
- Kobold
- Posts: 4
- Joined: Fri Feb 13, 2015 7:13 pm
Re: Trouble with moveTokenFromMap macro
when you use copytoken all settings to the copied token (thus after its has been copied) are reset when the macro finishes. so either set them to the original and then copy or use the update section of the copytoken macro to set the xy coords.
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