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

David M. said: 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 :) THANK YOU! The digital dinguses of the world THANK YOU Works great!
Thanks for the replies upthread. I think I understand the process (kludge) except for the part about the P/F boxes. I've been doing some testing where the player can use the AOE control token to be the target for the ScriptCards fireball (redone for 1e) - However, as you suspected, there is not a small difference in how the AOE is calculated. For example, if the AOE radius is 25ft or even 5u, and the scriptcard is set to a distance of 5 units, the difference, especially on diagonals is large (looks like close to two squares). So, while the smartaoe area appears well back, the poor caster get blown up by the scriptcard.  Is there a way to get the two a little closer in terms of measurement? Assuming I'm going to need a 2-stage solution anyway, why try mashing the scripts together, just use SmartAOE for general targeting visualization (ie the center for circles and squares) and have SC target the control token for blast spells and otherwise manually select those in the area to apply other effects. For lines, I'd just go straight SC. 1e is "fog of war" anyway, so exactness is not 100% required, but I'd like to get it fairly close if possible (say, within/under 1 square)! Thanks for your help! ~D
1671741071

Edited 1671741154
David M.
Pro
API Scripter
David: The large diagonal discrepancy is due to that Scriptcards example using the "distance" function, which as described in Kurt's wiki uses 4e/5e -style distances (where diagonals are counted as one square). The relevant line in the Fireball scripcard example is:   --~dist| distance ;@{target|token_id};[&tokenid] This effectively makes Fireballs have a square AoE.  If you want use a circle aoeType in SmartAoE, then you should use the " euclideandistance" or " euclideanlong" functions instead. This should get much closer agreement between the two scripts (though depending on your SmartAoE minGridArea settings, there still might be larger/smaller discrepancies). Regarding the P/F part of the kludge solution: If you set --autoApply|0 in your SmartAoE macro, then damage is not automatically applied to the affected tokens. Instead, you can selectively apply damage to tokens by clicking the "P" or "F" results box in the SmartAoE chat output.  So, since I believe the desire was to only affect a certain number of random creatures in the AoE, you could determine random creature numbers in scriptcards (with scriptcards output), and then only apply the damage (by clicking the "P" or "F" boxes in SmartAoE output) to the creature numbers that matched the scriptcard output. You'd want to use --hideNames|1 in SmartAoE to have it label the creatures in that made saves with an ordinal number instead of their actual name. 
Got it. Thanks! I'll give it a test to see how close I can get the two methods. From Kurt, I'd change it to (roughly equaling 4 squares radius; assuming 70 pixel squares): --~dist|euclideanpixel;@{target|token_id};[&tokenid] --?[$dist] -gt 280|continue So this works for circles. I suppose a cone would be pretty close too and then I'd switch back to square-units for rectangular or square areas. Since you seem to be the expert on measurement given the API, let me know if there are situations to watch out for (ie pixel measurement on square diagonals or the like). Thanks!
1671743382
David M.
Pro
API Scripter
Cool, you'll probably want to test out some things on a map with a ton of targets to see which --minGridArea settings will best match Kurt's euclidean pixel method. You'll need to watch out for using it on future maps with different grid scaling, too. The biggest discrepancy is probably going to be for inclusion of larger tokens near the edge of the AoE. I believe Kurt's distance calculation is from the center of each token, whereas SmartAoE utilizes a minimum percentage of a token's area within an affected grid square (using --minTokArea).  
Is there a way to change the color of the AoEGenerator macros instead of them being red for everyone? For now, I've edited line 4521 with var aoeColor = getObj('player',msg.playerid).get('color').toString(); But I rather not have to mess with the code of another scripter.
1671808881

Edited 1671809034
David M.
Pro
API Scripter
Dan, You don't need to edit any javascript to use different colors. This can be handled at the macro level by adding a --aoeColor|#RRGGBBTT command to your macros, where TT is the opacity level as a percentage. The macros that the AoEGenerator chat menu buttons call are located as abilities in the AoEControlToken character sheet. Just add the aoeColor command into the macros in which you want the color change.    EDIT - example: the 5ft Square ability could be changed to the following to make a bright green aoe fill color with 50% opacity !smartaoe {{   --aoeType|square, float   --aoeColor|#00FF0050   --radius|2.5ft   --fx|burn-fire }}
Thanks David.  Is there a way to make the color match the player color via a parameter in the macro?  ie: aoeColor|playerColor for example.
1671831197
David M.
Pro
API Scripter
Hmm, I don't believe that info is accessible from the macro level. Probably would have to change the script for that. You could  use a query in the macro to ask the user what color to use, possibly picking from a character name and returning their individual hardcoded color.
Maybe something you'll consider in your next version.  Thanks for a great addon!
1671854798

