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 anyone help with creating a saving throw macro which queries which stat to use?

Hi I have been using a macro to roll my monsters saves for quite a while, however it rolls ALL saves at once. I've just helped a friend who wants to use these macros to make his game run smoother, unfortunately he has a problem player in his group who tends to use a lot of game knowledge that his character wouldn't know... That's a whole other issue though. I was wondering if anyone who has more experience than I do could help me clean this up and give me advice on how to make this macro ask which saving throw i'd like to roll?

&{template:default} {{name=Saving Throws}} {{Str Save= [[1d20+@{npc_str_save}]] | [[1d20+@{npc_str_save}]]}} {{Dex Save= [[1d20+@{npc_dex_save}]] | [[1d20+@{npc_dex_save}]]}} {{Con Save= [[1d20+@{npc_con_save}]] | [[1d20+@{npc_con_save}]]}} {{Int Save= [[1d20+@{npc_int_save}]] | [[1d20+@{npc_int_save}]]}} {{Wis Save= [[1d20+@{npc_wis_save}]] | [[1d20+@{npc_wis_save}]]}} {{Cha Save= [[1d20+@{npc_cha_save}]] | [[1d20+@{npc_cha_save}]]}}
March 08 (7 years ago)

Edited March 08 (7 years ago)
Ziechael
Forum Champion
Sheet Author
API Scripter
The following should work... untested as I'm in a meeting ;)
&{template:default} {{name=Saving Throws}} {{?{Save|Strength,Str Save= [[1d20+@{npc_str_save}]] | [[1d20+@{npc_str_save}]]|Dexterity,Dex Save= [[1d20+@{npc_dex_save}]] | [[1d20+@{npc_dex_save}]]|Constitution,Con Save= [[1d20+@{npc_con_save}]] | [[1d20+@{npc_con_save}]]|Intelligence,Int Save= [[1d20+@{npc_int_save}]] | [[1d20+@{npc_int_save}]]|Wisdom,Wis Save= [[1d20+@{npc_wis_save}]] | [[1d20+@{npc_wis_save}]]|Charisma,Cha Save= [[1d20+@{npc_cha_save}]] | [[1d20+@{npc_cha_save}]]}}}
March 08 (7 years ago)

Edited March 08 (7 years ago)
Ziechael
Forum Champion
Sheet Author
API Scripter
The solution involves adding a query to specify the save type, without the advantage/disadvantage you could do that as just a normal query (best practice is to keep all of the common material and only query the variables). Since you want the adv/disadv in there you need to delve into the world of html replacements (in this instance replacing | with |). For more details on that check out the wiki for advanced use queries.
Thank you! It seems to work great! I'm sorry I had to distract you in your meeting though! I did look into replacing certain characters with the HTML counterparts but it seemed a bit out of my depth ): I will try and mess around with them a bit, but thank you so much!
March 08 (7 years ago)
Ziechael
Forum Champion
Sheet Author
API Scripter
It's a learning curve to be sure but the forums are full of people who will happily guide you through it. Once you've got the basics down it really opens up a world of opportunity. Don't worry about the meeting, it was super dull! ;)