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 .
×
May your rolls be merry + bright! 🎄
Create a free account

Carrying A Modification Across A Macro?

Is there a way that when I request a mod to a die roll and the value can be re-used elsewhere? i.e. If I add a +5 modification when I first run the macro, I want to also be able to use that +5 elsewhere without re-requesting it, like to check for Crit Confirms and such. Thanks! :)
If it is used within the same macro or inside another macro called by the first, it will remember the value. For example if your macro were:     /r 1d20 + ?{Mod|0}    /r 1d8 + ?{Mod} The macro would remember ?{Mod} to be the value entered and not ask for it a second time. Once the macro finishes however, it no longer maintains the ?{Mod} value and requests a value the next time the macro is called.
Just be very careful to keep the same case and spacing, etc wherever you make use of it.  I find it best to setup the query once and copy/paste it exactly, wherever it's needed.
1482253706
Ziechael
Forum Champion
Sheet Author
API Scripter
Alternatively, if you have a spare bar/bubble on your token you could incorporate that into the macro, "1d20 + @{selected|bar1}" where the value of bar 1 is 5 will allow you to use @{selected|bar1} anywhere you want to reuse that value... I find this useful for persistent bonuses that you may want to use in subsequent macros too :) The advantage of this one is that there are no pop-ups and you can edit the bar value as needed between macros depending on the circumstances/buffs in place.
Thanks! That worked perfectly. :)
1482319275
Andrew C
Marketplace Creator
Another option too, is to create an Attribute to hold the value. I do this with skills since for NPCs the skill system in Diana Ps really good character sheet handles badly.  Those really are great places to drop "constant modifiers" and then have more trnasient ones (spells, terrain, luck systems, etc) appear in a Query modifier
What I'm trying to do is not have to rely so much on pulling stats from a monster character sheet but creating more 'Universal' macros that I can use with ANYTHING. Makes it faster to get monsters on the table and my games are more 'consistent' across each other.
1482393372

Edited 1482393414
Andrew C
Marketplace Creator
Sure, what I was suggesting is you sneak into the end of a monster's list of Attributes maybe something named "static-mod", and use the same name on every monster. Then your macros can just call [[1d20+@{static-mod}+?{Transient Modifier|0}]]