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

Customizable Roll Listener and PC/NPC Saving Throws

1698762994

Edited 1698763073
Hello. I am using the OGL DND5e sheet. I am trying to get a saving throw button macro to appear for the  CRL/Customizable Roll Listener API/mod  for both NPC AND PC actions that require you to roll a saving throw. I can get the macro button to appear for NPC actions and spells using: !crl \\create,name=Dexterity Save,template=spell atk dmg atkdmg npcatk npcdmg npcfullatk, text=Dexterity saving throw \\%{Macros|dexteritySave} The macro "dexteritySave" macro is below if it matters. &{template:npcaction} [Dexterity Save](~selected|dexterity_save) Anything I have tried to get that button to appear for a PC though hasn't worked. I've been searching through google and the forums and I can only find posts of people asking how to get crit/fumble macros to work. Any help would be greatly appreciated.
Add the 'simple' template and see if that's what is being rolled for PCs.
I tried a few variations and it still didn't work. :( 
1698766473
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Chad/Pyrias! Besides CRL, you could look into Condefinition , which among other things, looks for saving throw text and provides buttons like you are looking for. If you use Group Check, and Apply Damage, it respects those, too:
1698767394

Edited 1698767905
Ok there's a couple of problems: The text that is produced by casting Burning Hands does not include 'Dexterity Saving Throw' in the text.  It produces 'Dexterity' and 'Save' in two separate outputs (even though it looks like a single output, they are enclosed in two different 'span' tags).   So this almost works:  !crl  \\create,name=Dexterity ,template=spell atk dmg atkdmg npcatk npcdmg npcfullatk, text=Dexterity  \\%{Macros|dexteritySave} But it might pull up the CRL output more often than you are hoping for. However it doesn't work because the %{Macros| dexteritySave} is being parsed before CRL ever sees it. You'll need some html replacements or a way to get that raw text into the Ability. The second issue is that your 'dexteritySave' macro on the 'Macros' character is malformed. You're missing template fields. At a minimum you'll need a {{description=}} field, but you'll likely want an {{rname}} as well. Try something like this: &{template:npcaction} {{rname=Dexterity Save}} {{name=Roll}} {{description=[Dexterity Save](~selected|dexterity_save)}}
1698768860
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The hit accuracy of CRL (or any such solution) can usually be improved by turning on "Show Description" in the spell.
omg Jarren you nailed it. Thank you so much for your help everyone! I will also check on Condefinition as that API sounds really neat Keith! I didn't realize that "Dexterity" and "save" were two separate outputs. With the usage of "&&" it got everything to work. That was what was missing. I used:  !crl \\create,name=Dexterity Save,template=spell atk dmg atkdmg npcatk npcdmg npcfullatk, text=Dexterity && save \\%{Macros|dexteritySave} With the same macro: &{template:npcaction} [Dexterity Save](~selected|dexterity_save) And now it works. I saw what you meant about the macro being wrong when I first set it up. When I tried it the "correct" way it would show the brackets and everything in plain text when the macro fired off. I don't know why. When I removed the "extra" and correct formatting/text it showed only the button.
I also agree that using Condefinition is probably an easier way to do this. :)  But to explain a bit more: part of what is happening is that some parts of the CRL command are being processed by Roll20 before CRL ever sees them. I have 'Macros' set up with this ability: &{template:npcaction} {{rname=Dexterity Save}} {{name=Roll}} {{description=[Dexterity Save](~selected|dexterity_save)}} And I use your command for CRL: !crl \\create,name=Dexterity Save,template=spell atk dmg atkdmg npcatk npcdmg npcfullatk, text=Dexterity && save \\%{Macros|dexteritySave} The %{Macros|dexteritySave} ability is being parsed before CRL ever sees it, and the &{template:npcaction} is being filtered out as well.  If you open the CRL character and look at the ability that is created there you can see that: But you can manually adjust that output like this: And you'll get a nice template in chat:
1698774469
timmaugh
Forum Champion
API Scripter
One note I'll share is that you can use a ZeroFrame {&escape} tag if you want to break up that formation (and then you wouldn't have to go manually fix the Dexterity Save ability that gets created. ZeroFrame escaping works like deferrals in that you can strategically position the characters you declare so that in the command line they serve to break up text formations that might trigger processing (like obscuring Roll20 from seeing %{ Macros|dexteritySave}). Escaped characters, however, are removed at the end of the metascript processing (which is after Roll20 parsing), before the command line gets to its final destination (CRL, in this instance). Put simply, it just takes declaring the escape string in the {&escape} tag: {&escape ^} ...and then using that construction in your command line where you need to break up a text construction: %^{ Macros|dexteritySave} So the final CRL line would look like: !crl \\create,name=Dexterity Save,template=spell atk dmg atkdmg npcatk npcdmg npcfullatk, text=Dexterity && save \\%^{Macros|dexteritySave}  {&escape ^} That should preserve the %{Macros|dexteritySave} text to be still in the CRL command line, and on into the ability that it creates.
Okay, I have some homework to do then to learn how to use these tools better. Thanks again! I just started tinkering with the meta box tools so this should be interesting.