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

Drop Down Macro Chose More than 1 Variable

Hi all, I'm working on some macros for a homebrew system that combines elements from some different games. Each character has three saving throws, fortitude, reflex, will, like in D&D 3rd edition, but I'm using a different die rolling mechanic. I have the following macro for rolling a Fortitude save: /roll 1d@{mod-Strength}!! + 1d@{mod-Willpower}!! In this scenario strength has a value of 4 and willpower has a value of 8. It rolls a d4 and a d8 and adds them together (after exploding, if necessary), which is what I want to happen so that is working fine (I'm mixing D&D 3rd and Savage World concepts here if anyone is wondering) I was going to create one for Reflex and Will as well but then I wondered if I could create a single macro (SavingThrow) so players can always click that and select fortitude, reflex, or will. However, I'm not sure if you can pull more than one variable from a selection (and having them pull twice or write a new variable would defeat the purpose of simplicity). I suspect it would look something like /roll ?{Ability Selection| Fortitude,@{Selected|??}| Reflex,@{Selected|??}| Will,@{Selected|??}} Where the ?? are where I suspect something would go, but don't know what/if at all possible. Thank you for your help.
1588416746
GiGs
Pro
Sheet Author
API Scripter
When the macro runs, roll20 scans through the macro contents and replaces any queries with the option the player chose. Which means you can do this /roll 1d?{Ability Selection| Fortitude,@{Selected|mod-fortitude}| Reflex,@{Selected|mod-reflexes}| Will,@{Selected|mod-willpower}} and if the player chooses Will, and mod-willpower has a score of 6, that will become /roll 1d6 I've obviously guessed at what your attributes are called there, but you should get the principle.
1588416891
GiGs
Pro
Sheet Author
API Scripter
I see I have misunderstood slightly. So I think you probably want this query or something like it /roll ?{Ability Selection| Fortitude,1d@{mod-Strength}!! + 1d@{mod-Willpower}!!| Reflex,1d@{mod-Dexterity}!! + 1d@{mod-Willpower}!!| Will,1d@{mod-Willpower}!! + 1d@{mod-Willpower}!!} Just replace with the correct attributes.
Thank you GiGs, that second post is exactly what I wanted. I was trying to put the word Selected in there as I thought it must be necessary.
1588477329
GiGs
Pro
Sheet Author
API Scripter
Selected will be necessary if you want to use it as a macro and not an ability. Thats an easy change though: /roll ?{Ability Selection| Fortitude,1d@{selected|mod-Strength}!! + 1d@{selected|mod-Willpower}!!| Reflex,1d@{selected|mod-Dexterity}!! + 1d@{selected|mod-Willpower}!!| Will,1d@{selected|mod-Willpower}!! + 1d@{selected|mod-Willpower}!!}