RPTools.net

Discussion and Support

Skip to content

It is currently Fri Feb 23, 2018 11:49 am 






Reply to topic  [ 2 posts ] 

Previous topic | Next topic 

  Print view

Author Message
 Offline
Kobold
 
Joined: Fri Feb 13, 2015 7:13 pm
Posts: 4
 Post subject: Trouble with moveTokenFromMap macro
PostPosted: Sat Apr 04, 2015 2:18 pm 
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.


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9483
Location: Netherlands
 Post subject: Re: Trouble with moveTokenFromMap macro
PostPosted: Sat Apr 04, 2015 2:43 pm 
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

My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent and
DPI.
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 2 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 1 guest





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman