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

Tracking Spells with NPCs in 5E OGL

Good day,  I was hoping someone could help me.  How do I cast a NPC spell or track NPC spells in Roll20.  I am a pro member, and am familiar with the macros.  However, I am unable to figure out how to reset my remaining spells for NPCs or bring up any tracking information.  
1550517512
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
That would depend on what sheet you are using. Many of the popular sheets have companion scripts for tracking resources.
1550519557
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
You'll need to use an API script. The 5e by Roll20 sheet, what used to be referred to as the 5e OGL sheet, has a companion available for it from the one click drop down menu on your game's API console page. I haven't used the script myself, as I play mostly PF and SF, but the documentation should explain how to use it.
The OGL companion script will track spells for PCs, but not NPCs. This is because an NPC spellcaster my represent multiple tokens on the VTT. The way I would track the spells of the NPCs individually is to mark which spells they have cast on their specific token rather than on the character sheet.
1550523673
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Thanks Kyle. I don't normally use the Roll20 sheet, so that's good to know.
Awesome!  Thanks Kyle and Keith.  I wasn't sure if I was doing it right or not.  
You can use colored status markers on NPC mooks to track how many spells they have left. Green for lvl 1 spells, orange for lvl 2 and so forth. If you use the ChatSetAttr API you can even have the spells tick down automatically. A setup like this will be visible to the players though, so it might not be optimal for you.
@ravenknight   I was just pondering how to do it, but that method rocks.  It's an easy and quick visual in game. It still doesn't solve my secondary problem and wishing that the spells were easily clickable or referenceable in game.  I want to use a spell in the game on the NPC character Sheet and give the synopsis in the chat so that we don't spend time looking it up out of game.  Some encounters just happen, and the 5e OGL system is great for these situations. But on the fly spellcasters I find myself avoiding in case they have a spell i'm not familiar with.  
I use this macro as a token action for my spellcasters, it works for PC's and NPC's, but it takes a bit of fiddling for each caster, so ymmv. This particular block is for the is for the Mage NPC. You will need to add and remove spell slots individually for different casters so it's not great for completely on the fly, but with a few minutes time you can make it work for any caster. Normal 0 false false false EN-US X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:8.0pt; mso-para-margin-left:0in; line-height:107%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri",sans-serif; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} /w "@{selected|character_name}" &{template:atk} [[ {{desc=***@{selected|character_name} Spells*** __________________________ Spell Save **DC** [[@{spell_save_dc}]], Spell attacks +[[@{spell_attack_bonus}]] __________________________ **Cantrips** [@{Selected|repeating_spell-cantrip_$0_spellname}](~Selected|repeating_spell-cantrip_$0_spell) | [@{Selected|repeating_spell-cantrip_$1_spellname}](~Selected|repeating_spell-cantrip_$1_spell) | [@{Selected|repeating_spell-cantrip_$2_spellname}](~Selected|repeating_spell-cantrip_$2_spell) | [@{Selected|repeating_spell-cantrip_$3_spellname}](~Selected|repeating_spell-cantrip_$3_spell) ** 1st Level   (@{selected|lvl1_slots_expended}/@{selected|lvl1_slots_total}) spell slots** [@{Selected|repeating_spell-1_$0_spellname}](~Selected|repeating_spell-1_$0_spell) | [@{Selected|repeating_spell-1_$1_spellname}](~Selected|repeating_spell-1_$1_spell) | [@{Selected|repeating_spell-1_$2_spellname}](~Selected|repeating_spell-1_$2_spell) | [@{Selected|repeating_spell-1_$3_spellname}](~Selected|repeating_spell-1_$3_spell) **2nd Level    (@{selected|lvl2_slots_expended}/@{selected|lvl2_slots_total}) spell slots** [@{Selected|repeating_spell-2_$0_spellname}](~Selected|repeating_spell-2_$0_spell) | [@{Selected|repeating_spell-2_$1_spellname}](~Selected|repeating_spell-2_$1_spell) **3rd Level (@{selected|lvl3_slots_expended}/@{selected|lvl3_slots_total}) spell slots** [@{Selected|repeating_spell-3_$0_spellname}](~Selected|repeating_spell-3_$0_spell) | [@{Selected|repeating_spell-3_$1_spellname}](~Selected|repeating_spell-3_$1_spell) | [@{Selected|repeating_spell-3_$2_spellname}](~Selected|repeating_spell-3_$2_spell) **4th Level (@{selected|lvl4_slots_expended}/@{selected|lvl4_slots_total}) spell slots** [@{Selected|repeating_spell-4_$0_spellname}](~Selected|repeating_spell-4_$0_spell) | [@{Selected|repeating_spell-4_$1_spellname}](~Selected|repeating_spell-4_$1_spell) **5th Level (@{selected|lvl5_slots_expended}/@{selected|lvl5_slots_total}) spell slots** [@{Selected|repeating_spell-5_$0_spellname}](~Selected|repeating_spell-5_$0_spell) }} As needed change the spell level "spell-#" , cantrips are "spell-cantrip" and the spell number for each where the first spell is $0.
Am I to understand that the only problem is that I only include the spell level if the npc has that spelllevel  I'm embarrased to say but I havn't dived too much into the coding, could an if number is not null then statement work in such a code? 
I am pretty sure if-then's aren't possible within Roll20 even with the API. Others may know better.
1550614984
Kai
Plus
Sheet Author
It should be possible to include the spell description in the output that is sent to chat. You are using the OGL 5e sheet?
Hi, sorry for the long delay. Yes i'm using OGL 5e Sheet.