Place one token on top of another

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
xavram
Dragon
Posts: 891
Joined: Tue Apr 20, 2010 8:22 pm

Place one token on top of another

Post by xavram »

I thought this would be simple, to create a macro to place a smaller token on another token. Since both tokens have their rotation point set at the center, I foolish thought it would be a matter of getting the bigger tokens position and then setting the smaller token to that. But it seems maptool uses upper left as its position or something like that.

Is there any easy way to accomplish this? This is a gridless map, with tokens that aren't the same size, some are squares some aren't, and no locking to the grid. Any suggestions would be appreciated!

User avatar
Bone White
Great Wyrm
Posts: 1124
Joined: Tue Aug 23, 2011 11:41 am
Location: Cornwall, UK

Re: Place one token on top of another

Post by Bone White »

You'd have to offset the token's x and y pos by half the token size. How you'd do that without using the grid, I wouldn't know


xavram
Dragon
Posts: 891
Joined: Tue Apr 20, 2010 8:22 pm

Re: Place one token on top of another

Post by xavram »

Sadly, with a non-square token for the big token and the ability for it to be rotated into any angle, this does not appear to work.

I'm also in .87, so don't have getTokenWidth/Height but I know the width/height of the tokens involved, so can just hard code the values in. But, its not resulting in the smaller token ending up in the middle of the bigger token. It ends up in the same place everytime, no matter if the bigger token (which is rectangle) is pointing straight up or to the left.


xavram
Dragon
Posts: 891
Joined: Tue Apr 20, 2010 8:22 pm

Re: Place one token on top of another

Post by xavram »

Sure...

Image

Image

so the direction of the red arrow isn't important but what I need is for it to end up in the center of the car. As you can see, it ends up in different spots on the car, given the cars rotation.

They are both Top down tokens, with free rotation. The arrow token is 75x75 and the car is 150x75.

xavram
Dragon
Posts: 891
Joined: Tue Apr 20, 2010 8:22 pm

Re: Place one token on top of another

Post by xavram »

Found a different way to skin this cat, working for me now...thanks though, sometimes you just need someone else to point you in the right direction.

Post Reply

Return to “Macros”