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

[HELP] TokenMod breaks when my players use a macro

1523201867

Edited 1523202940
I am using TokenMod for two of my macros to initialize turns and finish the turns too. They work fine if me as the GM uses them. But when I log in as a player, or log in with a secondary test account - the sandbox breaks sometimes, but it consistently does not change the tokens as it should It all used to work well, but I created a  macro Character with all my utility macros, including these too. I wanted to give players acess to some of my macros so I put them back into the collection. The pieces of code in the macro are so simple that I have no idea where even to start debugging. This is the second time something really unexpected happens in a short period of time... I hope my game is not broken. The macros are: &{template:npcaction} {{name= }} {{rname= End of Turn}} {{description= @{selected|character_name}'s turn finished. }} !token-mod --set aura1_color|transparent --ids @{selected|token_id} !token-mod --set aura2_color|transparent --ids @{selected|token_id} &{template:npcaction} {{name= }} {{rname=Turn start}} {{description= @{target|character_name}'s AP and MP recovered. }} !token-mod --set statusmarkers|red:[[@{target|AP}]] --ids @{target|token_id} !token-mod --set statusmarkers|green:[[@{target|MP}]] --ids @{target|token_id} !token-mod --set aura1_color|00ffff --ids @{target|token_id} !token-mod --set aura2_color|c0c0c0 --ids @{target|token_id}
1523203349
The Aaron
Pro
API Scripter
Hmm.  For the players to use the --ids, you have to turn it on in the config or by running: !token-mod --config players-can-ids Players can otherwise only run TokenMod on tokens they can select. Do you get an error message when the sandbox breaks?
1523203762

Edited 1523203907
That should be it! weird things is, it worked pretty much in this exact same way before, at least that is what I thought... TypeError: Cannot read property 'id' of undefined I kinda panicked a bit, sorry. I will try to fix it now. EDIT: I am using it on a token the player can select, btw.
1523203978
The Aaron
Pro
API Scripter
hmm.. TokenMod should  catch any errors and dump a message to the chat with details about what happened and where.  If that didn't happen, it might have been in another script.  Definitely let me know if you get a reproducable case.
sent you a pm, showing the exact problem. The thing is this macro ONLY runs the TokenMod Script. and it happnes exactly after I run it.
After The Aaron helped me out, we found out this was a conflict with one of my personal scripts (nothing I ever shared with the community). So, TokenMod was not the issue.