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

Tokenmod Math Help

1675533928

Edited 1675534808
I'm absolutely lost, I'm trying to have Tokenmod increment bar3 by 1 when an ability is used. This is what I have: !token-mod --ids @{Rathbone|character_id} --set bar3_current|+1 --ignore-selected But it instead keeps adding 5 to bar3, I can't figure out why. Using bar_value, [[1]], and [[1d1]] have the same effect. What am I doing wrong?
1675549435
GiGs
Pro
Sheet Author
API Scripter
Try with a different character and see what happens.
1675565156
The Aaron
Roll20 Production Team
API Scripter
I bet you have 5 tokens representing that character. It is finding all of them and adding one to them, but the bar is linked to an attribute, so it is adding 1 to the attribute five times. Try only affecting the token on the current page: !token-mod --ids @{Rathbone|character_id} --set bar3_current|+1 --ignore-selected --current-page Or referencing the attribute directly: !token-mod --ids @{Rathbone|character_id} --set bar3_current|=[[@{Rathbone|SOME_ATTR}+1]] --ignore-selected
1675565188
The Aaron
Roll20 Production Team
API Scripter
Or unlink the attribute. 
1675566077

Edited 1675567030
GiGs
Pro
Sheet Author
API Scripter
I didn't think of the multiple tokens. Thats why your the aaromancer :) This was going to be my next suggestion - referencing the attribute directly: !token-mod --ids @{Rathbone|character_id} --set bar3_current|=[[@{Rathbone|SOME_ATTR}+1]] --ignore-selected
Yeah, I am guilty of copying and pasting tokens to move them between maps. That fixed it. Thanks! The Aaron said: I bet you have 5 tokens representing that character. It is finding all of them and adding one to them, but the bar is linked to an attribute, so it is adding 1 to the attribute five times. Try only affecting the token on the current page: !token-mod --ids @{Rathbone|character_id} --set bar3_current|+1 --ignore-selected --current-page Or referencing the attribute directly: !token-mod --ids @{Rathbone|character_id} --set bar3_current|=[[@{Rathbone|SOME_ATTR}+1]] --ignore-selected