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 .
Pre-order D&D 2024 now and get an exclusive bonus, only on Roll20!
Create a free account

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

David M.
API Scripter
@Miles, this sounds like a Jumpgate-specific problem. The caster token and the AoE paths have "toBack" / "toFront" commands sent to them by the script. Jumpgate still has lots of issues with mod scripts - it sounds like it's not respecting those z-order commands when initiated by a script. Not sure what I can do at this point.

Edited 1717920369
Hi , I have been trying various things with SmartAoE, which I love and Will's 5e Shove (the move token bit) but can't get the move and the AoE to be simultaneous.  I get why, just saying that's what I've had luck with.  Is there a way to use --conditionFail| to move tokens that fail their save (I'm thinking Thnuderwave here) in the same way Will's Shove works (ie relative to token casting the spell)? 
David M.
API Scripter
Unfortunately, SmartAoE cannot do this natively in its current state.  I'm assuming Will's 5e shove is using Scriptcards? Even trying to combine the SC shove code with the SmartAoE trigger would be problematic because the two scripts can't communicate with each other, plus they would run asynchronously (so things like checking status markers applied by one script likely wouldn't be timed correctly).  I would maybe try just using SmartAoE as a graphical cue for the Thunderwave placement, then running a SC macro that uses the SmartAoE control token as the selected token, having SC do all the heavy lifting for saves and conditional token movement. Pretty sure I've seen SC thunderwave macros out there somewhere (forums or wiki, can't remember), but some Google-fu might reveal something.

