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 .
×

Smart AOE - If statements?

1779082570

Edited 1779084437
Tig
Pro
I have made a breath weapon macro for the 2024 dragonborn but currently I had to make 2 macros, one for line one for cone.&nbsp; I'm trying to combine them so player just selects type which works BUT i really want to auto set range based on type rather than make players select type and range, is there a way to auto set the range here based on the type selection?&nbsp; Eventually I'll also want to auto select damage type based on race but i'm having trouble picking that up on the 24 sheet atm. and i only have one type of dragonborn in game so less worried about that ... Any Help appreciated.. !smartaoe {{ &nbsp; --title|Bronze Breath Weapon &nbsp; --rightsub|DC [[floor((@{selected|constitution}-10)/2)+ceil(@{selected|level}/4)+1+8]]&nbsp; DEX &nbsp; --titlecardbackground|url('<a href="https://s3.amazonaws.com/files.d20.io/images/248538196/c9xft1A2jWNqOkBsxQwyLQ/max.jpg?1633278017');background-size" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/248538196/c9xft1A2jWNqOkBsxQwyLQ/max.jpg?1633278017');background-size</a>: contain; &nbsp; --subtitlefontcolor|#ffffff &nbsp; --oddrowbackground|#2c2775 &nbsp; --evenrowbackground|#c0bfd6 &nbsp; --oddrowfontcolor|#ffffff &nbsp; --tablebgcolor|#c0bfd6 &nbsp; --aoeColor|#0044ff50 &nbsp; --aoeType|?{Type?|Cone,cone|Line,line} &nbsp; --radius|30ft &nbsp; --origin|nearest, face &nbsp; --fx|burn-frost &nbsp; --dc|[[floor((@{selected|constitution}-10)/2)+ceil(@{selected|level}/4)+1+8]]&nbsp; DEX &nbsp; --saveFormula|5eDEX &nbsp; --damageFormula1|[[[[floor((@{selected|level}+1)/6)+1]]d10]] &nbsp; --damageType1|Lightning &nbsp; --zeroHpMarker|dead &nbsp; --instant|1 &nbsp; --autoApply|1 &nbsp; --bar|1 &nbsp; --desc|You Breathe a Line of Lightning. }}
1779087281
Andrew R.
Pro
Sheet Author
Look into the MetaScriptToolbox first.
1779216770
timmaugh
Pro
API Scripter
Yep, with the MetascriptToolbox, you get a lot of options. For instance, you can reuse your player's roll query selection: --aoeType|?{Type?|Cone,cone|Line,line} --radius|{&amp;if ?{Type} = cone}10ft{&amp;else}30ft{&amp;end} ...and/or you can enclose whole arguments from SmartAOE within the IF blocks, if the 2 areas needed different parameters (no idea if these are actual SAOE props, just an example): --aoeType|?{Type?|Cone,cone|Line,line} {&amp;if ?{Type} = line} --radius|30ft {&amp;else} --length|10ft {&amp;end} If you can't figure it out from there, post back with more specifics about the differences and we can try to help.