Trouble with moveTokenFromMap macro

If you have searched the other User Creations subforums and an answer to your question has not been found, please post here!

Moderators: dorpond, trevor, Azhrei, Gamerdude

Post Reply
shadowwolfie87
Kobold
Posts: 4
Joined: Fri Feb 13, 2015 7:13 pm

Trouble with moveTokenFromMap macro

Post by shadowwolfie87 »

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.

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Trouble with moveTokenFromMap macro

Post by wolph42 »

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.

Post Reply

Return to “Requests for HELLLLP!”