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 .
×

Pathfinder Drop Down Spells Macro

Hi All, I've been playing around with macros to try and improve both my and my players quality of play, but I've run into a roadblock with my spells macro.  What I'm attempting to do is create a macro that drops down with a list of spells of the selected character, and then, when one is selected, rolls it using the built in macro in the Pathfinder character sheet. This is what I have: &{template:pf_spells} {{name=@{selected|Token_Name}'s spells}} {{?{Spells|@{selected|repeating_spells_$0_name}, %{selected|repeating_spells_$0_roll}| @{selected|repeating_spells_$1_name}, %{selected|repeating_spells_$1_roll}| @{selected|repeating_spells_$2_name}, %{selected|repeating_spells_$2_roll}| @selected|repeating_spells_$3_name}, %{selected|repeating_spells_$3_roll} }}} However, when I run it, instead of a drop down menu, I end up with a prompt that says Spells: Detect Magic, &{template:pf_spell The second part (after the colon) is in a text box. I'm sure that I'm missing something obvious, but I have no clue what.  Any ideas?
1493313724
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
It's because roll queries end at the first } (also has weird behavior if it runs into a | or comma earlier than expected) that they encounter, and roll templates are just chock full of those. There's no easy way to do this as a drop-down, which is why the sheet has ability command button menus that you can call easily (the buttons at the top of the sheet).
You'll run into drop-down lists referring to other macros like the RepeatingSections for spells and attacks.  The Called macros contain characters that break the DropDown Query.  You would have to adjust the macro text of each of the called Repeating Sections to replace any }  and | characters with HTML replacements. I have a pretty massive "Spellbook" set of macros  (about a dozen spells per level) I can share if you would like, but it can bit a bit much :)
1493315660

Edited 1493315781
I suspect I have the answer to this then, but would it be possible to make a macro that effectively copies the roll script and replaces the } characters with the HTML equivalent (which I believe is "%7d")?
Not really, because (at least with Pathfinder) the attack and spell sections pull in hard-coded values that include characters that mess with drop-down queries. The best you can do to create a drop-down of spells is to manually recreate the spell macros for each entry. I haven't updated it in a while, but you can see an example of the "SpellBook Macro" on the Wiki-Pathfinder Macro Examples ( LINK )
1493316698
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
That is outside the capabilities of the macro system. You can do it through an API script or a google sheet. Is there  reason you don't want to use the menu of ability buttons that the sheet creates for you?
...I did not know those existed.  Wow, thanks so much, that is literally everything I needed it for!
1493318272
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Happy to help.