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

Token-Mod Woes

I'm trying to make a trap where a chest is a mimic and it moved the original chest to gmlayer and moves mimic to token layer. These are my macros: Activate-Trap !token-mod --set layer|gmlayer --ids @{selected|token_id} !token-mod --set layer|objects --ids -LDig2vl28jJgoIHrHYi Disable-Trap !token-mod --set layer|objects --ids @{selected|token_id} !token-mod --set layer|gmlayer --ids -LDig2vl28jJgoIHrHYi It doesn't seem to be working properly and I don't know what I am doing wrong. Here's a common scenario I went through while testing: Mimic hidden in gmlayer, Chest visible in objects layer. Select Chest and click " Activate-Trap " token action button. Mimic is moved to objects layer from gmlayer but Chest isn't moved from objects layer. Mimic and Chest are both on objects layer - select Chest and click token action " Disable-Trap " " Disable-Trap " moves both Chest and Mimic to gmlayer. Clicking " Actvate-Trap " at this point moves both Chest and Mimic to objects layer and clicking " Disable-Trap " moves both to gmlayer I'm at a loss I don't know why this is working the way it is if anyone can help me I would greatly appreciate it.
I found a work around for my issue - set the imgsrc as the link to the saved image in my Library. Activate-Trap !token-mod --set imgsrc|<a href="https://s3.amazonaws.com/files.d20.io/images/54973488/Xt8A9F0wWcdIh_TD56j06g/original.png?15276495695" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/54973488/Xt8A9F0wWcdIh_TD56j06g/original.png?15276495695</a> Disable-Trap !token-mod --set imgsrc|<a href="https://s3.amazonaws.com/files.d20.io/images/53050582/RY-37L61lYuQNIEoNhJuUQ/original.png?15251815005" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/53050582/RY-37L61lYuQNIEoNhJuUQ/original.png?15251815005</a> Now I just need to give the token its mimic stats / attacks / abilities
1527652489
The Aaron
Pro
API Scripter
By default, TokenMod affects the selected tokens and any additional tokens specified with --ids. Usually, this is the behavior desired. However, in this case, you are sending the id of the selected chest token to both commands by virtue of it being selected, and an extra time to the first command. This has the effect of moving it to the GM layer on the first line, then back to the object layer on the second. Similar behavior with the second macro.&nbsp; You can avoid this by swapping the order of the commands or by adding --ignore-selected to both commands.&nbsp;
The Aaron said: By default, TokenMod affects the selected tokens and any additional tokens specified with --ids. Usually, this is the behavior desired. However, in this case, you are sending the id of the selected chest token to both commands by virtue of it being selected, and an extra time to the first command. This has the effect of moving it to the GM layer on the first line, then back to the object layer on the second. Similar behavior with the second macro.&nbsp; You can avoid this by swapping the order of the commands or by adding --ignore-selected to both commands.&nbsp; Thanks The Aaraon - the functionality of how it works makes a lot more sense to me. I'll keep this in mind for future use, but until then I already setup the trap by swapping "imgsrc" and that seems to be working out alright for me.
1527681999
Finderski
Pro
Sheet Author
Compendium Curator
You could also create a rollable table token with the two images and that wouldn’t require the API at all.&nbsp; I create those and then make the multi-sided token the default token for the character sheet.&nbsp;
1527682320
The Aaron
Pro
API Scripter
I believe he's swapping the represents as well.
Finderski said: You could also create a rollable table token with the two images and that wouldn’t require the API at all.&nbsp; I create those and then make the multi-sided token the default token for the character sheet.&nbsp; You know what... I should have thought of that already. I use this method of rollable tables with only 2 entries to toggling zombies into corpses and corpses into zombies, as well as piles of bones into skeletons and skeletons into piles of bones. The Aaron said: I believe he's swapping the represents as well. Yep. Right on the money.