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

Resolving Sub-Macros Sequentially

Hello everyone,  I've got one macro changing a character's attribute and another macro calling just that attribute. I would like to run those two macros sequentially within one superordinate macro, having the attribute changed before it is called.  Is that even possible, and if: How?  Thanks for any insights! 
1599045850

Edited 1599046861
Oosh
Sheet Author
API Scripter
It isn't possible with vanilla macros. You'll need API for that, but presumably you're already using it if you're changing an Attribute. Are you using ChatSetAttr for that? A vanilla macro calls Attributes before it sends the code to the API sandbox, so it won't work in a straight-forward way. If you give a bit more detail on what you're trying to achieve one of the API boffins will have a solution or a script.
First of all, Oosh, Thank you for the help! I’ve just begun running a FFG Star Wars campaign and am trying and automising as much rolls as possible, using mostly selected/target macros. Unfortunately, the API Dice Roller doesn’t accept any more complex input than simple numbers, apparently (I couldn’t make it accept any [[operations]]). So my idea was doing the actual calculation in a separate macro, parking the result in a Mule Char, and calling it from there into the dice roll.     And yes, I’m using ChatSetAttr for that; the specific macro being: !setattr --silent --name -DicePool --space-difficulty|     [[1 +     {{@{target|space-silhouette}-@{selected|space-silhouette},10}<1} +     {{@{selected|space-silhouette}-@{target|space-silhouette},-10}>2} +     {{@{selected|space-silhouette}-@{target|space-silhouette},-10}>3} +     {{@{selected|space-silhouette}-@{target|space-silhouette},-10}>4}]]
1599054275
David M.
Pro
API Scripter
Maybe your master macro/ability could call up a chat menu with buttons for each subordinate macro/ability iteration? Then just click them all in order. The attributes would be updated prior to each subordinate call. It is recommended to use abilities instead of collection macros for chat menus in order to avoid html replacement hell. More on chat menus  here Also, you may want to add a confirmation message to the chat after each !setattr call verifying the attribute has been changed.