Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Auto Sizing with Flippable Tokens

Hi All, Could someone describe how to make the token resize AUTOMATICALLY when the Multi-Sided menu is used to flip the token. I need exact steps please as I am a novice and I am not sure where the macros go; (Roll20 Sidebar or on the Abilities section on the Character Sheet) Current progress - 1. I created a few R20 Sidebar Macros 'Size-Galleon' and 'Size-Token' that changes the token size in R20 - which work but you need to put it 'In bar' and click on them. eg, !token-mod --set currentside|n width|[[32*70]] height|[[11*70]] and !token-mod --set currentside|n width|[[1*70]] height|[[1*70]]  2. I made the flippable token 'Ship-Galleon1' with 3 sides called Token, Deck1, Deck2 and added it to my character sheet and 3 sizes are selectable but don't change size. 3. I copied the format of another post here and added the below code to the R20 sidebar. This seems to have failed....  It throws up a selection menu if made into a button. !token-mod {{--set ?{side|Token,currentside#1 size#70|Deck1,currentside#2 width#24*70 height#6*70} }}|  Thanks for your help - Cheers Rich.
?
1651187687
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
If you want it to happen automatically, this would require a dedicated API script, not a macro. Are you familiar with coding in JavaScript? If so, you can probably write something that would work with an "on change" event. But you would need to find a way of limiting it to just that token. More trouble than just using the token mod commands you have up there. I would suggest putting those commands into a  Chat Menu , or if you like a challenge, a drop down menu. Such a macro might look something like:  &{template:npcaction} {{rname=Faces}} {{description=[Face 1](!token-mod --set currentside|1 width|[[32*70]] height|[[11*70]]) [Face 2](!token-mod --set currentside|2 width|[[1*70]] height|[[1*70]])}} Yielding: This is assuming you are using the D&D 5th Edition by Roll20 Sheet. If it is another sheet, you could construct a similar macro using its roll template, or just use the default roll template.
Ok Thanks Keith. I will stick with what I have.  This was at my tech limit already.. Cheers.
1651309646

Edited 1651309820
@Roll20 If the token size could be stored in the rollable table edit menu it would be fantastic!
I'm not seeing the point of wanting to auto size a multi-sided token that you need to right-click on to bring up the menu to choose its side (if I'm understanding your intent correctly). I suppose non-pro users might want this, though. Since you need to select the token anyway, and you have associated the token with a sheet, you should put the macros as abilities on the sheet. That way, when you select the token, the token action buttons (for the abilities/macros) will appear and you just click on the one you want. For the three sides of the token you can use three Token mod macros that set currentside, width and height as your examples show. You can use u in Token mod for the units rather than 70, to simplify the macro, as an example a macro named Token (as side 1); Token !token-mod --set currentside|1 width|32u height|11u
Doug E. said: I'm not seeing the point of wanting to auto size a multi-sided token that you need to right-click on to bring up the menu to choose its side (if I'm understanding your intent correctly). I suppose non-pro users might want this, though. Since you need to select the token anyway, and you have associated the token with a sheet, you should put the macros as abilities on the sheet. That way, when you select the token, the token action buttons (for the abilities/macros) will appear and you just click on the one you want. For the three sides of the token you can use three Token mod macros that set currentside, width and height as your examples show. You can use u in Token mod for the units rather than 70, to simplify the macro, as an example a macro named Token (as side 1); Token !token-mod --set currentside|1 width|32u height|11u So just put the commands on each sheet and they should pop up when I click the token? I will try it. Thanks Doug.