View Full Version : How to make lua call to get token on top of all others?
SilentRuin
March 31st, 2022, 21:57
I note that whenever a token is drag/dropped it will be set to the topmost token. But when a setPosition is done it is not. I don't see any "tokeninstance" functionality (or not recognizing it by name of it) to bring to front like in window. Is there something I can call/do to a tokeninstance to get force it to the top of the token stack in lua?
Moon Wizard
March 31st, 2022, 22:51
There is no API to do this. Changing the way setPosition works could break assumptions that other extensions are making for placement.
Regards,
JPG
SilentRuin
March 31st, 2022, 23:59
There is no API to do this. Changing the way setPosition works could break assumptions that other extensions are making for placement.
Regards,
JPG
You would add an API which you triggered when its someone's turn or the CT token is double clicked on.
SilentRuin
April 1st, 2022, 00:14
There is no API to do this. Changing the way setPosition works could break assumptions that other extensions are making for placement.
Regards,
JPG
Is there a way to induce a drag/drop via pure LUA on a token?
celestian
April 1st, 2022, 01:37
I note that whenever a token is drag/dropped it will be set to the topmost token. But when a setPosition is done it is not. I don't see any "tokeninstance" functionality (or not recognizing it by name of it) to bring to front like in window. Is there something I can call/do to a tokeninstance to get force it to the top of the token stack in lua?
This has come up a lot of times in the past and still no real good solution there. I tried this for a extended period but the only kludges were inconsistent for me. I think it actually picks up the lowest token first instead of the top which makes no sense to me. I mean, if all the tokens are on the same layer, when a token gets initiative why can't it just move it to the top when "active".... I dunno.
Best of luck resolving this. I think Diablobob has done some work with this and has something that works but my experience was not 100%.
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.