Edited 1671854869
timmaugh
Pro
API Scripter
Fetch can return the color for a player... @(player.Player Name.color) (Or other ways of referencing the player... from the token, for instance. If there is a specific use case, I can run down the options...)
1671856459
David M.
Pro
API Scripter
Ah, neat! Can it be generalized for the selected token?  It's my understanding that Dan would like to have a generic chat menu that creates AoEs of varying sizes/types, but with a fill color equal to the player color. The SmartAoE flag "--aoeColor|#RRGGBBTT" is needed to override the default red fill color, so the Fetch construct would need to return the html code.  I imagine there would be complications if multiple players had control of the token.
This is exactly what I was looking for.  Changing David's earlier script, this does exactly what I was looking for.  Thanks for this bit of info, timmaugh. !smartaoe {{   --aoeType|square, float   --aoeColor|@(player.Player Name.color)   --radius|2.5ft   --fx|burn-fire }}
1671912072
timmaugh
Pro
API Scripter
Great! Obviously you'd have to swap out the "Player Name" part for the player's actual name. (Guessing you knew that since you got it to work, but sharing for others). For working from the selected token, remember that Fetch constructions are nestable, so if the selected token doesn't give you a handle for a player property directly, you can always use the "player" property of the selected token: @(selected.player) ...will return the ID, or: @(selected.player_name) ...will return the name. Both of those get you the FIRST player in the controlledby field, so make sure you have your tokens set up properly. Either one of those can be nested in an @(player...) reference to get the player color: @(player.@(selected.player).color) Using that would make your macro a bit more player agnostic, as you could select the appropriate token and use the same macro for multiple different players.
as an addition, if you do  @(player.@(selected.player).color)50 you will get the usual transparency !!
1672592100

