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

I was wondering if someone could create an API to do "long rest" calculations in 5th edition?

Right now I see alot of scripts that allow you to set an attribute but what I am looking for is a script which can set one attribute to the value of another. So for example !setattr Spells_level_1 @{Spells_level_1_max}. This way I could have Long Rests calculated and set instantly instead of players having to manually reset them each time.
1412642189
The Aaron
Roll20 Production Team
API Scripter
Very doable. My use power script could be easily repurposed to do this. Let's discuss the details here and see if more peeps have suggestions. Let me start things off with the question "how do you want to tell which attributes should be set to which other attribute's values? (Or set to max?)
1412652444

Edited 1412652642
GM
Pro
I'm a 4th edition player, but I'm kind of looking to do something similar. I pulled some of the ideas from this forum on marking powers used and rests . However, when I get a player request in the API to use a specific power number, I check if it is an encounter or daily and mark it used if so. What I would now like to be able to do is clear the "used" marking for an encounter power during a short rest (!shortrest @{selected|token_id}) and the the "used" marking for a daily power during a long (or extended) rest (!longrest @{selected|token_id}). I'm currently using the actual checkbox on the character sheet by each power. Is this something anyone has done or would be interested in for 5th edition? ... as I was typing I realized that the script I referenced and pulled from was by Aaron. So let me just add thanks, it's awesome, and your code has definitely been helping me and my friends out.
1412655815
Lithl
Pro
Sheet Author
API Scripter
Aaron said: Let me start things off with the question "how do you want to tell which attributes should be set to which other attribute's values? (Or set to max?) Why not just have something like !setattr [attribute from] [attribute to] and then a "long rest" can be a macro with several such calls?
1412657441
The Aaron
Roll20 Production Team
API Scripter
GM said: I'm a 4th edition player, but I'm kind of looking to do something similar. I pulled some of the ideas from this forum on marking powers used and rests . However, when I get a player request in the API to use a specific power number, I check if it is an encounter or daily and mark it used if so. What I would now like to be able to do is clear the "used" marking for an encounter power during a short rest (!shortrest @{selected|token_id}) and the the "used" marking for a daily power during a long (or extended) rest (!longrest @{selected|token_id}). I'm currently using the actual checkbox on the character sheet by each power. Is this something anyone has done or would be interested in for 5th edition? ... as I was typing I realized that the script I referenced and pulled from was by Aaron. So let me just add thanks, it's awesome, and your code has definitely been helping me and my friends out. You're welcome! I have some improvements to do to that script, and that is the script I was talking about modifying for this Brian said: Aaron said: Let me start things off with the question "how do you want to tell which attributes should be set to which other attribute's values? (Or set to max?) Why not just have something like !setattr [attribute from] [attribute to] and then a "long rest" can be a macro with several such calls? Mainly because you would need to do that for every player and power counter. Definitely doable, but a solution that doesn't require editing macros whenever you add a player would be better.
Brian said: Aaron said: Let me start things off with the question "how do you want to tell which attributes should be set to which other attribute's values? (Or set to max?) Why not just have something like !setattr [attribute from] [attribute to] and then a "long rest" can be a macro with several such calls? Mainly because you would need to do that for every player and power counter. Definitely doable, but a solution that doesn't require editing macros whenever you add a player would be better. Well that doesn't seem to much of a problem if you only use a single campaign macro which is then set to a token_id if you ask me? That is how I am intepreting whats being implied here.
A list of the attributes to set would be simple. Just get the current and max values and set the current to the max in a loop. var ListofAttributes = "Attr1Name, Attr2Name, etc"; The only issue is if character sheet makers didn't utilize the current and max values of an attribute and instead created two separate attributes. That makes it more difficult and annoying, but still doable. Just use two lists instead of one.
1412706753
The Aaron
Roll20 Production Team
API Scripter
Certainly, there are many ways to skin that cat. =D
1412721554

Edited 1412721843
Wes
Pro
Sheet Author
For the use case of the D&D 5E sheet which Actoba has built I would recommend being able to adjust the Spell Slots 1- 9 which are on the "Spellbook" tab of the sheet. These are set up a a Attribute using min/max @{spell_slots_l1} thru @{spell_slots_l9}. It would be nice to also make use of this for the Class Resources which are on the "Class" tab of the sheet, these are a bit more tricky as they are currently set up as a repeating fields section. I'm not sure what Actoba's plans are for this section of the sheet, I believe he mentioned updating it, but was waiting to see what path the devs took with future updates the character sheets. Edit: Reread "The" Aaron's first question. The answer is During a Long rest all Attributes should be reset to 0 (Zero). Where as the Max is determined by Class Level. So the Attributes would be the only thing being modified by the API, The Max would be set by the user during character creation and leveling.
Could the Ammo script not be redesigned so that the ammo it adds is = to two variables? such as Max-current?
1413133267

Edited 1413133463
Paul S.
Sheet Author
API Scripter
I already did this with the ammo script using Actoba sheet. Just turn the ammo tracker into a generic tracker. You can set the values to whatever you want. If you try to set higher than the max...it pops in a GM whisper error message. give me a second and I'll post my version of Aaron's script.... <a href="https://github.com/happywanderer/Tracker-API" rel="nofollow">https://github.com/happywanderer/Tracker-API</a> That should pretty much work for you. You can increment or decrement the value of any character sheet attribute by one or more.
&lt;3 you are a star Paul. Thank you. :)