Edited 1718111020
Thanks David, that's very helpful.  Yes, Will's is a Scriptcard.  Knowing what I can't achieve is more than half the battle.  I wrote my own thunderwave and then found Kurt's yours (for SmartAoE), which is much more succinct (I had a lot of waffle in mine from other stuff that was unnecessary), but the learning was worth it : ) I've messed about with this but ultimately the aim was to do this with minimum clicks and it is becoming protracted - I'll just drag those tokens around ; ))))
Hello! I'm having a very strange issue with smartAoE that I've either never encountered or never noticed before. My measurements with line aoetypes are all janky. When it's aiming down (or right) it's one less tile than when it's aiming up (or left). All the diagonal lengths are the same (although, they are shorter than they should be with 5e grid measurements). It also seems like the origin isn't being set correctly when the token is larger than 1 grid square. I've tried using the macro with different tokens, on different pages, even in a different (brand new test) campaign and the issue persists. The only other API I'm using is tokenmod. Any ideas on how to fix this? Side note: Has roll20 always ignored the first grid square with it's measurement tool when measuring from the center? I could have sworn that didn't used to be the case and I don't like it.  !smartaoe {{   --title|Wyvernfire   --leftsub|Reimund   --rightsub|DC [[8+@{Reimund|strength_mod}+@{Reimund|pb}]] DEX   --titlecardbackground|linear-gradient(#2B2130,#2B2130)   --titlefontface|Arial Black   --titlefontsize|1.4em   --tablebgcolor|black   --tableshadow|0px   --hideNames|1   --evenrowbackground|black   --oddrowbackground|#1e1e1e   --evenrowfontcolor|white   --oddrowfontcolor|white   --subtitlefontcolor|white   --aoeColor|#ff999950   --isDrawing|0   --tableborderradius|20px   --aoeType|line   --origin|nearest,face   --radius|30ft   --forceIntersection|0   --minGridArea|0.25   --minTokArea|0.25   --fx|beam-fire   --dc|[[8+@{Reimund|strength_mod}+@{Reimund|pb}]]   --saveFormula|5eDEX   --damageFormula1|[[3d6]]   --damageType1|Fire   --instant|1   --ignore|SmartAoE_Ignore,1    --autoApply|1   --bar|1   --zeroHPmarker|dead }}
Hi David, hoping you can point me in the right direction.&nbsp; I have decided not to bother moving via scriptcards for Thunderwave and will just click n drag, but I wanted to automate things&nbsp; a bit more by deducting spell slot.&nbsp; Took your Thunderwave SmartAoE and stuffed it into a SC.&nbsp; Works perfectly in the sandpit but when I add it to the current game it starts the process (rolls damage, subtracts spell slot) but then Smart AoE puts a chat message of "SmartAoE:You must either select a token or pass the tokenID via --selected|ID".&nbsp; I don't get why the same character transmogrified across gets a different result based on which game it is in?&nbsp; Your SmartAoE works in both.&nbsp; This is what I have: !script {{ +++dnd5elib+++ --#hideCard| --=Level|?{Cast at what level?|1,1|2,2|3,3|4,4|5,5|6,6|7,7|8,8|9,9} --=dice|[$Level]+1 --=damage|[$dice]d8 --+DMG|[$damage] --&gt;Lib5E_DeductSpellSlot|@{selected|character_id};[$Level] &nbsp; --@smartaoe| &nbsp; _title|Thunderwave &nbsp; _leftsub|Cast at Level[$Level] &nbsp; _rightsub|DC @{selected|spell_save_dc} CON &nbsp; _titlecardbackground|url('<a href="');background-size" rel="nofollow">');background-size</a>: 100% 100%; background-repeat: no-repeat &nbsp; _subtitlefontcolor|#ffffff &nbsp; _aoeColor|#88888850 &nbsp; _aoeOutlineColor|#ffffff &nbsp; _aoeType|square, float &nbsp; _forceIntersection|0 &nbsp; _offset|1,0 &nbsp; _radius|7.5ft &nbsp; _fx|burn-smoke &nbsp; _dc|@{selected|spell_save_dc} &nbsp; _saveFormula|5eCON &nbsp; _damageFormula1|[$damage] &nbsp; _damageType1|Thunder &nbsp; _instant|1 &nbsp; _ignore|SmartAoE_Ignore,1 &nbsp; _autoApply|1 &nbsp; _bar|1 &nbsp; _zeroHPmarker|dead &nbsp; _desc|A wave of thunderous force sweeps out from you. Each creature in a 15-foot cube originating from you must make a Constitution saving throw. On a failed save, a creature takes [$damage] thunder damage and is pushed 10 feet away from you. On a successful save, the creature takes half as much damage and isn't pushed.%br%In addition, unsecured objects that are completely within the area of effect are automatically pushed 10 feet away from you by the spell's effect, and the spell emits a thunderous boom audible out to 300 feet. }}
So, I realised I didn't have Select Manager installed on the problem game, rectified that and also added libTokenMarkers as instructed.&nbsp; Now I get "SmartAoE: When SmartAoE is called by another script, it must pass both the selected token ID and the playerID"
Belay the last, it had to be something about setup and then I actually slowed down to read what was in front of me... +playerID, I just needed to configure Select Manager .&nbsp; Away we go rejoicing
David M.
API Scripter
SwagVozhd said: I'm having a very strange issue with smartAoE that I've either never encountered or never noticed before.&nbsp; &lt;snip&gt; @SwagVozhd : Sorry I'm just now addressing this. I was on a cruise ship all week! :) Currently, the line aoeType only uses Euclidean distance calculations, so a 30ft line follows a 30ft radius, which explains why your diagonals are "shorter".&nbsp; I should try to add an option to make it follow 5e measurement rules.&nbsp; Line AoE's are handled differently that all other types (using a Bresenham line algorithm). It's been a couple years since I last looked at this part of the code. I'll have to refresh my memory on how the heck I got it to work in the first place, lol.&nbsp; For now, one option would be to remove the --radius keyword and manually place the control token in a square an appropriate distance away, though that will require counting. @Simon: &nbsp;glad you got it working. Another option is to just use the&nbsp; --resource keyword in your SmartAoE macro to automatically deduct the spell slot. You can find information on how that works in the wiki , but here is a screenshot.

Edited 1718995314
Hi Dave, hope you had a good time!&nbsp; I keep trying to play with code as I love the exercise, but don't actually have the spare time really, so tend to rush in and make things more complicated.&nbsp; I really do need to slow down and read things twice as those of you who know what you're doing have probably already been there and worn out the Tee shirt.&nbsp; This is a much neater solution, thank you
Hi Dave, no worries! Hope you had fun on your cruise (jealous)!&nbsp; That makes sense in regards to the diagonals being shorter. Would that also be why the lines up and left are longer than the lines down and right, or would that be some other complicated reason entirely?&nbsp; Either way, I'll just deal with it for now and manually measure *gasp*&nbsp; Thanks! :)
Hi quick question, Is there a way to respond to smart AOE events usinf a custom api module? I have my own script to apply damage and conditions but want to do so based on the tokens targeted by smart aoe. Thanks!
David M.
API Scripter
Yes! SmartAoE has a public-facing function to handle this very thing. There is a section in the wiki &nbsp;that describes how to go about this in your script. I stole this approach (and function name) from Token-mod, so while your at it I would register that script to yours as well. Same method, just add another code block and replace the text "SmartAoE" with "TokenMod".