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

[Script] SmartAoE - graphical interface for implementing AoE's on gridded maps

Sure.&nbsp; &nbsp;Here is the macro, for the record, but I'll PM you the details of where to find it in my game in case nothing is obviously wrong with this: //**************************************************************************************************************************** //&nbsp; 5e moonbeam //&nbsp; &nbsp; &nbsp; Author: Marcus POrter //&nbsp; &nbsp; &nbsp; Prereq's: SmartAoE script //&nbsp; &nbsp; &nbsp; Notes: //**************************************************************************************************************************** !smartaoe {{ &nbsp; --title|Moonbeam &nbsp; --leftsub|Slot level ?{Cast at what level?|2,2|3,3|4,4|5,5|6,6|7,7|8,8|9,9} &nbsp; --rightsub|DC @{selected|spell_save_dc} CON &nbsp; --subtitlefontcolor|#ffffff &nbsp; --titlecardbackground|url('<a href="https://s3.amazonaws.com/files.d20.io/images/260967166/J47UNgFC34MYULgv85lBZw/max.png?1639948151');background-size" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/260967166/J47UNgFC34MYULgv85lBZw/max.png?1639948151');background-size</a>: contain; &nbsp; --aoeColor|#20872850 &nbsp; --aoeOutlineColor|#208728 &nbsp; --aoeType|circle, float &nbsp; --radius|5ft &nbsp; --forceIntersection|1 &nbsp; --minGridArea|0.25 &nbsp; --minTokArea|0.25 &nbsp; --fx|burn-smoke &nbsp; --dc|@{selected|spell_save_dc} &nbsp; --saveFormula|5eCON &nbsp; --damageFormula1|[[?{Cast at what level?}d10]] &nbsp; --damageType1|Radient &nbsp; --damageSaveRule|*0.5 &nbsp; --ignore|SmartAoE_Ignore,1&nbsp; &nbsp; --controlTokName|GenericSpellAoE &nbsp; --whisperResults|yes &nbsp; --turnorder|Moonbeam,10,-1,true &nbsp; --triggerSound|moonbeam &nbsp; --controlTokSide|2 &nbsp; --controlTokSize|2 &nbsp; --autoApply|1 &nbsp; --bar|1 &nbsp; --zeroHPmarker|dead &nbsp; --desc|A silvery beam of pale light shines down in a 5-foot-radius, 40-foot-high cylinder centered on a point within range. Until the spell ends, dim light fills the cylinder. When a creature enters the spell’s area for the first time on a turn or starts its turn there, it is engulfed in ghostly flames that cause searing pain, and it must make a Constitution saving throw. It takes 2d10 radiant damage on a failed save, or half as much damage on a successful one. A shapechanger makes its saving throw with disadvantage. If it fails, it also instantly reverts to its original form and can’t assume a different form until it leaves the spell’s light. On each of your turns after you cast this spell, you can use an action to move the beam up to 60 feet in any direction. At Higher Levels: When you cast this spell using a spell slot of 3rd level or higher, the damage increases by 1d10 for each slot level above 2nd. }}
1666636732
David M.
Pro
API Scripter
Yep, that one works as expected for me. Tooltip contains the individual die rolls and the rolls are different each time triggered. One note: the macro comments/notes at the top should be removed, as there is the potential for that to cause issues. Those are in the github examples to just explain certain differences between the different macro examples. It's mentioned in the read_me, but easy to miss :) However, in this particular case I tried with and without the comments and seemed to work fine both ways. I'll check out your PM in a bit.
1666641380
David M.
Pro
API Scripter
Ack! In troubleshooting mkanoap's (unrelated) issue above I noticed a bug I accidentally introduced in the last version relating to map alignment. Version Update v0.28 - found&nbsp; here &nbsp;(Note Manual install required for this development version) Bug fix for map/grid alignment with certain AoE types
I am having a problem with the line AOE type.&nbsp; It always makes the line 5 feet more than I specify. Here is my command for a 10foot line.&nbsp; Am I doing something wrong? !smartaoe {{ &nbsp; --title|AoE &nbsp; &nbsp; --titlecardbackground|linear-gradient(blue, cyan) &nbsp;&nbsp; &nbsp; --oddrowbackground|#00ccff &nbsp; --evenrowbackground|#edfcfc &nbsp; --oddrowfontcolor|#000000 &nbsp; --tablebgcolor|#edfcfc &nbsp;&nbsp; &nbsp; --controlTokName|AoEControlToken &nbsp; --controlTokSize|1 &nbsp;&nbsp; &nbsp; --aoeColor|#00ccff50 &nbsp; --aoeOutlineColor|#0099ff &nbsp; --aoeType|line &nbsp; --radius|10ft &nbsp; --width|2ft &nbsp; --minGridArea|0.25 &nbsp; --minTokArea|0.25 }} Here is what it draws
Oh one more.&nbsp; Whenever I try to do a 5econe of larger than 25 feet, it does not draw the cone at all.
1667333059
David M.
Pro
API Scripter
Darryn, I can't reproduce your line results in my test game. It is showing as 10ft from the source token. I don't suppose the map scale is set to less than 5ft per square on your map? Re: your cone issue, does this happen to be on a very small map? If so, it might be related to this quirk . 25ft is pretty small, though, so I'm not super confident in that being the problem. Can you post your entire cone macro?
I just updated to 2.8 (I was still using the version in the one click install) and cones seem ok now, but I am still seeing the issue with the line.&nbsp; My grid is set to 5' per square.&nbsp; I tried it on a different game and could not replicate it...&nbsp; Odd.&nbsp; If I can figure out a better way to replicate I'll come back :)&nbsp; Thanks David.
1667474974
David M.
Pro
API Scripter
Low probability, but you could try clearing the SmartAoE State object info in case something is corrupted there. !smartclearcache Note: this will have the side effect of "unlinking" any existing AoE control tokens&nbsp; in your game&nbsp; with their respective AoE outlines and highlighted grid squares. Be sure to delete these control tokens before running that command, unless you enjoy manually deleting a lot of drawing objects :) PS, a couple random comments about your macro: the --width command is only valid for the "wall" AoE type. Line is the simplest type and is always going to be 1 square. Also, the&nbsp; controlTokName/ controlTokSize commands are only necessary if you want to use something other than the default control token. Neither of these will hurt your macro, though, they are just extraneous lines given your current implementation.
Hi David - testing your version 0.28 and getting an error when trying to access a rollable token:&nbsp;&nbsp; Unhandled exception: Cannot read property 'substring' of undefined In simplest terms, this works:&nbsp; !smartaoe {{ &nbsp; --title|CausticBrew &nbsp; --controlTokName|AoEControlToken &nbsp; --aoeColor|#beedc5 &nbsp; --aoeOutlineColor|#16f036 &nbsp; --aoeType|line &nbsp; --forceIntersection|0 &nbsp; --offset|1,0 &nbsp; --fx|beam-acid &nbsp; &nbsp;--instant|1 &nbsp; --ignore|SmartAoE_Ignore,1&nbsp; &nbsp; --autoApply|1 &nbsp; --bar|1 }} but adding in the --controlTokSide|1 command causes the error.&nbsp; Any suggestions?
1667763948
David M.
Pro
API Scripter
@ShamanGreeny, the default token for the "AoeControlToken" sheet that is created on install is not a multi-sided token, so specifying a side is not valid.&nbsp; Did you modify the default token for that character sheet so that it now has multiple sides? To test, drag a copy of the token out from your journal and see if you can manually change sides. If not, then the default token was not updated.&nbsp; I tend to keep the auto-created token/sheet untouched and if I want a custom token I make a new sheet and explicitly set the controlTokName &amp; controlTokSide appropriately.
hi David trying to add a tooltip I get (From SmartAoE): &nbsp;Unexpected argument identifier (tooltip). i copied it from the script page so nothing strange with it (yet) I'm&nbsp;on 0.25 thanks Andrea
1667863067
David M.
Pro
API Scripter
Andrea, --tooltip requires v0.26 or later. You can get the latest version (28) here !
David M. said: @ShamanGreeny, the default token for the "AoeControlToken" sheet that is created on install is not a multi-sided token, so specifying a side is not valid.&nbsp; Did you modify the default token for that character sheet so that it now has multiple sides? To test, drag a copy of the token out from your journal and see if you can manually change sides. If not, then the default token was not updated.&nbsp; I tend to keep the auto-created token/sheet untouched and if I want a custom token I make a new sheet and explicitly set the controlTokName &amp; controlTokSide appropriately. Creating a new token/sheet solved the issue.&nbsp; Although I did set the default token to multi-sided, there must be some other dependency on the "AoeControlToken" that was causing the problem.&nbsp; All set here!
I am currently attempting to make macros for my game that would require me to be very flexible with what can be able to produce various actions across a great number of creatures, I am having an issue of no result happening. I need to have the ability of being able to choose Size, DC, Save Formula, Damage Formula, Damage Type, the ability to ignore creatures with the FCharacter, 1 tag that my players have as they wish to be able to roll interdependently, if a success results in half or no damage and if the area of effect is lingering or not, we are playing 5e for the system. As for additional reference as per why I am seeking a solution is that I have players with access to summons and would like for this to be a solution. I also have similar for other AOE sizes that I would also like to also have the same, but I will post what I have for the AOE Cone !smartaoe {{ &nbsp; --title|Large Cone AOE &nbsp;&nbsp; --oddrowbackground|#710193 &nbsp;&nbsp; --evenrowbackground|#F9F6EE &nbsp;&nbsp; --subtitlefontcolor|#F9F6EE &nbsp; --aoeColor|#FFFFFF00 &nbsp; --aoeOutlineColor|#800000 &nbsp; --gridColor|#4A0404 &nbsp;&nbsp;&nbsp; --aoeType|cone, 60 &nbsp; --forceIntersection|0 &nbsp; --radius|[[?{How Many Feet}]]ft. &nbsp; --origin|nearest, face &nbsp; --minGridArea|0.1 &nbsp; --minTokArea|0.1 &nbsp; --dc|[[?{What the DC}]] &nbsp; --saveFormula|?{Save Type?|STR, 5eSTR|DEX, 5eDEX|CON, 5eCON|INT, 5eINT|WIS, 5eWIS|CHA, 5eCHA} &nbsp; --damageFormula1|[[?{How Much Damage}d1]] &nbsp; --damageType1|?{Damage Type?|acid, acid| bludgeoning, bludgeoning| cold, cold| fire, fire| force, force| lightning, lightning| necrotic, necrotic| piercing, piercing| poison, poison| psychic, psychic| radiant, radiant| slashing, slashing| thunder, thunder} --ignore|FCharacter, 1 &nbsp; --damagesaverule|[[?{Save Rule?|Half, *0.5|None, *0}]] &nbsp; --instant|[[?{Lingering?|No, 1|Yes, 0}]] &nbsp; --ignore|SmartAoE_Ignore,1 &nbsp; --autoApply|1 &nbsp; --bar|1 &nbsp; --zeroHPmarker|dead &nbsp; --desc| }}
1668555258

Edited 1668555272
David M.
Pro
API Scripter
Looks like your damageSaveRule is problematic. Your query returns a non-numeric result which can't be processed by the Roll20 roll parser. Not sure why this doesn't produce one of those orange box Roll20 errors, but WYGD? Try replacing with this line (removed the inline roll brackets) &nbsp; --damagesaverule|?{Save Rule?|Half, *0.5|None, *0} &nbsp;
David M. said: Looks like your damageSaveRule is problematic. Your query returns a non-numeric result which can't be processed by the Roll20 roll parser. Not sure why this doesn't produce one of those orange box Roll20 errors, but WYGD? Try replacing with this line (removed the inline roll brackets) &nbsp; --damagesaverule|?{Save Rule?|Half, *0.5|None, *0} &nbsp; My god, thank you, apologies for not seeing the issue, but thank you for the help
1668716855

Edited 1668718442
Hello, I am not entirely sure where to post this question but I cannot seem to find the answer anywhere online. I have a healing spell that works perfectly when I do everything excluding using the --triggerSound command. When I try to link a sound effect, I keep getting " Unexpected argument identifier (triggersound). " in the chat and then the rest of the Spell doesn't work. If I take the command out again. It works just fine.&nbsp; It has had me very confused. !smartaoe {{ &nbsp; --title|Cure Wounds &nbsp; --leftsub|Slot level ?{Cast at what level?|1,1|2,2|3,3|4,4|5,5|6,6|7,7|8,8|9,9} &nbsp; --rightsub|No Save &nbsp; --titlecardbackground|url(' <a href="https://s3.amazonaws.com/files.d20.io/images/253287692/0dpMLj12wwv9cRy5RRw6LA/max.png?1635706258');background-size" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/253287692/0dpMLj12wwv9cRy5RRw6LA/max.png?1635706258');background-size</a> : 100% 100%; background-repeat: no-repeat &nbsp; --oddrowbackground|#ffffaa &nbsp; --evenrowbackground|#ffffff &nbsp; --oddrowfontcolor|#000000 &nbsp; --tablebgcolor|#ffffff &nbsp; --aoeColor|#ffff0050 &nbsp; --aoeOutlineColor|#cccc00 &nbsp; --gridColor|#ffffff00 &nbsp; --controlTokName|AoEControlToken &nbsp; --aoeType|line &nbsp; --radius|4ft &nbsp; --forceIntersection|0 &nbsp; --minGridArea|0.5 &nbsp; --minTokArea|0.25 &nbsp; --fx|glow-holy &nbsp; --noSave|1 &nbsp; --damageFormula1|[[0 + 0 - @{selected|wisdom_mod} [WIS] + [[0 - ?{Cast at what level?}]]d8]] &nbsp; --damageType1|(Healing) &nbsp; --triggerSound|Heal minor wounds &nbsp; --instant|1 &nbsp; --autoApply|1 &nbsp;&nbsp; &nbsp; --desc|A creature you touch regains a number of hit points equal to 1d8 + your spellcasting ability modifier. This spell has no effect on undead or constructs. }}
1668773860

Edited 1668773895
David M.
Pro
API Scripter
Erik, the version on one-click is behind. The following commands currently require a manually updated version, which can be found here : &nbsp; --whisperAll|&lt;true/yes/1/false/no/0&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // whispers all output &nbsp; --whisperResults|&lt;true/yes/1/false/no/0&gt;&nbsp; &nbsp; &nbsp; &nbsp; // whispers only the saving throw lines and damage messages to GM &nbsp; --spawnSound|&lt;trackName&gt;&nbsp; &nbsp; &nbsp; &nbsp;//track that plays when controlTok is spawned &nbsp; --moveSound|&lt;trackName&gt;&nbsp; &nbsp; &nbsp; &nbsp; //track that plays when controlTok is moved &nbsp; --triggerSound|&lt;trackName&gt;&nbsp; &nbsp; &nbsp;//track that plays when controlTok is triggered &nbsp; --deleteSound|&lt;trackName&gt;&nbsp; &nbsp; &nbsp; //track that plays when controlTok is deleted &nbsp; --turnOrder|&lt;name&gt;,&lt;optional value&gt;,&lt;optional formula&gt;,&lt;optional true/yes/1/false/no/0&gt;&nbsp;&nbsp;&nbsp;&nbsp;//adds turn to turnorder &nbsp; --tooltip|&lt;text&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//adds a tooltip to the control token I hope to get one-click up to date with this Tuesday's push
David M. said: Erik, the version on one-click is behind. The following commands currently require a manually updated version, which can be found here : &nbsp; --whisperAll|&lt;true/yes/1/false/no/0&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // whispers all output &nbsp; --whisperResults|&lt;true/yes/1/false/no/0&gt;&nbsp; &nbsp; &nbsp; &nbsp; // whispers only the saving throw lines and damage messages to GM &nbsp; --spawnSound|&lt;trackName&gt;&nbsp; &nbsp; &nbsp; &nbsp;//track that plays when controlTok is spawned &nbsp; --moveSound|&lt;trackName&gt;&nbsp; &nbsp; &nbsp; &nbsp; //track that plays when controlTok is moved &nbsp; --triggerSound|&lt;trackName&gt;&nbsp; &nbsp; &nbsp;//track that plays when controlTok is triggered &nbsp; --deleteSound|&lt;trackName&gt;&nbsp; &nbsp; &nbsp; //track that plays when controlTok is deleted &nbsp; --turnOrder|&lt;name&gt;,&lt;optional value&gt;,&lt;optional formula&gt;,&lt;optional true/yes/1/false/no/0&gt;&nbsp;&nbsp;&nbsp;&nbsp;//adds turn to turnorder &nbsp; --tooltip|&lt;text&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//adds a tooltip to the control token I hope to get one-click up to date with this Tuesday's push Thank You so much! I have it working now!!
Is there a repository for pathfinder spells? the 5e ones don't work with the pf sheets
1670011689
David M.
Pro
API Scripter
Not that I am aware of (I don't play PF). But, I imagine they should be pretty easy to convert. The trickiest bit is probably going to be the saving throw formulas. I've included a shorthand for 5e saves (e.g. "5eDEX") but other systems will need to write out the formulas with a modified inline roll format. See here for a description of the --saveFormula command, but basically it is just like a regular inline roll formula with a few replacements. You replace square brackets "[[" and "]]" with "&lt;&lt;" and "&gt;&gt;", and replace attribute references "@{ ... }" with "a{ ... }" For example, [[1d20 + @{somePFattribute}]] would become &lt;&lt;1d20 + a{somePFattribute}&gt;&gt; This prevents the inline roll from resolving before being sent to the smartAoE script (the normal Roll20 order of operations ), and the script will apply that formula to each target separately. The next important conversion step will likely be the --aoeType. See the wiki for more info on PF versions of cones and circles.&nbsp;
1670049207

Edited 1670049321
Got a strange error from my game last night. It was from only one track but I'm not using sounds with this script. I'm using the one-click version. SmartAoE: &nbsp;Error: Jukebox track undefined not found in game
1670071115
David M.
Pro
API Scripter
Doug, can you post your macro? Is it only that one macro that causes the error? Is it repeatable after deleting the control token and reinitiating it?&nbsp;
According to the chat archive, the only macro that was used prior to the error messages was one of the AoEGenerator macros. I'm not sure which one. But I don't believe any control token was on the map at the time. I haven't been able to repeat it, even with the same Jukebox track. Weird.
1670532669

Edited 1670532704
DrDubz
Marketplace Creator
Hey so I have a question that I feel has an easy answer but I would love to know anyway. Is there a way to get the smart AoE triggers to activate a separate macro? I'm playing Lancer and I wanna try and keep a consistent visual style, and also the rolls in that game are kinda f-d up enough that there isn't a way to streamline it completely.
1670542043
David M.
Pro
API Scripter
Unless I'm misunderstanding your question , I think the answer is: probably not. There wouldn't be a way for your Lancer macro to "talk to" the SmartAoE script. If you want to be able to use the automatic "group check" style feature of SmartAoE, then the saves would have to be conformable to an inline roll that is consistent for all targets. I don't know how Lancer works, but if each target uses a different set of attributes or something then that is going to be problematic and you would likely just be limited to using SmartAoE for targeting visualization. If that's not what you're asking about, let me know with some additional information and we can see if we can get something to work for you.
1670550784
DrDubz
Marketplace Creator
David M. said: Unless I'm misunderstanding your question , I think the answer is: probably not. There wouldn't be a way for your Lancer macro to "talk to" the SmartAoE script. If you want to be able to use the automatic "group check" style feature of SmartAoE, then the saves would have to be conformable to an inline roll that is consistent for all targets. I don't know how Lancer works, but if each target uses a different set of attributes or something then that is going to be problematic and you would likely just be limited to using SmartAoE for targeting visualization. If that's not what you're asking about, let me know with some additional information and we can see if we can get something to work for you. Yeah it's not so much the lancer macro talking to the AoE script but more activating a totally separate macro from the trigger effect like a #macro command, so the trigger would activate a generic macro or one of the selected or named token's ability macros. I've given it a fiddle already, but I don't know if I'm missing something, or that it's just not possible and I would like to know if that's the case before I bash my head against it more. The answer seems like a no, and I'm honestly fine with just using it as a visualization tool, but if I can streamline it to the point where I can call a bunch of mech's macros all at once that'd be neat. Roll20 has not been nice to Lancer. It's crit system is so alien to R20 that I have to make macros with separate buttons for hit and crits (crit on an overall score of 20+ including modifiers, not a natural 20 or whatever) so any streamlining on top of what I already have is good to discover.
1670583235
David M.
Pro
API Scripter
Ah, ok. In that case, you should be able to just add the macro call to a smarttrigger macro as a separate line as described here . I'm not sure what happens if the nested macro requires a selected target. There may be some shenanigans there but you'd just have to try it. So, if you had a collections macro named "Macro1", your new composite macro text would simply be: !smarttrigger #Macro1
1670598060
DrDubz
Marketplace Creator
oh dang that's pretty interesting! Thanks, though unfortunately smart trigger doesn't repeat the macro for every character within the AoE. I think it's safe to say it's not fully possible, which is cool regardless, this has already done wonders for streamlining.
Hello David,&nbsp; With the new Turn Order function, is there a way to condition this such as conditionfail does with markers ?&nbsp; My idea would be to populate a (say) "blinded" custom entry only if any of the target failed his dc. something like turnorderFail parameter that would be populated with name duration etc... Thx
Hey there, I'm finally getting around to aoe effects for our games. I've slogged through this thread (learning along the way!) and searched but did not see anything regarding my question. Is there a way to select affected creatures in the aoe at random (ie. 2d8 creatures are affected)? Can this also be by position relative to the caster and/or point of origin? (e.g. 1e confusion or slow spells.) I believe you can select/ignore by sheet values (hit dice, creature type, attributes, etc.). Correct? If there was API interaction with ScriptCards (and perhaps there is!), that would work too: Use all the SmartAOE goodness for visual positioning/targeting, then run ScriptCards for logic against the tokens; then end with effects. I get that (with work!) SC might be able to do these things but thought perhaps the two together could save some effort. Thanks much for any insight! ~D
1670786755
David M.
Pro
API Scripter
Good recommendation, Lionel. Something I can look into. David, Scriptcards would certainly be the way to go for this type of mechanic. Look into Kurt's Fireball example on his github repo for some ideas on how to start implementing that. However, one possible pitfall with using SmartAoE for visualization but Scriptcards for targeting is the potential for targeting discrepancies due to how "affected" squares are calculated in SmartAoE. The two scripts can't really talk to each other, so there could be the occasional token that slips through. &nbsp;
1670795964

Edited 1670796023
OK - so there's no way to pass all token ids in an aoe discovered by smartaoe to scriptcards, even using another meta api? The facility you have for visual placement is really nice so it seems a shame not to be able to use it. Thanks much (whoops replied with my player account it's the "other" DM here!)
1670801414
David M.
Pro
API Scripter
SmartAoE currently doesn't have any external-facing functions that can supply a list of tokens. That function could technically be written, but some other script (meta or otherwise) would have to call it.&nbsp; Maybe timmaugh can chime in to shine some light on meta script possibilities if such a function existed.&nbsp;
1670813940

Edited 1670814020
David M.
Pro
API Scripter
OK, I chatted with timmaugh a bit about this. To do anything close to this would be a pretty heavy lift. I think your best option is going to be either: a) use scriptcards entirely for random token targeting or maybe this kludge-y solution b) Use a Scriptcard that triggers the SmartAoE control token via SelectManager (with a --@forselected|smarttrigger) and outputs the saves for all creatures in the area, but set autoApply to false. The scriptcard would also need to query how many total creatures are in the area (seen within the AoE) and rolls your 2d8 for number of creatures affected, then outputs random non-repeating positions (lines) in the SmartAoE output for the creatures to affect. You'd need to set up a loop that calls a roll function with conditionals to avoid repeat positions. This would best be setup with SmartAoE hidden target names so you will see Target 1, Target 2, etc. for easy matching to the scriptcard rolls. Then, for each target line noted by your scriptcard rolls, you'd click only the green/red P/F boxes for those targets to actually apply the damage/effect.&nbsp;
1670814208
timmaugh
Pro
API Scripter
Yeah... after chatting with David about this, there's just not a good way to meta this one as everything is written, now. The math and the magic happens under the hood of SAoE, so to get the tokens would require SAoE to function as a metascript. Not a huge deal. However. ( this gets down into some js jargon) As currently written, metascripts have to synchronous (to maintain ownership of the order of operations), and SAoE has asynchronous portions. It is on my radar to rewrite the metascript toolbox around an "dispatch, stop, and await" model that would accommodate asynchronous plugins... but that day -- like the day when the age of men will fall -- that day is not this day. =D
when using save formula or dc is there a way to query/ask for input number as the DC number? in pathfinder it changes per spell/caster level and all that, its not consistent like 5e. So is there another way instead of using attributes/ability pulls?
1671019854

Edited 1671019924
David M.
Pro
API Scripter
Kaiyatsu, you should be able to include queries by using a custom formula as described in the --saveFormula entry in the wiki documentation . Note this important detail from the wiki regarding custom save formulas:&nbsp; In order to delay the save rolls until the AOE is triggered, and to apply that formula to each token individually, replace inline roll format in the following way: "[[…]]" is replaced by "&lt;&lt;…&gt;&gt;" "@{…}" is replaced by "a{…}" Generic example with a query: --saveFormula|&lt;&lt;1d20 + a{attrName} + ?{Some Query|val}&gt;&gt; Note that queries are resolved before info is sent to the script, so each target token will use the same query value for the saving throw
Hmm the flame strike isn't working, I've added all the scrips listed. //**************************************************************************************************************************** // 5e Flame Strike // Author: David M. // Prereq's: SmartAoE, Scriptcards, SelectManager scripts // Notes: This will query for the extra damage type regardless of the spell slot level due to macro order of operations, // though it will be ignored for a 5th level slot. // This scriptcard will only add the extra d6/level to ONE of the damage types, as per the spell description //**************************************************************************************************************************** !script {{ --#hidecard|1 --&amp;lbrack|{ --&amp;rbrack|} --&amp;lsqbrack|[ --&amp;rsqbrack|] --&amp;lvl|?{Cast at what level?|5|6|7|8|9} --&amp;addDamType|?{Choose extra damage type|Fire|Radiant} --=additionalDice|[&amp;lvl] - 5 --=baseDice|4 --?[&amp;addDamType] -eq "Fire"|[ --=fireDice|[$baseDice]+[$additionalDice] --=radDice|[$baseDice] --]|[ --=fireDice|[$baseDice] --=radDice|[$baseDice]+[$additionalDice] --]| --&amp;damForm1|[&amp;lsqbrack]^[&amp;lsqbrack][$fireDice.Raw]d6[&amp;rsqbrack]^[&amp;rsqbrack] --&amp;damForm2|[&amp;lsqbrack]^[&amp;lsqbrack][$radDice.Raw]d6[&amp;rsqbrack]^[&amp;rsqbrack] --@forselected(^)|SmartAoE [&amp;lbrack][&amp;lbrack] _title|Flame Strike _leftsub|Slot level [&amp;lvl] _rightsub|DC @{selected|spell_save_dc} DEX _aoeType|circle, float _radius|10ft _minGridArea|0.25 _minTokArea|0.25 _fx|burn-fire _dc|@{selected|spell_save_dc} _saveFormula|5eDEX _damageFormula1|[&amp;damForm1] _damageType1|Fire _damageFormula2|[&amp;damForm2] _damageType2|Radiant _ignore|SmartAoE_Ignore,1 _instant|1 _autoApply|1 _bar|1 _zeroHPmarker|dead [&amp;rbrack][&amp;rbrack]| }}
1671115686
David M.
Pro
API Scripter
Yes, I've noticed a recent frustrating change in behavior when using SelectManager deferral characters ( the "(^)"'s&nbsp; ) within a Scriptcard calling SmartAoE. Still trying to track down a root cause for this, so unfortunately no solution for you at the moment.&nbsp;
David M. said: Yes, I've noticed a recent frustrating change in behavior when using SelectManager deferral characters ( the "(^)"'s&nbsp; ) within a Scriptcard calling SmartAoE. Still trying to track down a root cause for this, so unfortunately no solution for you at the moment.&nbsp; Okay, thanks David, appreciate the update :)
1671118107
timmaugh
Pro
API Scripter
Is there a minimum reproducible case I can try to troubleshoot to see if any of the recent metascript updates impacted that, David? I just tried a simple forselected call and the deferral character works. One thing you could try, Kaiyatsu, is to use a different deferral character. I wonder if you are running into a collision of what you're trying to use as a ScriptCard deferral character and what you're using as a forselected deferral character. I see you using the "^" character elsewhere in your macro, then you're using it in the forselected call... What I think is happening is, in your macro you have ScriptCards sending a forselected call which will, in turn, issue a series of SmartAoE calls. Before SC issues the forselected command, it will remove its deferral characters (exposing syntax structures to the parsers when the new message gets sent through). Then, when SelectManager reads that forselected message and issues the series of SmartAoE calls, it will remove it's deferral character so that syntax structures will be exposed in the SmartAoE message. You can see how it would cause a problem if both SC and SelectManager (forselected) used the same deferral character... the things that shouldn't be detected until the SmartAoE messages are sent out will be detected and parsed out of the way too early. I understand ScriptCards lets you define a SC deferral character, but it might just be quicker to do it in the forselected line. Whatever you use in the parentheses of the forselected handle will be your SelectManager deferral character, so you just have to pick something that isn't in the about-to-be-outbound command line. That would mean changing this: --@forselected(^) ...to something like... --@forselected(+) ...provided there were no "+" characters in what you wanted to send with forselected that needed to remain in the message. That said, I see some things I think might be a problem... but I'll leave it to you and David to tell me whether these things are expected. Regarding this part of your macro: --@forselected(^)|SmartAoE [&amp;lbrack][&amp;lbrack] _title|Flame Strike _leftsub|Slot level [&amp;lvl] _rightsub|DC @{selected|spell_save_dc} DEX _aoeType|circle, float _radius|10ft _minGridArea|0.25 _minTokArea|0.25 _fx|burn-fire _dc|@{selected|spell_save_dc} _saveFormula|5eDEX _damageFormula1|[&amp;damForm1] _damageType1|Fire _damageFormula2|[&amp;damForm2] _damageType2|Radiant _ignore|SmartAoE_Ignore,1 _instant|1 _autoApply|1 _bar|1 _zeroHPmarker|dead [&amp;rbrack][&amp;rbrack]| 1) I see a closing pipe after the double [&amp;rbrack] that bound the SmartAoE portion (the last character in the above snippet). Should that pipe be there? 2) You include a SelectManager deferral character... forselected(^)... but then you never actually use it in the outbound SmartAoE call SelectManager will issue. If you don't need it, you don't have to declare it. The handle for the forselected call can be simply: --@forselected|SmartAoE... ...however... 3) In the above snippet, both of the @{selected|spell_save_dc} structures will get immediately parsed at the time that the ScriptCards message is sent. That's because they will be visible to the parser at that point (instead of deferred until the individual SmartAoE calls are sent via SelectManager). Unless I understand what you have going on, you don't want them parsed at this point. That will give every token the same value for the spell_save_dc. If you want individualized results, you have to hide these calls. However (the venerable Sir However the Second)... You can't use Roll20 standard syntax for selected tokens when you have a script issue a message calling another script, because the Script Moderator is the one issuing the command, not a player, and the Script Moderator doesn't have any tokens selected on the game board. Even deferring the syntax of the call won't help you, because when Roll20 *does* see it (after SelectManager strips off the deferral character), there is no token designated to be "selected" from which to pull the information. This is where you need Fetch to supply the information, and you need to defer the Fetch construction until the SmartAoE messages are being sent. In other words, the Fetch construction for the spell_save_dc attribute would normally be: @(selected.spell_save_dc) Deferring it with a caret would be: @^(selected.spell_save_dc) Deferring it with a plus would be: @+(selected.spell_save_dc) So taking all of these concerns into account, I would wonder if this replacement for the above snippet would work better...? --@forselected(+)|SmartAoE [&amp;lbrack][&amp;lbrack] _title|Flame Strike _leftsub|Slot level [&amp;lvl] _rightsub|DC @+(selected.spell_save_dc) DEX _aoeType|circle, float _radius|10ft _minGridArea|0.25 _minTokArea|0.25 _fx|burn-fire _dc|@+(selected|spell_save_dc) _saveFormula|5eDEX _damageFormula1|[&amp;damForm1] _damageType1|Fire _damageFormula2|[&amp;damForm2] _damageType2|Radiant _ignore|SmartAoE_Ignore,1 _instant|1 _autoApply|1 _bar|1 _zeroHPmarker|dead [&amp;rbrack][&amp;rbrack]
1671118504
David M.
Pro
API Scripter
I'm at work now so can't go too much into this, but wanted to mention that the deferral characters are &nbsp;used in the SmartAoE call. It's just that they are included as string variables in the damageFormula1/2 parameters. These two lines (preceding the SmartAoE bit) build the string: --&amp;damForm1|[&amp;lsqbrack]^[&amp;lsqbrack][$fireDice.Raw]d6[&amp;rsqbrack]^[&amp;rsqbrack] --&amp;damForm2|[&amp;lsqbrack]^[&amp;lsqbrack][$radDice.Raw]d6[&amp;rsqbrack]^[&amp;rsqbrack] Also, that pipe character Tim mentioned after the&nbsp;[&amp;rbrack][&amp;rbrack] part does look like a typo.
1671119122

