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

Passing queries from macro to macro

December 10 (8 years ago)

Edited December 10 (8 years ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
So, the Pathfinder game that I am starting in soon doesn't use a character sheet on Roll20. I prefer having macros setup beforehand for the majority of my possible actions as I have a hard enough time doing semi-decent RP without having to figure out what all to add to my rolls. My first attempt at an all-in-one single attack macro for my magus (spellstrike spell damage bonus, and all feat/situational modifiers included) resulted in a macro output using the default template that ate up chat window space at an abominable rate. This started me hunting for a way to roll my damage based on whether the attack roll was a crit or not without having to reenter all those roll queries for the damage roll. I remembered that Silvyre had demonstrated that roll queries inside an API command button were resolved prior to the button being pressed, and used this to save values from chat message to chat message.

Not sure if anyone else will find this useful, but I found a way using API Command Buttons that allows me to pass roll query values from the attack macros to the damage macros and output the damage macro only when it is activated. I've made a gist of the macros rather than pasting them here because there are A LOT of html escapes and for things that normally don't have to be escaped (like inline roll brackets and things not in a roll query).

Hope it helps some people,

Scott
December 10 (8 years ago)
Cool! I like to use this trick in conjunction with ChatSetAttr to streamline my more complex macros.