Arrange function (Send to Back/Front) Glitched?

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: dorpond, trevor, Azhrei

Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)
Post Reply
Tyshalle
Giant
Posts: 173
Joined: Sat Jul 10, 2010 5:45 pm

Arrange function (Send to Back/Front) Glitched?

Post by Tyshalle »

I've noticed the Arrange function on tokens/objects/backgrounds is finnicky. If token A is on top of token B, and you hit "Send to Back" on Token A, it drops behind Token B. If you then hit "Send to Back" on Token B, it should go behind Token A, but instead usually just sits there.... Same thing happens with "Send to Front".

Is there anything that can be done about this? I would expect that you could permanently send tokens behind other tokens, but for some reason that just isn't the case, which leads to a lot of finnicking around trying to get things right.

This is especially bad for my Card Game, which uses a macro that shuffles the cards by sending random cards to the back in a random order. After a few cards it winds up just getting stuck, and all the rest of the cards refuse to go anywhere.

User avatar
aliasmask
RPTools Team
Posts: 9031
Joined: Tue Nov 10, 2009 6:11 pm
Location: California

Re: Arrange function (Send to Back/Front) Glitched?

Post by aliasmask »

I've noticed the same behavior. I think what should happen is the send to back looks at the z-order of all the tokens and takes the lowest value and subtracts one. But I've notice when doing multiple tokens this way they will have the same low z-order and then it's just random which one is on top. I'm not sure where the break down is. Perhaps the newest token sent to back is not apart of the calculation for future checks until something else happens.

You can probably make your own send to back macro that starts at one value and then decrements each time it's clicked. You can even assign a hot key to make the process easier.

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

Re: Arrange function (Send to Back/Front) Glitched?

Post by wolph42 »

I did create 'token ordering' macros in the BoT. I did this specially for a map designer (recklessenthusiasm) who used a LOT of tokens to draw maps. With the tools you can select those and manipulate them.

Tyshalle
Giant
Posts: 173
Joined: Sat Jul 10, 2010 5:45 pm

Re: Arrange function (Send to Back/Front) Glitched?

Post by Tyshalle »

I looked at what you did in the bag of tricks, and it's the first time I've seen a macro that gives you the ability to literally set a token's Z-Order, which is awesome, but the problem is you have to do each token manually from what I can tell. What I need is the ability to select 20-50 tokens simultaneously, click one button, and have it randomly order them. I'm doing a card game, and so this would simulate the shuffling of the cards.

Here's the Shuffling Macro code:

Code: Select all

[h:TokenList = getSelectedNames()]
Shuffling [r:Intensity =  listCount(TokenList))] Tokens...
[h,if(isNumber(macro.args)): Intensity=floor(Intensity*macro.args)]
([r:Intensity] Move Intensity)<BR>
[h,for(Index,0,Intensity,1,""), CODE:
  {
     [h:Pick=eval("1d"+ listCount(TokenList))-1]
     [h:ThisToken=listGet(TokenList,Pick)]
     [h,token(ThisToken): sendToBack()]
     Sending [r:ThisToken] back...<BR>
  }
]
I don't know what kind of coding magic you had to do to be able to pick the order of a token in your bag of tricks, but if there's just a simple line of code that lets you pick the order, then maybe it'd be possible for me to replace "sendToBack()" with whatever that Z-order code would be with a 1d50 or something.


EDIT: NEVERMIND! That was surprisingly easy. h:setTokenDrawOrder(1d50) works perfectly, to the point that I don't know why the guy that created the framework made such a complicated set of macros to shuffle the cards when that one line of text does it better.


Post Reply

Return to “MapTool”