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

Trying to Get Macro to populate Spell Slot Level

Hello, I am trying to get this macro to pull the first query ?{Spell Slot level} and use the selected number from there in the Inline Roll for Damage.  Unfortunately naming them the same query has not accomplished this and I need some help on how to make this happen.  Does anyone have any ideas?? &{template:spell}  {{name=Whatever (Level ?{Spell slot level | 3 | 4| 5| 6| 7| 8| 9})}} {{castingtime=1 Action}} {{range=120ft }} {{v=1}} {{s=1}} {{duration=Instant}}  {{description= A bright streak flashes from your pointing finger to a point you choose within range and then blossoms with a low roar into an explosion of flame. Each creature in a 20-foot-radius sphere centered on that point must make a ?{Spell Save? | Charisma, **Charisma ST** | Con, **Constitution ST** | Dex, **Dexterity ST** | Int, **Intelligence ST** | Str, **Strength ST** | Wis, **Wisdom ST**} or take [[5 + ?{Spell slot level}d8 ]] ?{Dmage type? | Acid, **Acid Dmg** | Cold, **Cold Dmg** | Fire, **Fire Dmg** | Force, **Force Dmg** | Lightning, **Lightning Dmg** | Necrotic, **Necrotic Dmg** | Radiant, **Radiant Dmg** | Thunder, **Thunder Dmg**}  on a failed save, or half as much damage on a successful one. The fire spreads around corners. It ignites flammable objects in the area that aren’t being worn or carried.}}  {{savedc= [[12]]}}
1675492289
GiGs
Pro
Sheet Author
API Scripter
If I'm understanding the post correctly, the problem is the space here ?{Spell slot level | That space is considered part of the query name. Try ?{Spell slot level|
The issue is the extra space you have in the first instance of the query before the vertical pipe.  I would remove all of the spaces before/after vertical pipes and commas from the queries. You can also move the queries outside of the spell description to make it more readable: ! ?{Spell slot level|3|4|5|6|7|8|9} ?{Spell Save?|Charisma,**Charisma Saving Throw**|Con,**Constitution Saving Throw**|Dex,**Dexterity Saving Throw**|Int,**Intelligence Saving Throw**|Str,**Strength Saving Throw**|Wis,**Wisdom Saving Throw**} ?{Damage type?|Acid,**Acid Damage**|Cold,**Cold Damage**|Fire,**Fire Damage**|Force,**Force Damage**|Lightning,**Lightning Damage**|Necrotic,**Necrotic Damage**|Radiant,**Radiant Damage**|Thunder,**Thunder Damage**} &{template:spell}  {{name=Whatever (Level ?{Spell slot level})}} {{castingtime=1 Action}} {{range=120ft }} {{v=1}} {{s=1}} {{duration=Instant}}  {{description= A bright Streak flashes from your pointing finger to a point you choose within range and then blossoms with a low roar into an explosion of flame. Each creature in a 20-foot-radius sphere centered on that point must make a ?{Spell Save?} or take [[5 + ?{Spell slot level}d8 ]] ?{Damage type?}  on a failed save, or half as much damage on a successful one. The fire spreads around corners. It ignites flammable objects in the area that aren’t being worn or carried.}}  {{savedc=[[12]]}}
1675493057

Edited 1675493187
GiGs
Pro
Sheet Author
API Scripter
I like Jarren's suggestion to move the queries for readability. For the record, a line starting with ! is not printed to chat, so you can do things like Jarren does there. If you list them in the same order, the user will be prompted in the correct order. PS you have a typo in one of yiur query names. ?{Dmage type? | should be ?{Damage type?|
That’s awesome. Thank you for catching my extra space and for the ! Command recommendation. The typo is a good catch as well.  A new question is there a way for the three query’s to work in the character sheet spellcard with “at higher levels”. In essence trying to get the same result but putting the query into the built in spellcard for the character sheet instead of a separate template?
Michael  said: A new question is there a way for the three query’s to work in the character sheet spellcard with “at higher levels”. In essence trying to get the same result but putting the query into the built in spellcard for the character sheet instead of a separate template? For the Damage Type, yes. Just take the ?{Damage type?|Acid|Cold|Fire|Force|Lightning|Necrotic|Radiant|Thunder} query and throw it into the Damage Type field. The nice benefit of that is that you don't even need the ?{Spell Slot Level} macro anymore, as that will be automatically queried and calculated if you have anything in the 'HIGHER LVL CAST  DMG:'  field. The downside is that you can't do that for the 'Spell Save' query, as it is a dropdown on the character sheet, and not a text field that can have a query embedded into it.
Thank you.