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

How to display and modify # of spell slots on 5E sheet

Do I need API for this? Is it even possible? I have two characters in my party with abilities that involve spell slots. One is the wizard's arcane recovery (get slots back once per day equal to half wizard level, no getting a slot of 6th level or higher). The other is Primeval Awareness (for each slot spent, gain one minute of knowing whether fiends/dragons/etc. are within a mile of you). I'd like to be able to automate these abilities.
1613273985
David M.
Pro
API Scripter
Could you just use ChatSetAttr to modify the appropriate "lvl1_slots_expended", etc. attribute?
David M. said: Could you just use ChatSetAttr to modify the appropriate "lvl1_slots_expended", etc. attribute? Ah, thank you! slots_expended is likely what I'm looking for. Not quite sure how I'll figure out the extra conditions for each one (how to restrict Arcane Recovery choice but also allow the player to select any combinations of spell slots of 4th level or lower?).
1613276355
David M.
Pro
API Scripter
Yeah, that might be more trouble than it's worth. If you really wanted to, maybe the new state object capability of scriptcards could help. Main macro outputs a card with buttons for each spell level (or a single one if you want query) and sets the roll value in the state object to 0. The buttons call another scriptcard macro (one of 9, or a single one if you want a query) that attempts to add one slot of the appropriate spell level. It would read the "roll" variable in the state object and see if there is "room" to add the desired slot. If so, it would call ChatSetAttr, else it would output an error msg. The reason to use the chat button in the initial macro instead of querying directly is so you can hit it more than once to keep adding slots and adding to the running total of slots gained in the state object. Again, the initial macro would reset that to 0. Like I said, it may be more trouble than it's worth. Any other normal macro is going to have problems due to the number of possibilities for arcane recovery at high level.