Edited 1672592856
Just a question for you David, and possibly Timmaugh :  I know that you can select a target as the victim of the aoe by using !smartquery. Would there be a way to select multiple targets (within the aoe) to be affected in one !smartquery call ?  Would there be a usage of metascripts to define some targeted tokens (multiple selection for example) and have them be fetched back to launch a smartquery ? And happy new year of course !!!
1672595356
David M.
Pro
API Scripter
A couple of issues with this, Lionel. A fundamental principle of SmartAoE is that the selected token is going to be the AoE control token (whether it's the caster or the effect's origin). So, that brings us to targets, but as you know: to use Roll20 targeting you really need to know the number of targets before you can run a targeting macro efficiently. I suppose I could implement something like in the Spawn script where I send a button to chat which calls another instance of the script trigger with additional info (this info being populated by a query for number of targets), though by that time you're already making several clicks to do what you want. In that amount of time you probably could have triggered on multiple single targets with the current method. So to me it kinda seems like a lot of back-end work without a whole lot of upside in terms of efficiency. 
Ah ok.  I understand.  I was wondering if there could be a query (how many targets) implemented just before the smartquery command (that would then collect all targets asked in the query and treat them accordingly in the save command)... I don't know the insides outs of your great script enough though, so i was kindda imagining solutions that are probably not doable technically. Thank you for your answer anyway.
1672614369
David M.
Pro
API Scripter
It is doable, but I think for 99% of the time it wouldn't result in a meaningful time savings. There would have to be multiple steps: one to query the number of targets and temporarily store that info (probably similar to an information request button in scriptcards chat), then the actual query for the X number of targets, before the script could resolve the effect. Given the extra time needed for the player to read the query, count the number of targets and enter data, added to the time needed to remember and actually move your cursor back and forth between the map and chat windows to complete the task, my guess is that you'd need at least four targets before you broke even in terms of time spent relative to the current one-at-a-time method. I suppose you could make multiple smartquery macros in one scenario  (a Trigger_1_target, Trigger_2_targets, etc.)  to eliminate the "how many targets" macro step, but then you'd be cluttering up your token action bar pretty quickly. So a solution is possible, just not a very efficient and user-friendly one.
ok ok you convinced me.
I feel like I'm doing something wrong here with the damage formula, and I don't think it works properly for higher levels... !smartaoe {{ &nbsp; --title|Flame Strike &nbsp; --titlecardbackground|url('<a href="https://cdna.artstation.com/p/assets/covers/images/040/879/296/large/de-andre-martin-de-andre-martin-firepillarthumbnail.jpg?1630123232');background-size" rel="nofollow">https://cdna.artstation.com/p/assets/covers/images/040/879/296/large/de-andre-martin-de-andre-martin-firepillarthumbnail.jpg?1630123232');background-size</a>: 100% 100%; background-repeat: no-repeat; &nbsp; --leftsub|Slot level ?{Cast at what level?|5,5|6,6|7,7|8,8|9,9} &nbsp; --rightsub|DC @{selected|spell_save_dc} DEX &nbsp; &nbsp; --controlTokName|GenericSpellAoE &nbsp; --controlTokSize|8 &nbsp; --controlTokSide|5 &nbsp; --aoeColor|#99000050 &nbsp; --instant|1 &nbsp; --gridColor|#99000050 &nbsp; --aoeType|circle, float &nbsp; --radius|20ft &nbsp; --forceIntersection|1 &nbsp; --minGridArea|0.25 &nbsp; --minTokArea|0.25 &nbsp; --fx|burn-fire &nbsp; --dc|@{selected|spell_save_dc} &nbsp; --saveFormula|5eDEX &nbsp; --damageFormula1|[[(1+?{Cast at what level?})d6]] &nbsp; --damageType1|Fire &nbsp; --damageFormula2|[[(1+?{Cast at what level?})d6]] &nbsp; --damageType2|Radiant &nbsp; --ignore|SmartAoE_Ignore,1 &nbsp; --autoApply|1 &nbsp; --bar|1 &nbsp; --zeroHPmarker|dead &nbsp; --desc|A vertical column of divine fire roars down from the heavens in a location you specify. Each creature in a 10-foot-radius, 40-foot-high cylinder centered on a point within range must make a Dexterity saving throw. A creature takes 4d6 fire damage and 4d6 radiant damage on a failed save, or half as much damage on a successful one. &nbsp;&nbsp;&nbsp; At Higher Levels: When you cast this spell using a spell slot of 6th level or higher, the fire damage or the radiant damage (your choice) increases by 1d6 for each slot level above 5th. }}
Wanted to add my praise and appreciation for the script to the other voices.&nbsp; I'm in the process of overhauling all my casters and have run into a stumble on Wall of Flame as a ring.&nbsp; I saw mention earlier that a doughnut shape was in the works.&nbsp; Is that still underway?&nbsp; Also any great minds out there can help on a single macro for both types of the spell.&nbsp; I was working on a query for Wall vs Ring and then reusing that result to define radius and width but seeming like I'll need multiple queries for each attribute since they use differing values that don't seem mathematically related.&nbsp; Think I'm building 2 macros unless someone else has already solved this.
1674948923
David M.
Pro
API Scripter
I ran into an issue with the ring solution a while back and haven't revisited it. Still something I'd like to do, but I don't have a timeline right now as I'm mostly working on other projects at the moment,
EDIT: posting here instead of new topic Hi DavidM, Starting up a new game and have been using transmog for sheets, tokens etc and resetting all my mods that I like to use and have found that the Trigger-Target macro doesn't appear to be doing anything - at least not for the Aura of Vitality example taken from the wiki page.&nbsp; Note: The macro I copied from my old for Aura Of Vitality didn't work for the negative damage, I haven't tried the one on the wiki, but I resolved it with &nbsp; [[1d0-2d6]] Spells such as Spirit Guardians or Aura Of Vitality don't effect every token within the AoE all the time, so I need to use the Target method. I'm using this which is set as a Token Action for all players !smartquery @{target|Choose a Target|token_id} When I use the macro, it asks me to target a token. When I do, nothing happens except the prompt disappears. No roll occurs in the chat, nor any bars being altered. For reference, here is the Aura of Vitality macro !smartaoe {{ --title|Aura of Vitality --leftsub|Slot level 3 --rightsub|No Save --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 --oddrowbackground|#ffffaa --evenrowbackground|#ffffff --oddrowfontcolor|#000000 --tablebgcolor|#ffffff --aoeColor|#ffff0050 --aoeOutlineColor|#cccc00 --gridColor|#ffffff00 --controlTokName|self --aoeType|circle, float --radius|32.5ft --forceIntersection|0 --minGridArea|0.5 --minTokArea|0.25 --fx|glow-holy --noSave|1 --damageFormula1|[[1d0-2d6]] --damageType1|(Healing) --autoApply|1 }} Also noticed that I'm getting some issues with&nbsp; Error: Cannot read property 'x' of undefined &nbsp;for some Trigger-All when using the exact script from the Wiki for Faerie Fire, as an example, as well as modified versions of this for Slow etc, that I was trying to put together. Could be that in my testing I'm doing things out of order and not selecting the correct tokens etc, but I have retried a few times. Next thing to try is the clear cache&nbsp;
1674997256
David M.
Pro
API Scripter
Styx, I copied your AoV macro and it is working for me. Is your "caster" token selected when you run the trigger-target macro? The smartquery trigger needs the source token selected to know which active AoE (stored in the State object) is associated with that token. I re-tried the wiki FF macro as well and it seems to be working fine. Does the "Error: Can't read property 'x' of undefined" error occur for you all the time or just sporadically? Does it always occur when certain tokens are in the AoE? If so, try it with others - it's possible there is something funky with specific tokens/sheets. What version of smartaoe &amp; libinline are you using? The one-click version of both should be the latest available, but checking on the off chance that you may have an older version manually installed. I haven't knowingly changed anything explicitly to address that type of error, but doesn't hurt to check.
Just curious. Has anyone run into the situation where targets of the AoE spell have advantage on saving throws and how does the API handle that situation when using "Trigger ALL". In my specific situation, the players launch a fireball spell (5e rules) onto a group of Yuan-ti attackers.&nbsp; Yuan-ti have magical resistance giving them advantage on saving throws against spells and other magical effects.&nbsp; But when I use trigger ALL with the AoE API, it just rolls with normal roll.&nbsp; Is there a toggle or a way to take the advantage roll into account using the script?&nbsp; Maybe a trigger ALL with advantage? or a smart query that allows for advantage/disadvantage as needed? In my case, I just used Trigger ALL.&nbsp; If the Yuan-ti passed the saving throw, then great.&nbsp; If they "failed", I rolled the dice again to see if they passed or failed on the advantage roll.&nbsp; If they passed, then I just manually adjusted the damage accordingly. Any other suggestions...?
1675020690

Edited 1675020774
David M.
Pro
API Scripter
An undocumented feature of the script is that if an attribute exists on the character sheet that includes a string matching 'magic resist' (case-insensitive), then the roll is automatically made with advantage. Yuan-ti's from official WoTC sources in the compendium should already include this attribute (though I don't recall what the attribute is called). I just tested on a couple random Yuan-tis from MM1 and VG1 and they rolled with Adv. If these are homebrew or from another source, try adding an attribute (give it any name you want) and set the value to 'magic resistance' and try again. Again, not case-sensitive, but don't put extra spaces between the two words ;)
I apologize if I have missed this somewhere but is there a way that my AoE spell can damage the spell caster?&nbsp; If my Mage is dumb enough to cast a fireball where he/she is in the area of effect, I would like them to be able to take the damage.&nbsp; &nbsp;I tested it out and the code ignored them.&nbsp; &nbsp;Thanks in advance
1675031208

Edited 1675031414
Pak
Pro
Thanks David. I went back and checked the Roll20 chat log and you're right. Your API did account for the resistance. I failed to see the stacked rolls on the output card. I just hovered over the top roll and failed to see the bottom roll. I guess I was so excited to use this API for the first time in a session, I completely missed the double stacked rolls. I did a search for "advantage" on the API Wiki site and I didn't see it specifically called out which echoes your "undocumented feature" remark. The players loved the API!!&nbsp; Thanks for making such an impressive and all encompassing tool that takes into account so many factors! Truly insane! BTW... on another topic, on page 6 of this topic thread, Nirgel asked a question about the combat master API not interacting with SmartAOE.&nbsp; I'm not sure what level of interaction Nirgel was looking for, but I was hoping that combat master would recognize token markers added to the token from the "--conditionfail" and "--conditionpass" commands.&nbsp; You nailed it with your comment back on March 25th.&nbsp; You suggested editing the registerEvent handlers function starting on line 4547 of the combat master API.&nbsp; I followed your suggestion and combat now seems to be interacting with the token markers now! Not a bad suggestion from you considering you were work travel with terrible wifi at the time!&nbsp; You should give combat master a try, it's another insanely useful tool.&nbsp; You and Victor B can join forces to make a MEGA tool that combines SmartAoE and Combat Master! Until then, thanks so much for such a great API. Truly appreciate it! Now let me jump on Victor B's combat master forum thread to see if he can add your suggested code to his next version of combat master.
1675039425
David M.
Pro
API Scripter
Tilt , I should probably add a flag that allows the caster to be damaged. When first building the script, I only had a line aoeType, which includes the caster's square due to the Bresenham algorithm I use. Since I didn't want a caster to lightning bolt themselves (assuming no reflection), I excluded the caster explicitly. Then it just kinda stuck as I expanded other aoeTypes. My players like to roll saves themselves rather than be told what they "rolled", so I have all my SmartAoE macros use an ignore flag&nbsp; based on an attribute that I add to each PC sheet&nbsp; (you'll see many of my examples have&nbsp; --ignore|SmartAoE_Ignore, 1 &nbsp;included).&nbsp; Pak , thanks for the kind words. Glad you're enjoying it!
David M. said: I ran into an issue with the ring solution a while back and haven't revisited it. Still something I'd like to do, but I don't have a timeline right now as I'm mostly working on other projects at the moment, Roger that...appreciate the quick response and the excellent API
David M. said: Styx, I copied your AoV macro and it is working for me. Is your "caster" token selected when you run the trigger-target macro? The smartquery trigger needs the source token selected to know which active AoE (stored in the State object) is associated with that token. I re-tried the wiki FF macro as well and it seems to be working fine. Does the "Error: Can't read property 'x' of undefined" error occur for you all the time or just sporadically? Does it always occur when certain tokens are in the AoE? If so, try it with others - it's possible there is something funky with specific tokens/sheets. What version of smartaoe &amp; libinline are you using? The one-click version of both should be the latest available, but checking on the off chance that you may have an older version manually installed. I haven't knowingly changed anything explicitly to address that type of error, but doesn't hurt to check. Thanks David. I am using 1-click versions, so no issue there. I believe I found the issue though. I was on a map from an Add-on with predefined dynamic lighting. While I can't say for certain it was using polygon lines, as soon as I went to a blank map, everything was working - TriggerTarget, TargetAll, the AoEControlToken was showing the correct area etc.
1675211497

Edited 1675211539
Tilt
Pro
Wanted to ask, is there a way to use width on a line?&nbsp; &nbsp;In 1st edition your lightning bolts can be either 5' or 10' wide depending on the length you want.&nbsp; &nbsp;However, it says the width command is only for walls and I do not see a way to make a line bigger than 5' wide.&nbsp; &nbsp;I can use a wall if I need to and just have the caster set one point on the token, but wanted to ask just in case.&nbsp; &nbsp;Thanks
1675212909
David M.
Pro
API Scripter
The only way to get a variable width "line" is to use the "wall" aoeType. I ran into way too many problems trying to implement a true variable width line.&nbsp; First of all , the line algorithm is completely different from all other aoeTypes. It uses the Bresenham algorithm rather than drawing a shape and calculating percentage area of each grid square. So then there were issues with "which side of the line do I make wider?". For odd-number-of-square lines this was np, but even-number-width lines were unsatisfactory (esp since it has to work for all line angles).&nbsp; Since the "wall" aoeType effectively gave the desired effect, I stuck with that as the recommended solution for "wide" lines.
David M. said: 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. Hi David, just wondering if you or @mkanoap worked this one out? I'm getting the same behaviour but weirdly only in my main game. I tried to build everything up the same way in a test game and it worked fine. Any thoughts? &nbsp; &nbsp;&nbsp;
David M. said: The only way to get a variable width "line" is to use the "wall" aoeType. I ran into way too many problems trying to implement a true variable width line.&nbsp; First of all , the line algorithm is completely different from all other aoeTypes. It uses the Bresenham algorithm rather than drawing a shape and calculating percentage area of each grid square. So then there were issues with "which side of the line do I make wider?". For odd-number-of-square lines this was np, but even-number-width lines were unsatisfactory (esp since it has to work for all line angles).&nbsp; Since the "wall" aoeType effectively gave the desired effect, I stuck with that as the recommended solution for "wide" lines. Perfect.. thanks David
1675264916
David M.
Pro
API Scripter
@Jared, we never found out what was happening in mkanoap's game. His other games worked fine with the same script versions, etc. He did mention that he was noticing a lot of lag in the problem game (an older, larger game) vs. "screaming fast" in new games. One thing we didn't do that you might want to try if you're up to it: make a copy of the problem game and test out there. (Unfortunately you'll have to install your relevant scripts in the new copy). I've had some weird gremlins disappear on me in the past when doing this.
Kaiyatsu said: I feel like I'm doing something wrong here with the damage formula, and I don't think it works properly for higher levels... !smartaoe {{ &nbsp; --title|Flame Strike &nbsp; --titlecardbackground|url('<a href="https://cdna.artstation.com/p/assets/covers/images/040/879/296/large/de-andre-martin-de-andre-martin-firepillarthumbnail.jpg?1630123232');background-size" rel="nofollow">https://cdna.artstation.com/p/assets/covers/images/040/879/296/large/de-andre-martin-de-andre-martin-firepillarthumbnail.jpg?1630123232');background-size</a>: 100% 100%; background-repeat: no-repeat; &nbsp; --leftsub|Slot level ?{Cast at what level?|5,5|6,6|7,7|8,8|9,9} &nbsp; --rightsub|DC @{selected|spell_save_dc} DEX &nbsp; &nbsp; --controlTokName|GenericSpellAoE &nbsp; --controlTokSize|8 &nbsp; --controlTokSide|5 &nbsp; --aoeColor|#99000050 &nbsp; --instant|1 &nbsp; --gridColor|#99000050 &nbsp; --aoeType|circle, float &nbsp; --radius|20ft &nbsp; --forceIntersection|1 &nbsp; --minGridArea|0.25 &nbsp; --minTokArea|0.25 &nbsp; --fx|burn-fire &nbsp; --dc|@{selected|spell_save_dc} &nbsp; --saveFormula|5eDEX &nbsp; --damageFormula1|[[(1+?{Cast at what level?})d6]] &nbsp; --damageType1|Fire &nbsp; --damageFormula2|[[(1+?{Cast at what level?})d6]] &nbsp; --damageType2|Radiant &nbsp; --ignore|SmartAoE_Ignore,1 &nbsp; --autoApply|1 &nbsp; --bar|1 &nbsp; --zeroHPmarker|dead &nbsp; --desc|A vertical column of divine fire roars down from the heavens in a location you specify. Each creature in a 10-foot-radius, 40-foot-high cylinder centered on a point within range must make a Dexterity saving throw. A creature takes 4d6 fire damage and 4d6 radiant damage on a failed save, or half as much damage on a successful one. &nbsp;&nbsp;&nbsp; At Higher Levels: When you cast this spell using a spell slot of 6th level or higher, the fire damage or the radiant damage (your choice) increases by 1d6 for each slot level above 5th. }} @Kaiyatsu, try the formula below instead.&nbsp; The damage rolled correctly when I tried it. [[(?{Cast at what level?}-1)d6]]
Hey! This is great. Just found it earlier tonight and I've already gotten a lot of use out of it. I am having one little problem though--for some reason when I installed the script, it didn't create the AoEGenerator macro. I've tried deleting it and reinstalling it, and I even copied over some of the older versions from GitHub, but nothing I've done seems to have made a difference. The token is created and it's been working fine. It's possible I'm just missing something, but I have spent a fair amount of time at this point looking around to no avail. Is it possible for someone to copy and paste the macro script for me? I'd greatly appreciate it. Or, if there's another solution here, I'd be happy to hear it. Thanks again!
1675335744

Edited 1675335871
David M.
Pro
API Scripter
Weird. Here's the macro. You can cut &amp; paste whichever sections you want. Note these only produce generic versions of several visualizations. Triggers will not work with any of these because there are no details included (saving throw, damage, etc.). EDIT - looks like the emojis have been stripped out by the forum's code formatting. /w gm &amp;{template:default}{{name=AoE Generator}} {{&nbsp;***CAST AT RANGE*** &nbsp; **_____Square / Cube______**&nbsp; [5ft](~AoEControlToken|5ft-Square) [10ft](~AoEControlToken|10ft-Square) [20ft](~AoEControlToken|20ft-Square) [30ft](~AoEControlToken|30ft-Square) [40ft](~AoEControlToken|40ft-Square) **_____Circle / Sphere______**&nbsp; [5ft](~AoEControlToken|5ft-Circle) [10ft](~AoEControlToken|10ft-Circle) [20ft](~AoEControlToken|20ft-Circle) [30ft](~AoEControlToken|30ft-Circle) [40ft](~AoEControlToken|40ft-Circle) **____PF Circle / Sphere____**&nbsp; [5ft](~AoEControlToken|5ft-PF-Circle) [10ft](~AoEControlToken|10ft-PF-Circle) [20ft](~AoEControlToken|20ft-PF-Circle) [30ft](~AoEControlToken|30ft-PF-Circle) [40ft](~AoEControlToken|40ft-PF-Circle) ------------------------------------------ (()) ***FROM CASTER*** (())&nbsp;&nbsp; **_____Square / Cube______**&nbsp; [5ft](~AoEControlToken|5ft-Square-Caster) [10ft](~AoEControlToken|10ft-Square-Caster) [15ft](~AoEControlToken|15ft-Square-Caster) [20ft](~AoEControlToken|20ft-Square-Caster) [30ft](~AoEControlToken|30ft-Square-Caster) [40ft](~AoEControlToken|40ft-Square-Caster) [Variable](~AoEControlToken|Variable-Square)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; **_____Circle / Sphere______**&nbsp; [5ft](~AoEControlToken|5ft-Circle-Caster) [10ft](~AoEControlToken|10ft-Circle-Caster) [15ft](~AoEControlToken|15ft-Circle-Caster) [20ft](~AoEControlToken|20ft-Circle-Caster) [30ft](~AoEControlToken|30ft-Circle-Caster) [40ft](~AoEControlToken|40ft-Circle-Caster) [Variable](~AoEControlToken|Variable-Circle)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; **____PF Circle / Sphere____**&nbsp; [5ft](~AoEControlToken|5ft-PF-Circle-Caster) [10ft](~AoEControlToken|10ft-PF-Circle-Caster) [15ft](~AoEControlToken|15ft-PF-Circle-Caster) [20ft](~AoEControlToken|20ft-PF-Circle-Caster) [30ft](~AoEControlToken|30ft-PF-Circle-Caster) [40ft](~AoEControlToken|40ft-PF-Circle-Caster) [Variable](~AoEControlToken|Variable-PF-Circle)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; **__________Line__________**&nbsp; [30ft](~AoEControlToken|30ft-Line) [60ft](~AoEControlToken|60ft-Line) [100ft](~AoEControlToken|100ft-Line) [Variable](~AoEControlToken|Variable-Line) **_______Cone (Query)______** [15ft](~AoEControlToken|15ft-Cone) [30ft](~AoEControlToken|30ft-Cone) [60ft](~AoEControlToken|60ft-Cone) [Variable](~AoEControlToken|Variable-Cone) **_________5e-Cone________** [15ft](~AoEControlToken|15ft-5eCone) [30ft](~AoEControlToken|30ft-5eCone) [60ft](~AoEControlToken|60ft-5eCone) [Variable](~AoEControlToken|Variable-5eCone) **_________PF-Cone________** [15ft](~AoEControlToken|15ft-PFCone) [30ft](~AoEControlToken|30ft-PFCone) [60ft](~AoEControlToken|60ft-PFCone) [Variable](~AoEControlToken|Variable-PFCone) }}
David M. said: @Jared, we never found out what was happening in mkanoap's game. His other games worked fine with the same script versions, etc. He did mention that he was noticing a lot of lag in the problem game (an older, larger game) vs. "screaming fast" in new games. One thing we didn't do that you might want to try if you're up to it: make a copy of the problem game and test out there. (Unfortunately you'll have to install your relevant scripts in the new copy). I've had some weird gremlins disappear on me in the past when doing this. Thanks David! I tried copying the game and in the copy it was fixed. Its a 3 year game and definitely some gremlins in it.
1675890742

Edited 1675890773
David M. said: @Jared, we never found out what was happening in mkanoap's game. His other games worked fine with the same script versions, etc. He did mention that he was noticing a lot of lag in the problem game (an older, larger game) vs. "screaming fast" in new games. One thing we didn't do that you might want to try if you're up to it: make a copy of the problem game and test out there. (Unfortunately you'll have to install your relevant scripts in the new copy). I've had some weird gremlins disappear on me in the past when doing this. I will add that the problem followed any copies of the game for me.&nbsp; &nbsp;I only got it to go away when on a brand new game.&nbsp; A game made with "copy game" still follows it. BTW, I came here to see if there had been any API breaking changes, because now smartAOE doesn't work at all in my game.&nbsp; &nbsp;When I run&nbsp; a script with it, the control token never appears, there is no output in chat or in the api window. This is not a plea for help, because smartAOE works fine in my test game.&nbsp; It's a function of the buggy old game.&nbsp; So sooner rather than later, I'm going to have to migrate to a new game, and transmogify everything actually needed to the new game.&nbsp; &nbsp;So I just wanted to note that a copy of the game made using the "copy game" dropdown may not help.
1675891727
David M.
Pro
API Scripter
There have been several reports today of scripts affected by some kind of Roll20 backend code push. Did some testing and it seems that if the SmartAoE syntax includes inline rolls (which frankly is like 99% of them), the script now fails silently without crashing the sandbox. If those inline rolls are replaced with static numbers, it works fine. SmartAoE uses the libInline script to handle inline rolls. It's likely that whatever is screwing up everybody else's scripts today (e.g. I know that ChatSetAttr &amp; Autobuttons was affected) is also messing with libInline.&nbsp; So, I'd hold tight for now. It's likely that this will get rolled back or corrected by the Roll20 Devs soon.
1675896857

Edited 1675896886
Pak
Pro
@David M., is it possible to add a way to tag the caster with a token marker to signify the AoE requires concentration?&nbsp; Perhaps a feature add on the next API version :) example: --concentration|0&nbsp; &nbsp;&lt;----default for assuming no concentration --concentration|red&nbsp; &nbsp;&lt;----adds the red token marker to the caster --concentration|concentrate::1510119&nbsp; &nbsp;&lt;----adds a custom marker to the caster
I use scriptcards or tokenmod for these kind of features and tie them together in a single ability/macro.&nbsp;
1675900773

Edited 1675901560
Pak
Pro
Will M. said: I use scriptcards or tokenmod for these kind of features and tie them together in a single ability/macro.&nbsp; I tried to nest a tokenmod command (!token-mod --set statusmarkers|Concentration::5499078) before I run the !smartaoe API but it only runs the tokenmod command and the AoE script doesn't spawn anything. I run the AoE commands using chat menu buttons.&nbsp; I have an ability for each spell that enables me or the players to just click the spell they want. I tried moving the tokenmod command after the smartAOE command and it runs the AoE with no issue but it doesn't apply the tokenmod command.
1675901496
David M.
Pro
API Scripter
With scriptcards you can directly add a statusmarker without using token-mod, and then call SmartAoE. Or call token-mod then SmartAoE. All within the same scriptcard macro. This is different than a macro that uses two lines with bangsy entries, e.g. !token-mod.... !SmartAoE... The latter approach doesn't always work due to an ongoing ROll20 bug where some api calls are skipped or ignored. Adding to the confusion right now: Many mod scripts are currently royally screwed up from what seems to be some kind of backend Roll20 code push. SmartAoE functionality has been restored on my test game, but I know others are still having problems. My guess is that they are slowly rolling back the problem code and it's just taking a while to propagate to all users.