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

Macro Assistance

1475955281

Edited 1475955791
Fyndhal
Plus
Sheet Author
I'm trying to make a macro for a Mutants and Masterminds character and not having a lot of luck. Here's what I need: I have a pool of 8 points. If I have 1 target, all 8 are applied to it, giving them a DC 23 Toughness Save. If I have 2 targets, each has 4 points applied to it, giving them each a DC 19 Toughness Save. If I have 3 targets, the first 2 have 3 points applied to each giving them a DC 18 Toughness Save and the last one has 2 points applied to it, giving it a DC 17 Toughness save. I want to only do 1 prompt and have the DC's calculated off of that. Here's an example of one of my attempts (it didn't work out well.) &{template:default} {{name= Bolt of Lightning}} {{Targets=Number of Targets ?{Number of Targets|1}}} {{Target1=DC[[15+({round(8/?{Number of Targets|1})})]] Toughness, Lightning}} {{Target2=DC[[15+(8-{round(8/?{Number of Targets|1})})]] Toughness, Lightning}} {{Target3=DC[[(?{Number of Targets|1}-2,0)k1+15]] Toughness, Lightning}} Any assistance it appreciated!
1475959196

Edited 1475959541
Silvyre
Forum Champion
The easiest way to do this is via Advanced Usage for Roll Queries , e.g. &{template:default} {{name=Bolt of Lightning}} ?{Number of Targets| 1, {{Target1=DC23 Toughness, Lightning}} | 2, {{Target1=DC19 Toughness, Lightning}} {{Target2=DC19 Toughness, Lightning}} | 3, etc. } Here's an alternative that does not use HTML entities but relies on some other 'advanced tricks': &{template:default} {{name=Bolt of Lightning }} {{Target [[[ 1 + {?{Number of Targets|1|2|3} + d0}>3 * 2 ]]](!) = **DC**[[ 15 + 2 ]] }} {{Target [[[ 1 + {?{Number of Targets} + d0}>2 ]]](!) = **DC**[[ 15 + [[3 + {?{Number of Targets} + d0}<2]] ]] }} {{Target [1](!) = **DC**[[ 15 + [[3 + {?{Number of Targets} + d0}<2 + {?{Number of Targets} + d0}<1 * 4]] ]] }}
1475963504

Edited 1475966642
Fyndhal
Plus
Sheet Author
This is excellent, thank you *very* much! Here's the final macro I'm using: &{template:default} {{name=Bolt of Lightning}} ?{Number of Targets| 1, {{Target1=DC[[23]]}} | 2, {{Target1=DC[[19]]}&#125 {{Target2=DC[[19]]}} | 3, {{Target1=DC[[18]]}&#125 {{Target2=DC[[18]]}&#125 {{Target3=DC[[17]]}} | } {{Effect= Toughness save, Incurable Lightning Damage}}
1475969951
Silvyre
Forum Champion
You're very welcome! Happy rolling!
Silvyre's example of alternative are definitely what you want to use when you start doing multi function and multi command macros. A must when you are requesting selected token stats/mods/ac/saves vs an attack/spell/vs action.
1476117151

Edited 1476117321
Fyndhal
Plus
Sheet Author
William B. said: Silvyre's example of alternative are definitely what you want to use when you start doing multi function and multi command macros. A must when you are requesting selected token stats/mods/ac/saves vs an attack/spell/vs action. The reason I went with the HTML version instead of the alternate is that the alternate has an odd issue with it. Select 1 target, everything is fine. Select 2 targets, everything is fine - It shows target 1, then target 2. If you select 3 targets, though, it reverses the order, displaying Target 3, then target 2 and lastly target 1. Not a big issue, but enough for me to want to use the simpler method.
1476135666

Edited 1476135795
Silvyre
Forum Champion
Fyndhal said: The reason I went with the HTML version instead of the alternate is that the alternate has an odd issue with it. Select 1 target, everything is fine. Select 2 targets, everything is fine - It shows target 1, then target 2. If you select 3 targets, though, it reverses the order, displaying Target 3, then target 2 and lastly target 1. Not a big issue, but enough for me to want to use the simpler method. Here's a variant that does not feature this behaviour: &{template:default} {{name=Bolt of Lightning }} {{Target [1](!) = **DC**[[ 15 + 3 ]] }} {{Target [[[ ceil(?{Number of Targets|1|2|3} / 2) ]]](!) = **DC**[[ 15 + [[4 - floor(?{Number of Targets} / 3)]] ]] }} {{Target [?{Number of Targets}](!) = **DC**[[ 15 + [[floor(8 / ?{Number of Targets})]] ]] }} {{Save=Toughness}} {{Notes=Incurable}}
1476139787
Fyndhal
Plus
Sheet Author
Ah, that's perfect, thank you! 
1476140655

Edited 1476140707
Silvyre
Forum Champion
You're welcome! Enjoy, and happy rolling!
I swear, the mod support on this site is legendary! I still can't believe it sometimes.  Thank you to all the roll20 mod's and frequent forum posters out there !! Silvyre said: You're welcome! Enjoy, and happy rolling!