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 with OnMyTurn & TokenMod reset Action Points on turn start

Hi, I'm playing a homebrew system that's using action points. Currently I have a button to reset action points that players click on their turn, but it's a bit of a hassle for some of my players and I thought I'd try to automate it. It seems it should be doable with Tokenmod and onMyTurn, however I'm not getting it to fire. Currently I have an ability added to my character called OnMyTurn with the following script in there: !token-mod --set bar1_value|+20! --ids @{selected|token_id} If I fire it manually with the token selected it works, but when the OnMyTurn api fires it nothing happens. Not sure what I'm doing wrong or if what I'm attempting is doable. (I'm under the impression that OnMyTurn would default the selected to be the token who's turn it is.)
1671291402
timmaugh
Pro
API Scripter
Have you turned on the --playerscanids argument of TokenMod? It works for you because you're a GM but it's  the Script Moderator (the "script player") who is responsible for firing both the OnMyTurn command (by listening for the turn order change) and the TokenMod command (as downstream of the OMT call)... ...and the Script Moderator is not (and can't be) a GM. If you turn the --playerscanids argument on, this should work. Just understand that it lets your players reference tokens by ID (which they can get by @{target|token_id} ), which lets them affect tokens to which they don't normally have control.
I've added the players-can-id to on. The player can manually trigger the ability but the OnMyTurn script still doesn't fire it when the character's turn comes around. Adding any other line like a chat message triggers just fine as it's supposed to by OnMyTurn
I managed to solve it, turns out my problem was I had an old version of OnMyTurn. Found a more recent one posted by Aaron here: <a href="https://app.roll20.net/forum/permalink/9167427/" rel="nofollow">https://app.roll20.net/forum/permalink/9167427/</a> In case anyone else has a similar problem in the future!
1671328862
The Aaron
Roll20 Production Team
API Scripter
Ah, great!&nbsp; Glad you found a solution.
Thanks! :)