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

5e OGL Spell Picking Macro

Hey guys I'm trying to write a query macro where spells can be chosen and casted but it doesn't work. Currently what I've written looks like this: ?{SELECT CANTRIP | Sacred Flame, %{selected|repeating_spell-cantrip_$0_spell}| Resistance, %{selected|repeating_spell-cantrip_$1_spell} } Does anybody know what's wrong with it? Also, is there a way to call the spell name so that I don't have to manually key in each one for each NPC? Ie. Something like %{selected|repeating_spell-cantrip_$0_NAME}, %{selected|repeating_spell-cantrip_$0_spell} Thanks
Also, does anybody know the formula for OGL's NPC Traits repeating section rolls? %{selected|repeating_npctrait_$0_trait} does not seem to do it
Benjamin Quekers said: Hey guys I'm trying to write a query macro where spells can be chosen and casted but it doesn't work. Currently what I've written looks like this: ?{SELECT CANTRIP | Sacred Flame, %{selected|repeating_spell-cantrip_$0_spell}| Resistance, %{selected|repeating_spell-cantrip_$1_spell} } Does anybody know what's wrong with it? So the problem with this is due to the  order of operations . Abilities (%{}) are processed before queries so if the ability has characters that need to be encoded (as defined in  Advanced Usage for Roll Queries ), these character will break the query unless they are encoded within the ability. The simplest way to get around this is to use  Ability Command Buttons rather than queries. While this takes up more room in the chat, it will only clutter your chat window if you whisper the button to yourself. Benjamin Quekers said: Also, is there a way to call the spell name so that I don't have to manually key in each one for each NPC? Ie. Something like %{selected|repeating_spell-cantrip_$0_NAME}, %{selected|repeating_spell-cantrip_$0_spell} There is and you are extremely close to figuring it out on your own. Main difference here is that you are wanting to access a single attribute of the spell rather than a roll. So you need to use an attribute call (@{}) instead of an ability call (%{}) @{selected|repeating_spell-cantrip_$0_spellname} will get you the name of the first cantrip in the character sheet. Something that I do for my NPCs with spells is to create a spellbook ability like this, then all I have to do is add/remove rows when necessary. @{wtype} &{template:default}{{name=@{character_name} Spellcasting}}{{Spell Save DC @{spell_save_dc}=@{spell_attack_bonus} to hit with spell attacks}}{{• Cantrips (at will) =[@{repeating_spell-cantrip_$0_spellname}](~selected|repeating_spell-cantrip_$0_spell) [@{repeating_spell-cantrip_$1_spellname}](~selected|repeating_spell-cantrip_$1_spell) [@{repeating_spell-cantrip_$2_spellname}](~selected|repeating_spell-cantrip_$2_spell) }}{{• 1st level (4 slots) =[@{repeating_spell-1_$0_spellname}](~selected|repeating_spell-1_$0_spell) [@{repeating_spell-1_$1_spellname}](~selected|repeating_spell-1_$1_spell) [@{repeating_spell-1_$2_spellname}](~selected|repeating_spell-1_$2_spell) [@{repeating_spell-1_$3_spellname}](~selected|repeating_spell-1_$3_spell) }}{{• 2nd level (3 slots) =[@{repeating_spell-2_$0_spellname}](~selected|repeating_spell-2_$0_spell) [@{repeating_spell-2_$1_spellname}](~selected|repeating_spell-2_$1_spell) }}
1512314510

Edited 1512314523
Benjamin Quekers said: Also, does anybody know the formula for OGL's NPC Traits repeating section rolls? %{selected|repeating_npctrait_$0_trait} does not seem to do it NPC traits do not have rolls like PC traits. Instead you would need to create an ability for each trait like this @{wtype} &{template:npcaction} {{name=@{npc_name}}} {{rname=@{repeating_npctrait_$0_name}}} {{description=@{repeating_npctrait_$0_desc}}}
If you upgrade to pro you can use Power Card Spell book macro I made see <a href="https://app.roll20.net/forum/post/5724325/power-ca" rel="nofollow">https://app.roll20.net/forum/post/5724325/power-ca</a>... [@{selected|repeating_spell-1_$16_spellname}](~selected|repeating_spell-1_$16_spell) Only show prepared spells and all the cantrips.
Thanks for your help Kyle G. I'll try using Ability Command buttons instead! That power card looks great, Craven, but I'll hold off on upgrading till I can get a group together. ------------------- Hey, in the wiki it says: "You can discover the name of most of the attributes in the sheet by hovering over them. After a couple of seconds a title will pop up and tell you how to referencing them." -&nbsp; <a href="https://wiki.roll20.net/5th_Edition_OGL_by_Roll20#" rel="nofollow">https://wiki.roll20.net/5th_Edition_OGL_by_Roll20#</a>... But nothing happens when I do it :( Has this feature been discontinued? And is there a reference sheet for finding out attribute names? It's a real pain in the butt to dig around and guess from OGL's github file, the DC is too high for me when done that way
Any in particular that you are having difficulty with? One method that I use is to use the development tools in the browser to click on the specific area and look for the attribute that way. If I can't find it there I will look in the github file for it, but I guess I have expertise in that skill.
I think I'm done with my macros and can now concentrate on world-building. Thanks for your help Kyle G, you've been very helpful.&nbsp;
Kyle G. You are a god, and I bow to your knowledge. Please keep the macros coming!!!!! I hate the OGL sheet and you have made it bearable.