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 used to rotate a token with multiplication

1611012978

Edited 1611013060
I can get my macro to prompt the user for an angle and use that angle to rotate the selected token, with TokenMod. !token-mod --set rotation|?{Degrees|0} But I can't get it to prompt the user for a number, multiply that number by 20, and use the result of that multiplication in TokenMod. !token-mod --set rotation|?{Points|0}*20 I want the user to be able to enter 2 to rotate the token by 40 degrees. Or -1 to rotate it -20 degrees. I've tried using parentheses, brackets, braces, etc. !token-mod --set rotation|{?{Points|0}*20} !token-mod --set rotation|[?{Points|0}*20] !token-mod --set rotation|(?{Points|0}*20) Isn't there a way to force the prompted value to be multiplied by 20 before it is passed to the API script? Thanks --Andy
1611014599

Edited 1611033979
You just need to wrap the number in an inline roll, and add a + symbol.  It will always rotate clockwise this way: !token-mod --set rotation|+[[?{Degrees|0}*20]] If you want to allow for rotation clockwise or counter-clockwise, you'll have to add another query: !token-mod --set rotation|?{Direction|Clockwise,+|Counter-clockwise,-}[[?{Degrees|0}*20]] Here's an example of a preset list of cardinal directions: !token-mod --set rotation|[[?{Degrees|North,0|Northeast,1|East,2|Southeast,3|South,4|Southwest,5|West,6|Northwest,7}*45]]