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

Is a Initiative Carry-over system doable with API?

I have a energy point system that doubles as your initiative. Attacks, skills, and boosts, decrease your points by X amount. the amount you use subtracts from your next turn total.     Every player has X amount of static initiative  (based on stats and gear etc) So  round 1:  They have 10points and 10 initiative; they use 4. 2nd Round: They have 6 points and 6 initiative, they use 2 3rd round: They have 8 points and 8 initiative.  I was using Macros to subtract or add to the initiative table with great success.  Unfortunately I think I have hit the wall where I cant use macros, because I need to reference not only their base amount,  but the amount they will have next turn.   This becomes very hard to track without the players having two dice at home at their disposal.  one to keep track of how much they have, and one to keep track of how much they are using.  
1496619035
The Aaron
Pro
API Scripter
Definitely doable.  Just a matter of breaking it down into the interface you expect and all the commands you need.
1496674137

Edited 1496674153
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Actually, I don't think you'd even need the API for this. You can modify turn tracker values via the &{tracker} syntax: [[?{points used}-@{staticInit} &{tracker:-}]] You'd still have to manually re-sort the tracker, which the API could definitely make easier.
[[?{points used}-@{staticInit} &{tracker:-}]] How would i go about setting this up?  how does it keep track of the points that i have used?   my +1 -1 point macros are just: [[+1 &{tracker:+}]]   would be super sweet if this works, but my macro skills are barely beyond basic tutorial haha.  
1496780780
Lithl
Pro
Sheet Author
API Scripter
Brian T. said: [[?{points used}-@{staticInit} &{tracker:-}]] How would i go about setting this up?  how does it keep track of the points that i have used?   my +1 -1 point macros are just: [[+1 &{tracker:+}]]   would be super sweet if this works, but my macro skills are barely beyond basic tutorial haha.   This macro will ask you to enter "points used" when you use it, and subtract the attribute named "staticInit" from whatever you put. The result will be subtracted from the selected token's initiative. Note: as written, this would have to be an ability instead of a macro. If you changed @{staticInit} to @{selected|staticInit}, it could be either.
1496781141

Edited 1496781203
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Also, staticinit should be replaced with whatever the name of your static initiative modifer is. Also also, note that I'm not totally clear on how your system actually works, so this equation may not be correct.
So with my current knowledge of Macros, it seems like this isnt really possible, since i would need to be able to modify Attributes, and from what I have read, you can't do that without an API.   if i could have macros  modify attributes i could make an attribute called "APTotal" and "APSpent" and then reference the APtotal and always have the spent be updating on each macro that adds or subtracts from the APspent attribute.    so maybe just reference the attribute APtotal as an attribute and use one of the token bars to represent "APSpent".
1496894078
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
You are a pro subscriber, so you could use Jakob's ChatSetAttr script to do it.