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

Macro to reduce spell slots

1628439868

Edited 1628439969
Hello I expect this may have already been answered somewhere but my search-fu is failing me. I am looking to see if there is a Macro code that will reduce a spell slot by 1, i expect this would need an API but not sure which. Essentially I am trying to make it easier on my cleric players so they can press a button to cast Spiritual Weapon one pops into existence, and takes off a spell slot. I got the first bit down thanks to the amazing Summon Spiritual Weapon API that Nick Olivo has a video for, it would be great if it could ask to use a spell slot and reduce it, a nice neat little package. I am using the 5th Edition OGL API which does spell tracking but every-time they swing with their spiritual weapon it ticks down a a spell slot; I have stopped this from triggering by adding something into the Innate Spell casting line Is this possible, am I missing something obvious, is this all a pipe dream? Thanks in advance
1628651945
The Aaron
Roll20 Production Team
API Scripter
You can't do it with just a macro, it requires the API. Spell slots are stored in attributes or repeating attributes. You'll want either the Ammo script, or ChatSetAttr. Both are in the 1-click script library. 
1628660541

Edited 1628660889
I am perusing other people's posts. I have a similar question but for a completely different system than D&D. Where would I find videos of what other coders have done? So I can incorporate what they have done altered for my system? My spells have a cost but are through the spell power total the character has. Everybody can cast a spell in my system. Spell cost is subtracted from the total spell power the character has, (replenished in sleep for 8 hours, a potion or something else including other magic types, and sometimes technology via energy storage crystal geodes). A first level spell costs one point of spell power even if you miss or fumble it. A second level is two spell power points and so on.  A combination spell such as using Two and two separate Three spells and then the six spells within that framework all use spell power for each spell within the frame work Two is 13th level so will cost 13 Spell power points once, then the two 14th level spells of Three, then the six spells of whatever individually those six are say six eighth level Fumble spells so the target will fumble six times the player-character would need 89 spell power points to cast this combination spell at least.  I am wondering if i can place this 'use' only on the character sheet or does it have be in the HTML coding? I guess you all call that API? All 17 levels of spells will be in the short game. I don't have religions in my game, but have a superior type of magic called Hermetics that takes up the place of needing a religion at all, and is not use based, in power. The Guild/Order items and weapons always work (but only for that person who is allied to that Guild/Order with that Guild Item/weapon and so do the Endowments. These won't have a power use-cost; there are only 20 Guilds and Orders. I am pretty sure this portion would go into the API. Only spells, Runes, and potions will have a use cost. Can I place this on the character sheet or additional Spell, Rune, and potion sheet(s)?
The Aaron said: You can't do it with just a macro, it requires the API. Spell slots are stored in attributes or repeating attributes. You'll want either the Ammo script, or ChatSetAttr. Both are in the 1-click script library.  Thank you!