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

Applying a value at the beginning of a player's turn.

As the topic states, I need a way to apply a numerical additive (or subtractive) value from a main pool at the beginning of that player's turn from any token / unit they may control. This will greatly help with certain Statistics like HP or MP that slowly regenerate over time, without having to micro-manage a dozen units each with their own individual regeneration values per turn.
1508646851
The Aaron
Pro
API Scripter
That is certainly doable. Can you give some examples of how you see this working? something like “when a token’s turn comes up, increase bar1 by the value of the MP_regen attribute in the associated character”
The Aaron said: That is certainly doable. Can you give some examples of how you see this working? something like “when a token’s turn comes up, increase bar1 by the value of the MP_regen attribute in the associated character” That's literally it, your example is exactly what I'm thinking of.  However, if you're only controlling a single unit, the script isn't really needed.  However, lets say your controlling an entire army of units.  Then any time your turn comes up, all tokens you control gain that much towards any bar, like HP or MP.
1508710448
The Aaron
Pro
API Scripter
Ok, so it's more like "when a given token's turn comes up, add the regen bonus to bar1 for every unit associated with that token." So, a Token might be used for each player, and "every unit associated with that token" might be all the tokens on the same map that are controlled by that player?
Yup ^.^
1508775292
The Aaron
Pro
API Scripter
Ok. So sounds like this could be a purely event driven snippet with no user interface.
The Aaron said: Ok. So sounds like this could be a purely event driven snippet with no user interface. Yep, of course the only thing that would be UI would be the set variable value, either by GM or Player.  Afterword, there would be no further editing required.
1508799425
The Aaron
Pro
API Scripter
I was thinking the GM could set that in the script, or it could be handled by convention, like 'bar1_turn_update_formula' or some such.
The Aaron said: I was thinking the GM could set that in the script, or it could be handled by convention, like 'bar1_turn_update_formula' or some such. Y'know what?  That's probably a better idea.