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 using Tokenmod and OnMyTurn to regenerate health?

Hi all, I hope this is the correct forum for this. My problem is pretty much as the title describes - my players are going up against an Oni, and I'd like for him to regenerate health at the start of each of his turns, along with a little emote like "Oni's wounds begin to heal....". I think my problem is that if I input just the '!token-mod --set bar3_value|+20' command, nothing happens (I assume because the Oni's token isn't targeted). I tried updating to '!token-mod --ids @{target| MCoS3e3obUWhbM1_QHO}  --set bar3_value|+20', but it didn't do much. I'm probably just misunderstanding how ids work, but would anyone be able to lend a hand?
1595394106
Victor B.
Pro
Sheet Author
API Scripter
Token Mod adjusts the token.  Doesn't send anything to chat.  Others have created token abilities that send something to chat allowing for regen.  Put another post out there such as "how do I show to players a regen abiltiy?"
1595401898
The Aaron
Roll20 Production Team
API Scripter
Use this TokenMod command: !token-mod --set bar3_value|+20! --ids @{selected|token_id} Normally, the API doesn't work with @{selected} commands issued by a script, but OnMyTurn will replace it with the current token's details from the turn order.  The ! on the +20 will prevent it from going over the max health. You can add the flavor text on another line of the ability. 
The Aaron said: Use this TokenMod command: !token-mod --set bar3_value|+20! --ids @{selected|token_id} Normally, the API doesn't work with @{selected} commands issued by a script, but OnMyTurn will replace it with the current token's details from the turn order.  The ! on the +20 will prevent it from going over the max health. You can add the flavor text on another line of the ability.  Gave this a go but it still doesn't seem to be firing, unfortunately. I'll probably just go with a token ability - there are some advantages to it not being automatic anyway. Many thanks!
Browser crashed and wiped out my post...  Cliff notes version. Being curious if I could use this for characters with fast healing, I set it up.  Here is the log message: "Error: No attribute or sheet field found for character_id -KqJPEpGJjjqOKjDgWvD named token_id" My OnMyTurn attribute has this in it: !token-mod --set bar3_value|+2! --ids @{selected|token_id} /me heals? The line to chat is coming through. When I copy and past, !token-mod --set bar3_value|+2! --ids @{selected|token_id} straight to the chat window, it works fine. The ! stops the hit points from going over max.  It's just not working from the attribute. Syntax error?
1595531561
The Aaron
Roll20 Production Team
API Scripter
Oh, do you have Players Can IDs turned on in the help?  That would prevent it from having worked.
1595531644
The Aaron
Roll20 Production Team
API Scripter
Also, I think it has to just be: !token-mod --set bar3_value|+20! --ids @{token_id} (no selected| )
Hello (The) Aaron, I verified that Players Can IDs is turned off (isn't that what I have to turn on for the other script we were discussing to work correctly in a different game of mine?)  Tried, " !token-mod --set bar3_value|+20! --ids @{token_id}" but, alas, no change.
1595541430
The Aaron
Roll20 Production Team
API Scripter
Oh, sorry for the confusion, I should have said, you "You need to have it on.  Not having it on would prevent it from working."
1595985893
The Aaron
Roll20 Production Team
API Scripter
Ok, sorry for the delay, it's: !token-mod --set bar3_value|+20! --ids @{ selected| token_id}