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

Can you create a macro that results in a drop down list of spell macros?

Hey so my 3.5 campaign is getting along and I have a number of spell casters in the party. Rather than adding the spells to their macro bar or requiring them to always have the character sheet open I was hoping I could do something like having a single button for each spell level. When you click it, it produces a drop down list of spells and you just select what you want then it runs the macro for that spell from the spell sheet.

I've tried combining something like:
@{repeating_spells02_$0_spellcast02}
?{Select Spell |Spell1,0|Spell2,1}

Where it would in theory pull the request up then replace the $0 with spell 1 (0) spell 2 (1) etc. but that doesn't work, nor does using:
?{Select Spell | Spell1, repeating_spells02_$0_spellcast02 | Spell2, repeating_spells02_spells02_$1_spellcast02}

It just pops up the text box version of the dialogue menu with the text written in it.

Am I going about this wrong or is it just not feasible?
June 09 (8 years ago)
Andrew C
Marketplace Creator
I have tried a few versions and been unhappy, I suspectyou could try a kind of "halved information version where you split the ability name.
[[ ?{Which Spell?|Spell 1, @{repeating_spells02_$0|Spell 2, @{repeating_spells02_$1}_spellcast02} ]]

i just haven't tested it thoroughly.
June 09 (8 years ago)
Tetsuo
Forum Champion
Roll Queries currently end at the first closing curly brace the parser encounters. Within a Roll Query, other characters that serve as Roll Query syntax (vertical bars and commas) will always be treated as such by the parser, potentially causing unwanted behavior when placed within the Roll Query for other purposes. To work around this, replace some but not all of these "problematic" characters with their HTML entities.

See here for more information.
June 09 (8 years ago)
Ziechael
Forum Champion
Sheet Author
API Scripter
I handle my players spells by creating a nested query driven dialogue then then outputs a button to chat that they click to cast. This allows me to have all the spells set up as macros and using the button saves me having to ensure that they are suitably escaped for being as part of a nested query (see below for the Sorcerer's setup, I have spreadsheets set up to help me generate this nonsense ;) ):
/w "@{selected|character_name}" ?{What Level|
0,?{Spell|
Acid Splash,[Acid Splash](!
#acidsplash)|
Dancing Lights,[Dancing Lights](!
#dancinglights)|
Daze,[Daze](!
#daze)|
Detect Magic,[Detect Magic](!
#detectmagic)|
Disrupt Undead,[Disrupt Undead](!
#disruptundead)|
Light,[Light](!
#light)|
Mage Hand,[Mage Hand](!
#magehand)|
Read Magic,[Read Magic](!
#readmagic)|
Resistance,[Resistance](!
#resistance)}|
1,?{Spell|
Backbiter,[Backbiter](!
#backbiter)|
Benign Transposition,[Benign Transposition](!
#benigntransposition)|
Identify,[Identify](!
#identify)|
Mage Armour,[Mage Armour](!
#magearmour)|
Magic Missile,[Magic Missile](!
#magicmissile)|
Orb of Fire, Lesser,[Orb of Fire, Lesser](!
#orboffirelesser)|
Targetting Ray,[Targetting Ray](!
#targettingray)}|
2,?{Spell|
Belker Claws,[Belker Claws](!
#belkerclaws)|
Fireburst,[Fireburst](!
#fireburst)|
Mirror Image,[Mirror Image](!
#mirrorimage)|
Rainbow Beam,[Rainbow Beam](!
#rainbowbeam)|
Snowball Swarm,[Snowball Swarm](!
#snowballswarm)|
Spectral Hand,[Spectral Hand](!
#spectralhand)|
Spider Climb,[Spider Climb](!
#spiderclimb)|
Wings of Cover,[Wings of Cover](!
#wingsofcover)}|
3,?{Spell|
Fireball,[Fireball](!
#fireball)|
Fly,[Fly](!
#fly)|
Haste,[Haste](!
#haste)|
Magic Circle Against Evil,[Magic Circle Against Evil](!
#magiccircleagainstevil)}|
4,?{Spell|
Evard's Black Tentacles,[Evard's Black Tentacles](!
#evardsblacktentacles)|
Explosive Cascade,[Explosive Cascade](!
#explosivecascade)|
Force Missiles,[Force Missiles](!
#forcemissiles)|
Greater Invisibility,[Greater Invisibility](!
#greaterinvisibility)|
Orb of Cold,[Orb of Cold](!
#orbofcold)|
Wings of Flurry,[Wings of Flurry](!
#wingsofflurry)}|
5,?{Spell|
Earth Reaver,[Earth Reaver](!
#earthreaver)|
Hold Monster,[Hold Monster](!
#holdmonster)|
Reciprocal Gyre,[Reciprocal Gyre](!
#reciprocalgyre)|
Wall of Limbs,[Wall of Limbs](!
#walloflimbs)}|
6,?{Spell|
Chain Lightning,[Chain Lightning](!
#chainlightning)|
Globe of Invulnerability,[Globe of Invulnerability](!
#globeofinvulnerability)}
}


June 10 (8 years ago)

Edited June 10 (8 years ago)
I found a great example on how to do it thanks to your replies - https://app.roll20.net/forum/post/2159164/post-you...

The new problem I'm having is when I try to include the following in a Magic Missile entry:
[[ [[ {floor((@{level}+1)/2),5}kl1 ]]d4+[[{floor((@{level}+1)/2),5}kl1]] ]]

It tends to not print the Notes portion of the 3.5 spell template. I'm assuming theres some part of it that needs correcting to html or it's just not possible to turn it into a number for some reason with the brackets?

Any help would be appreciated.

[Edit] Just noticed theres some commas in there, but I'm unsure how to get around them - Making it into a macro and referencing it didn't work, nor did making it a variable on the character sheet.

June 10 (8 years ago)
Tetsuo
Forum Champion
you need to convert the appropriate }|, characters to HTML entities per the Advanced Usage page if you're trying to include the magic missile macro above in a drop down macro