Edited 1671119146
timmaugh
Pro
API Scripter
Ah, right...&nbsp; I see the substitution where those deferral characters would be ported into the outbound SAoE call. In that case, if the forselected handle was given as: --@forselected(+)| Then the lines David just mentioned would have to have those "^" characters replaced with "+".
1671153331

Edited 1671154113
timmaugh said: Ah, right...&nbsp; I see the substitution where those deferral characters would be ported into the outbound SAoE call. In that case, if the forselected handle was given as: --@forselected(+)| Then the lines David just mentioned would have to have those "^" characters replaced with "+". so replace the "^" with +'s? So far no luck... these are the mods I have currently: GroupCheck, libInline, SmartAoE, ScriptCards, SelectManager, Messenger, Status FX, libTokenMarkers, Fetch, Vector Math, MatrixMath, Path Math, and checklight.js
Hey David,&nbsp; I may have missed this in the documentation, but it is possible to have 2 save formulas for different results? For example, a force blast that does damage with a reflex saving throw for half and a fortitude save that if fails, applies a status marker? Thanks!
1671491282

Edited 1671491320
David M.
Pro
API Scripter
Erik, multiple cascading saves are not supported. If multiple similar tokens are in the AoE, the easiest thing would probably be to look in the chat output for failed&nbsp; Reflex &nbsp; saving throws. Then you can click the token icon &nbsp;in chat for the creatures that failed, which will ping-pull your screen to that particular token so you know who needs to make a subsequent fortitude save (either manually or from another macro).&nbsp;
Awww, but I'm so lazy!&nbsp; Thanks for the reply. :D
Hi hello, I have absolutely no javascript fluency and I'm trying to get SmartAoE to work with Aura/Tint Health Color - just like the end of the SmartAoE wiki page illustrates. I'm sure I'm making some incredibly basic mistake, but can you help me apply: //REGISTER TRIGGERS------------ registerEventHandlers = function () { on('chat:message', handleInput); on("change:token", handleToken); on('add:token', function (t) { _.delay(() =&gt; { let token = getObj('graphic', t.id), prev = JSON.parse(JSON.stringify(token)); handleToken(token, prev, "YES"); }, 400); }); //register this script to SmartAoE to handle linked bar hp changes if('undefined'&nbsp;!== typeof SmartAoE &amp;&amp; SmartAoE.ObserveTokenChange){ SmartAoE.ObserveTokenChange(function(obj,prev){ handleToken(obj, prev, "NO"); }); }; }; to my spell macros? Am I supposed to copy the above and paste into any given spell macro? Where in any given script is the part where 'events' are 'registered'? Super basic stuff. Sorry to be a bother! I just want the booms to make the colors go brr :')
1671597054
David M.
Pro
API Scripter
Dabinski, a clarification: the "script" in this context refers to the actual javascript code that is run when you enter the appropriate command in chat (e.g. !someCommand, often through a macro or ability). Recently, the Devs have moved to using the term "mod" for what used to be called a "script", but the terms are still pretty interchangeable.&nbsp; The part of the SmartAoE wiki you referenced is really for folks who would like to allow their scripts (or mods) and SmartAoE to talk to each other (specifically, to allow for SmartAoE-induced token change events to be recognized by their script).&nbsp; This is not syntax that goes into a macro, but rather a modification to the actual script itself.&nbsp; Ok, with that out of the way, let's get you what actual want: having Aura/Tint respond to SmartAoE-triggered token changes: If you look here , I have modified a version of Aura/Tint that responds to SmartAoE token changes, and also only uses Aura2 (freeing up Aura1 for manual use). To install it, you will need to delete or disable your existing Aura/Tint mod and manually install the version I linked above. Info on how to manually install a script (or "mod") can be found here , but basically you copy all that linked text and paste it into a "New Script" tab of your "mods" page for that game. Once you've done this and saved (which will restart your sandbox), then the two scripts should now talk to each other with no modifications to your macros.&nbsp; If you run into any issues, feel free to PM me and/or invite me to your game and we can get this set up for you :)