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

1641744245
David M.
Pro
API Scripter
Thanks for the report, Andrea. It does look like map scaling interaction is the issue. I thought I had corrected that, but it seems that there are still some issues for very small scales (I had only tested down to 0.5). The error message when no AoE squares are highlighted is expected (as the script expects there to be some valid squares present). For the maps where the AoE doesn't appear, I'm guessing that it *would* appear if the caster token was in the upper left portion of the map? Either way, I'm going to have to look into this topic again. 
David M. said: Thanks for the report, Andrea. It does look like map scaling interaction is the issue. I thought I had corrected that, but it seems that there are still some issues for very small scales (I had only tested down to 0.5). The error message when no AoE squares are highlighted is expected (as the script expects there to be some valid squares present). For the maps where the AoE doesn't appear, I'm guessing that it *would* appear if the caster token was in the upper left portion of the map? Either way, I'm going to have to look into this topic again.  Hi David, a few more info on experiments I did: strangely on a duplicated copy of the map it worked at 0.25 in some cases. it never works at 0.2 I think there is some processing time issue as with fireball for example a close one (30-40 feet) works and is generated (albeit slowly) if I try to move it far from the source then the area is not generated. in that case even coming back close does not work. lightning bolt or self spell seem to work better or even fine
1641770496

Edited 1641770703
David M.
Pro
API Scripter
Version Update v0.25 - Resource Management! - found  here 1) Will now deduct spell slots or other resources (mana, power points, etc.) . Current attribute values after deduction will be whispered in chat. If insufficient resources, an msg will be sent to chat and the AoE will not be generated.  syntax: --resource|<attrName>,optional <cost>,optional <alias> Examples (5e OGL):   --resource|lvl1_slots_expended   --resource|lvl1_slots_expended,1   --resource|lvl1_slots_expended,1, Level 1 Slots   --resource|lvl?{Cast at what level?}_slots_expended,1,Level ?{Cast at what level?} Slots If <cost> is omitted, it will default to 1. The optional <alias> renames the attribute in the resource chat messages 2) Added --chatAvatarsEnabled subcommand.  Default = true. This will adjust the left margin of the table output appropriately if chat menu avatars are disabled via in-game settings. Example syntax:   --chatAvatarsEnabled|0   --chatAvatarsEnabled|false   --chatAvatarsEnabled|no   --chatAvatarsEnabled|1   --chatAvatarsEnabled|true   --chatAvatarsEnabled|yes 3) Bug fix for very small grid scales (<0.5).  Thanks to Andrea L. for pointing this one out! Note: for irregular grid scales and AoE's that have a radius of an even number of squares, it's best practice to include the following: --forceIntersection|1 The script tries to auto-detect even number of squares prior to generating the AoE for proper alignment, but may get confused with irregularly-scaled grid widths.
David M. said: Version Update v0.25 - Resource Management! - found  here .... 3) Bug fix for very small grid scales (<0.5).  Thanks to Andrea L. for pointing this one out! Note: for irregular grid scales and AoE's that have a radius of an even number of squares, it's best practice to include the following: --forceIntersection|1 The script tries to auto-detect even number of squares prior to generating the AoE for proper alignment, but may get confused with irregularly-scaled grid widths. Works like a charm! thanks David! Andrea
David M. said: Version Update v0.25 - Resource Management! - found  here 1) Will now deduct spell slots or other resources (mana, power points, etc.) . Current attribute values after deduction will be whispered in chat. If insufficient resources, an msg will be sent to chat and the AoE will not be generated.  syntax: --resource|<attrName>,optional <cost>,optional <alias> Examples (5e OGL):   --resource|lvl1_slots_expended   --resource|lvl1_slots_expended,1   --resource|lvl1_slots_expended,1, Level 1 Slots   --resource|lvl?{Cast at what level?}_slots_expended,1,Level ?{Cast at what level?} Slots If <cost> is omitted, it will default to 1. The optional <alias> renames the attribute in the resource chat messages 2) Added --chatAvatarsEnabled subcommand.  Default = true. This will adjust the left margin of the table output appropriately if chat menu avatars are disabled via in-game settings. Example syntax:   --chatAvatarsEnabled|0   --chatAvatarsEnabled|false   --chatAvatarsEnabled|no   --chatAvatarsEnabled|1   --chatAvatarsEnabled|true   --chatAvatarsEnabled|yes 3) Bug fix for very small grid scales (<0.5).  Thanks to Andrea L. for pointing this one out! Note: for irregular grid scales and AoE's that have a radius of an even number of squares, it's best practice to include the following: --forceIntersection|1 The script tries to auto-detect even number of squares prior to generating the AoE for proper alignment, but may get confused with irregularly-scaled grid widths. Awesome Idea.  But for this you should consider to add a Filter that only in PC Sheets the automated calculation is done. The reason for this is that there are often multiple NPC/Monster of the same type with binding to one Sheet, so with the automated calculation those would share a Spell Slot pool, what isn't as it should be
1641861875

Edited 1641861889
David M.
Pro
API Scripter
Carsten, that is a good idea, though the trick would be creating something system agnostic. It would probably have to be something similar to the --ignore subcommand. Sigh.  I was originally thinking this was an optional command so you could just include the line or not. Though, this would require separate macros for pcs & npcs. Tricky. A couple of options for the 5e OGL sheet without any changes to the code: 1) use something like this, which assigns a cost of 0 for npc sheets: --resource|lvl1_slots_expended,[[1-@{selected|npc}]] 2) add a query for the cost (returning 0 or 1). I'll have to think about it some more, but I would probably go with option 1 for the time being.
Hi David, I've been messing around in the code to try and force all output to the GM. My core issue is that in my last session I had some tokens hidden in darkness, but they were hit by the AoE of a fireball. This gave the caster some information about what was in the darkness. I don't want to have to shift tokens between GM layer and token layer based on what the caster can see. My simple solution is to just force everything to be whispered to the GM regardless of layer and sight, much like I ran the game before the script (player rolls damage, and I gm roll to see who saves and gets hurt). Can you maybe add an attribute like --whisperDamage to add to our spells that will force all output to the GM? Or as a loftier goal, whisper damage for tokens that the caster does not have vision of. Or maybe that no one has vision of. roll20 will fade out tokens that are out of line of sight of all players, idk if you can tap into that. Or maybe I need some coffee and this is already an option somewhere.
1641902676
David M.
Pro
API Scripter
Ian, I'll keep that in mind for the next revision. Currently, the only way results are whispered (both the spellcard and auto-damage msgs) is to have those "hidden" tokens on the GM layer. The script will detect those tokens and provide a separate whisper to the GM automatically.
Sunday I was asked by a player if it was possible to add a check like, —suppressDescription|?{Show Spell Description | Show|Hide} if   !suppressDescription then display spell description  So there is a check for the description to be suppressed.  Looking at the wiki it seems like a Boolean check would be easy but I’m not seeing how to do this or if it’s possible.  Is it!
1641925008
David M.
Pro
API Scripter
As long as you don't include any commas in your spell description, you could add a query to the --desc command, returning either a blank space or the actual description. Example for 5e Burning Hands: --desc|?{Show Spell Description?|No, |Yes,As you hold your hands with thumbs touching and fingers spread a thin sheet of flames shoots forth from your outstretched fingertips. Each creature in a 15-foot cone must make a Dexterity saving throw. A creature takes 3d6 fire damage on a failed save or half as much damage on a successful one.%br%%br%The fire ignites any flammable objects in the area that aren't being worn or carried.}
Ok great! Thanks again.
1641961007

Edited 1641961134
I was trying to make a Cure Wounds spell but when I use&nbsp; --damageFormula1|[[-1*2d6]] &nbsp;&nbsp;the amount is always -1.&nbsp; Placing brackets around various area in the math part always yields a -1.&nbsp; I am doing something wrong?&nbsp; I started with adding the spellcasters spell&nbsp; modifier but removed until I get the die roll part working. When I attempt to use the Cast at what level wording so the number dice to roll is dynamic the spell window generally does not appear. Is the Healing part of damageFormula1 broken? Below is my first attempt to expand on Cloudkill to be a Cure Wounds spell. !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; --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|glow-holy &nbsp; --dc|40 &nbsp; --saveFormula|5eDEX &nbsp; --damageFormula1|[[-1*?{Cast at what level?|1,1|2,2|3,3|4,4|5,5|6,6|7,7|8,8|9,9}d8]] &nbsp; --damageType1|Poison &nbsp; --ignore|SmartAoE_Ignore,1&nbsp; &nbsp; --autoApply|1 &nbsp; --bar|1 }}&nbsp;&nbsp;
1641967356
David M.
Pro
API Scripter
Bradley, check out the Aura of Vitality example macro from the wiki to see how to handle healing. " Due to a quirk of the Roll20 inline roll parser, you can't have a negative number in the first position. That is why you will notice the strange&nbsp; [[0 + [[0 - 2]]d6]] &nbsp;syntax for the healing "damage"
Dave,&nbsp; I have a couple quick questions.&nbsp; 1. When the players use a template from the SmartAoE generator or a spell macro with out the instant command how do we get rid of the template after the spell is done? 2. Is the updated version&nbsp;v0.25 a total replacement or an add in? And&nbsp; 3. I am trying to get the damage to work for Cloud of Daggers. This is a 2nd level spell and does 4d4 damage. The damage increases&nbsp;by 2d4 for each level of 3rd or higher. Every thing is working except&nbsp;the damage formula. &nbsp; --damageFormula1|[[(?{Cast at what level?+2)}2d4]] Thanks for your help.
1642003641

Edited 1642003689
Daryl C. &nbsp;said: 3. I am trying to get the damage to work for Cloud of Daggers. This is a 2nd level spell and does 4d4 damage. The damage increases&nbsp;by 2d4 for each level of 3rd or higher. Every thing is working except&nbsp;the damage formula. &nbsp; --damageFormula1|[[(?{Cast at what level?+2)}2d4]] Thanks for your help. Would a sum that does something akin to (spell Level * 2) -2 d4 work.&nbsp; I'm not sure how to write that in the macro but i think that gets you the right number of d4 for every level of the spell.&nbsp; (2=2. 3=4, 4=6 etc)
1642004321
David M.
Pro
API Scripter
Daryl: 1) Just delete the AoE control token. Note: if the AoE originates from the caster, you will need to run the !smartremove command with the caster token selected (command described here ). I forgot to add that button to the AoEGenerator macro. I'd make it a new macro (ability) on the caster's character sheet. 2) Total replacement 3) Try this for the damage formula: --damageFormula1|[[(?{Cast at what level?|2|3|4|5|6|7|9}*2)d4]]
Thanks again, working OT this week but trying to flush out how to use AoE a bit better. &nbsp;I’ll look at the Aura macro. &nbsp;Trying to find an example of a spell and mod it from there. I was thinking here and a quick look at the wiki, it looks like I can have 3 red dot tokens? &nbsp;I think it’s -qty|3 - I want to do magic missile with a red dot token for each missile. &nbsp;Is this possible? Plus have a radio is off self? Looks like AoeTokenControl does.
1642009415
David M.
Pro
API Scripter
Bradley, I don't think SmartAoE is the best solution for a MM spell. Since MM is auto-damage with no save, it wouldn't really benefit from the features of the script. Something like Scriptcards (with a subordinate call to token-mod) would be far less fiddly. SmartAoE would require creating a huge AoE area to account for the range of the spell (possibly causing lag), setting the DC to something impossible for "auto-hit", then triggering for a single target (more clicks). That being said, it is possible to apply duplicates of a statusmarker to a single token with SmartAoE. The following are valid examples: &nbsp; --conditionFail|red, red, red&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//3 red markers &nbsp; --conditionFail|red, red@2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //1 red marker, another marker with a numeral "2" overlay &nbsp; --conditionFail|red@3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//1 red marker with a numeral "2" overlay Also, there is no --qty command in SmartAoE. You might be thinking of the Spawn script?
I'm attempting to compare the Armor Class of a target to the Attack Roll of an alchemist who is throwing a bomb. Specifically, the Tangleroot Bomb, which deals no damage but reduces speed by 10 feet if it hits and immobilizes on a critical. So far, my code is this: !smartaoe {{ --title|Lesser Tanglefoot Bomb --leftsub|[[1d20cs20cf1 + (@{Alchemist|bomb_attack})]] --rightsub|[[1d20]] --titlecardbackground|linear-gradient(blue, cyan) --oddrowbackground|#00ccff --evenrowbackground|#edfcfc --oddrowfontcolor|#000000 --tablebgcolor|#edfcfc &nbsp; --controlTokName|AoEControlToken --controlTokSize|1 &nbsp; --aoeColor|#00ccff50 --aoeOutlineColor|#0099ff --aoeType|circle, float --radius|2.5ft --minGridArea|0.25 --minTokArea|0.25 &nbsp; --fx|explosion-slime --dc|[[1d20cs20cf1 + (@{Alchemist|bomb_attack})]] --saveFormula|bar2 --damageFormula1|0 --damageType1| --instant|yes &nbsp; --autoApply|no --bar|1 --zeroHPmarker|dead &nbsp; --desc|A tanglefoot bag is filled with sticky substances. When you hit a creature with a tanglefoot bag, that creature takes a status penalty to its Speed for 1 minute. Many types of tanglefoot bag also grant an item bonus on attack rolls. On a critical hit, a creature in contact with a solid surface becomes stuck to the surface and immobilized for 1 round, and a creature flying via wings has its wings tangled, causing it to fall safely to the ground and become unable to Fly again for 1 round. Tanglefoot bags are not effective when used on a creature that is in water. The target can end any effects by Escaping or spending a total of 3 Interact actions to carefully remove the sticky substances. These Interact actions don't have to be consecutive, and other creatures can provide the actions as well. The target takes a –10-foot penalty, and the Escape DC is 17. }} The problem comes in on the --saveFormula line. Actually, there are a few problems. But this is the main one. In the example on the SmartAoE wiki, it gives the following example: --saveFormula|&lt;&lt;1d20 + a{dexterity_save_bonus}&gt;&gt; I attempted to use Tokenmod lingo and tried --saveFormula|a{bar2_value} but that got me nowhere. I know SmartAoE can reference the token directly, because it does to remove health from afflicted tokens. The lingo for SmartAoE of --saveFormula|a{bar2} also didn't work. At the end of my rope here. Any help is much appreciated. I hope it's something complicated or impossible and not simple, it's been hours. The dream would be to display the roll to hit on the subtitle, then compare that to each afflicted token's AC (for me stored in bar2), then display if each target passed, failed, or critically failed. On a fail, have Combat Master apply a condition I have made. On a Critical Fail, apply a different condition. Using Pathfinder Second Edition Character Sheet.
1642114226
David M.
Pro
API Scripter
Zack, SmartAoE can really only be used for single target &nbsp;attack rolls, and requires some sneaky backward thinking (dc set to the AC of the target, saveformula set to the attack roll). I personally think there are less fiddly ways to automate attack rolls (like s riptcards). But, if you are ok with only single target and want to continue with this, you should reference the attribute containing the AC, not the token bar. You can reference it as a normal macro @{target|attrName}.
David M. said: Zack, SmartAoE can really only be used for single target &nbsp;attack rolls, and requires some sneaky backward thinking (dc set to the AC of the target, saveformula set to the attack roll). I personally think there are less fiddly ways to automate attack rolls (like s riptcards). But, if you are ok with only single target and want to continue with this, you should reference the attribute containing the AC, not the token bar. You can reference it as a normal macro @{target|attrName}. Just as I was about to submit the question I thought about switching the DC and the save but I got called away to something else. So close.&nbsp; But the problem with targeting the attribute AC is that each token of the same creature can have differing ACs in pathfinder. Goblin A may be flat-footed and down 2 AC, and if the attribute of that is changed (With ChatSetAttr, anyway) it changes Goblin C's AC as well. Does that mean it's not possible for SmartAoE to target the token bars or just not as clean?
1642121199
David M.
Pro
API Scripter
That was kind of my point in bringing it up. It will only work for single target &nbsp;attacks due to how the workflow is currently processed. So, you'd have to click the AoE macro (either selecting the target or using @{target...} and clicking again), then use a single-target-style trigger, which will require another click or two. If there were differing AC's in the area, that particular instance of the AoE would no longer be valid. It's kind of a hack, as the script wasn't originally designed for attacks at all. Again, I think something like a scriptcards macro would likely be a cleaner solution, as it could handle multi-attacking with fewer clicks, plus could call token-mod for the auto hp reduction. Of course it has a steeper learning curve if you haven't used it before.
I'm slogging through it now. It is... a time. Actually, now that I read the attack more, there is only one AC to worry about. I'm just a fool. But now I'm chest-deep in scriptcards. -_- David M. said: That was kind of my point in bringing it up. It will only work for single target &nbsp;attacks due to how the workflow is currently processed. So, you'd have to click the AoE macro (either selecting the target or using @{target...} and clicking again), then use a single-target-style trigger, which will require another click or two. If there were differing AC's in the area, that particular instance of the AoE would no longer be valid. It's kind of a hack, as the script wasn't originally designed for attacks at all. Again, I think something like a scriptcards macro would likely be a cleaner solution, as it could handle multi-attacking with fewer clicks, plus could call token-mod for the auto hp reduction. Of course it has a steeper learning curve if you haven't used it before.
Dave&nbsp; Thanks for 1 and 2. The equation for 3 does not fix the problem. the code I am currently use is as follows.&nbsp; !smartaoe {{ &nbsp; --title|Cloud of Daggers &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|No Save &nbsp; -- titlecardbackground|linear-gradient(silver, grey) &nbsp; --oddrowbackground|#c2bdbd &nbsp; --evenrowbackground|#ffffff &nbsp; --oddrowfontcolor|#856e6e &nbsp; --tablebgcolor|#ffffff &nbsp; --controlTokName|AoEControlToken &nbsp; --controlTokSize|1 &nbsp; --aoeColor|#ffffoo &nbsp; --aoeOutlineColor|#d9d9d9 &nbsp; --aoeType|square, float &nbsp; --radius|5ft &nbsp; --forceIntersection|0 &nbsp; --minGridArea|0.5 &nbsp; --minTokArea|0.25 &nbsp; --fx|burn-blood &nbsp; --noSave|1 &nbsp; --damageFormula1|[[?{Cast at what level?}2d4]] &nbsp; --damageType1|Blood &nbsp; --ignore|SmartAoE_Ignore,1&nbsp; &nbsp; --autoApply|1 &nbsp; --bar|1 &nbsp; --zeroHPmarker|dead &nbsp; --desc|You fill the air with spinning daggers in a cube 5 feet on each side, centered on a point you choose within range. A creature takes 4d4 slashing damage when it enters the spell’s area for the first time on a turn or starts its turn there. %br%%br%At Higher Levels: When you cast this spell using a spell slot of 3rd level or higher, the damage increases by 2d4 for each slot level above 2nd. }} Thanks.
Daryl C. said: Dave&nbsp; Thanks for 1 and 2. The equation for 3 does not fix the problem. the code I am currently use is as follows.&nbsp; !smartaoe {{ &nbsp; --title|Cloud of Daggers &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|No Save &nbsp; -- titlecardbackground|linear-gradient(silver, grey) &nbsp; --oddrowbackground|#c2bdbd &nbsp; --evenrowbackground|#ffffff &nbsp; --oddrowfontcolor|#856e6e &nbsp; --tablebgcolor|#ffffff &nbsp; --controlTokName|AoEControlToken &nbsp; --controlTokSize|1 &nbsp; --aoeColor|#ffffoo &nbsp; --aoeOutlineColor|#d9d9d9 &nbsp; --aoeType|square, float &nbsp; --radius|5ft &nbsp; --forceIntersection|0 &nbsp; --minGridArea|0.5 &nbsp; --minTokArea|0.25 &nbsp; --fx|burn-blood &nbsp; --noSave|1 &nbsp; --damageFormula1|[[?{Cast at what level?}2d4]] &nbsp; --damageType1|Blood &nbsp; --ignore|SmartAoE_Ignore,1&nbsp; &nbsp; --autoApply|1 &nbsp; --bar|1 &nbsp; --zeroHPmarker|dead &nbsp; --desc|You fill the air with spinning daggers in a cube 5 feet on each side, centered on a point you choose within range. A creature takes 4d4 slashing damage when it enters the spell’s area for the first time on a turn or starts its turn there. %br%%br%At Higher Levels: When you cast this spell using a spell slot of 3rd level or higher, the damage increases by 2d4 for each slot level above 2nd. }} Thanks. What about doing the damage like&nbsp;&nbsp; --damageFormula1|[[?{Cast at what level?|2,4|3,6|4,8|5,10|6,12|7,14|8,16|9,18}d4]]
1642169835
David M.
Pro
API Scripter
Daryl, it looks like you are missing the parentheses and asterisk from my example. These are required to properly group and multiply. Also, I noticed in your aoecolor line you used the letters OO&nbsp; instead of numbers 00. This will probably result in a solid black AOE. Finally, I think the radius should be 2.5ft instead of 5ft? Unfortunately I am on mobile for the rest of the day so won't be able to test anything.
Thanks got it to work.
With the Aura of Vitality Macro i found a bug.&nbsp; If you set --controlTokName|self and later try to heal yourself by Trigger-Target and klick on yourself it didn't heal, because line 4832f return obj.tok.get("_id") !== aoeLinks.links[a].originTokID &amp;&amp; rectanglesOverlap(obj.corners[0], obj.corners[2], aoeLinks.links[a].boundingBox[0], aoeLinks.links[a].boundingBox[2]) I changed it to return ((obj.tok.get("_id") !== aoeLinks.links[a].originTokID) || singleTarget) &amp;&amp; rectanglesOverlap(obj.corners[0], obj.corners[2], aoeLinks.links[a].boundingBox[0], aoeLinks.links[a].boundingBox[2]) and now it works. Not totally sure though if there might be a Problem in another Situation then. Maybe add another option if the origin is ignored or not.
1642685709
David M.
Pro
API Scripter
Thanks Carsten, you are correct in that the script currently omits the origin token by design. This is to prevent 99% of the cases where you don't want the control token to roll a save. In the case of triggering for a single target, what you did makes sense. It's unlikely someone would "accidentally" target the wrong token in that case. I'll roll it (or something similar) into the next revision.&nbsp;
This might be a tricky thing to impliment but is there a good way to use this for an NPC without it auto rolling the saves for PCs?&nbsp; I'd like to be able to trigger the effect to get the damage but without it auto rolling any saves, or maybe having a query where I can enter the PC's save values to still show p/f and damage.
1642866093

Edited 1642866107
David M.
Pro
API Scripter
Ebolson, I'd recommend looking into the --ignore command. For example, my players like to roll their own saves and I sometimes have inanimate objects (like light sources) whose tokens represent "characters" that obviously shouldn't be added to the save output. So, I add an attribute I call "SmartAoE_ignore" (but could be called anything) and set the value to be 1 (again could be anything). Then I use the following line in my SmartAoE macros: --ignore|SmartAoE_Ignore, 1 Any tokens representing characters with this matching attribute value are excluded from auto saving throws and subsequent chat output. Of course, that means we apply damage to PCs manually as well.
1642902082

Edited 1642902130
I cannot deduct the Warlock Spell Slots resource on my D&amp;D 5E sheet which is a repeating resource called Warlock Spell Slots+SR I tried : --resource|Warlock Spell Slots+SR,1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (From SmartAoE): &nbsp;Resource 'Warlock Spell Slots+SR' is not found. --resource|@{repeating_resource_$0_resource_left},1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; (From SmartAoE): &nbsp;Resource '2' is not found. &nbsp; &nbsp; (the Script found the value) --resource|repeating_resource_$0_resource_left,1&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (From SmartAoE): &nbsp;Resource 'repeating_resource_$0_resource_left' is not found. I also tried to create an attribute and called it Warlock Spell Slots with the value : @{repeating_resource_$0_resource_left}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; From SmartAoE): &nbsp;Non-numeric current resource value detected (warlock Spell Slots = repeating_resource_$0_resource_left) Any Ideas ? David M. said: Version Update v0.25 - Resource Management! - found&nbsp; here 1) Will now deduct spell slots or other resources (mana, power points, etc.) . Current attribute values after deduction will be whispered in chat. If insufficient resources, an msg will be sent to chat and the AoE will not be generated.&nbsp; syntax: --resource|&lt;attrName&gt;,optional &lt;cost&gt;,optional &lt;alias&gt; Examples (5e OGL): &nbsp; --resource|lvl1_slots_expended &nbsp; --resource|lvl1_slots_expended,1 &nbsp; --resource|lvl1_slots_expended,1, Level 1 Slots &nbsp; --resource|lvl?{Cast at what level?}_slots_expended,1,Level ?{Cast at what level?} Slots If &lt;cost&gt; is omitted, it will default to 1. The optional &lt;alias&gt; renames the attribute in the resource chat messages 2) Added --chatAvatarsEnabled subcommand. &nbsp;Default = true. This will adjust the left margin of the table output appropriately if chat menu avatars are disabled via in-game settings. Example syntax: &nbsp; --chatAvatarsEnabled|0 &nbsp; --chatAvatarsEnabled|false &nbsp; --chatAvatarsEnabled|no &nbsp; --chatAvatarsEnabled|1 &nbsp; --chatAvatarsEnabled|true &nbsp; --chatAvatarsEnabled|yes 3) Bug fix for very small grid scales (&lt;0.5). &nbsp;Thanks to Andrea L. for pointing this one out! Note: for irregular grid scales and AoE's that have a radius of an even number of squares, it's best practice to include the following: --forceIntersection|1 The script tries to auto-detect even number of squares prior to generating the AoE for proper alignment, but may get confused with irregularly-scaled grid widths.
1642907461
David M.
Pro
API Scripter
Sebastian, I believe the reason is that repeating resources are not actually attributes but treated as separate entities (hence the "Resource is not found" error).&nbsp; I didn't realize this when I added the option to the script - it's currently only looking for attributes. Thanks for the heads-up. I'll see what I can do to accommodate repeating resources in the next revision.&nbsp; &nbsp;
Thx David, these repeating resources are a nightmare to deal with !
Hey David! Great script. This sort of stuff makes the generic become artful, I love it. I have just connected up the Concentration script as well, but noticed that the applied damage from SmartAoE doesn't trigger the auto-con-save from Concentration. Do you know if there is a way around this?
Not sure what I have done wrong in following the initial setup/install guide however after loading the latest v0.25 and the libline any command fails to spawn a "control token" over the selected token, have checked the character has udl sight as did the AoEControlToken. I have brought the token manually out on the token layer and the macros from the aoegenerator and examples don't seem to do anything beyond ask about saves
1643473887
David M.
Pro
API Scripter
@Styx, that is to be expected as changes to tokens/characters made by api scripts do not trigger other scripts looking for those changes by default/design. It is possible, but will require modifying the Concentration script to "register" the SmartAoE script to it. I have done this with the Aura HealthTint script, for example . I can play around with it this weekend and see if I can get you a modified version of Concentration. Note that this would require a manual install of the newly modified Concentration script so it won't get automatically updated if changes are made to the one-click version (though it looks like that script has been unchanged for 2yrs now).&nbsp; @Meowster, so you have installed both SmartAoE and libInline, and you are using on a map that has a square grid enabled? If so, note that the aoeGenerator macro only produces AoEs without any damage or saving throws associated with them, so triggering shouldn't do anything except firing off a burn-fire fx. Have you tried one of the example macros and done a Trigger-All while character tokens are within the AoE? If you continue to have problems, fell free to invite me to your game via PM and temporarily promote me to GM - I could take a look at what you've got going on and see if we can get it working for you.
David M. said: @Styx, that is to be expected as changes to tokens/characters made by api scripts do not trigger other scripts looking for those changes by default/design. It is possible, but will require modifying the Concentration script to "register" the SmartAoE script to it. I have done this with the Aura HealthTint script, for example . I can play around with it this weekend and see if I can get you a modified version of Concentration. Note that this would require a manual install of the newly modified Concentration script so it won't get automatically updated if changes are made to the one-click version (though it looks like that script has been unchanged for 2yrs now).&nbsp; Thanks David, that would be awesome. I have Concentration already installed manually so all good there. I'm actually undertaking a full stack software engineering course so I can hopefully start tinkering with this api myself, but I'm a long way from that yet :)
This may be a silly question, but I haven't seen it mentioned here or on the Wiki. Is there any way to call to a Custom FX?&nbsp; I've been playing around with a few of them, and would really like to incorporate those into the spell's FX.
1643516365
David M.
Pro
API Scripter
Chad, custom fx are not currently supported and I honestly don't have any experience with them, even without the api. I'd have to look into it as a possible future feature but couldn't tell you how easy or hard it would be to implement.
1643517017

Edited 1643517081
David M.
Pro
API Scripter
EDIT - looks like I just responded to a post that was deleted, haha. I'll leave my response anyway. In my few minutes of searching , it looks like the custom fx probably need to be called with a different api function (spawnFxWithDefinition) than I am currently using for built-in fx (i.e. SpawnFx or SpawnFxBetweenPoints), and needs to pass a bunch of parameters and/or a custom fx object. From here , it looks like the custom fx object can be grabbed by name and probably passed into the SpawnFxWtihDefinition api function. What might get weird is if the fx requires a direction (like a beam-style fx). I'd have to play around with it to see how that all works. Like I said, a bit too early for me right now to tell how easy or if there are any caveats.
1643564205

Edited 1643564371
David M. said: @Styx, that is to be expected as changes to tokens/characters made by api scripts do not trigger other scripts looking for those changes by default/design. It is possible, but will require modifying the Concentration script to "register" the SmartAoE script to it. I have done this with the Aura HealthTint script, for example . I can play around with it this weekend and see if I can get you a modified version of Concentration. Note that this would require a manual install of the newly modified Concentration script so it won't get automatically updated if changes are made to the one-click version (though it looks like that script has been unchanged for 2yrs now).&nbsp; Hi David, When the AoE script is triggering damages to monsters (and PC ?) and thus altering the health bar, wouldn't concentration trigger the auto-save con throw automatically ? EDIT : On my side i'd love to be able to get those auras put on a character with conditionfail or conditionpass. :)
1643564382

Edited 1643564416
EDIT oups wrong messaging between quote and edit sorry... Lionel V. said: David M. said: @Styx, that is to be expected as changes to tokens/characters made by api scripts do not trigger other scripts looking for those changes by default/design. It is possible, but will require modifying the Concentration script to "register" the SmartAoE script to it. I have done this with the Aura HealthTint script, for example . I can play around with it this weekend and see if I can get you a modified version of Concentration. Note that this would require a manual install of the newly modified Concentration script so it won't get automatically updated if changes are made to the one-click version (though it looks like that script has been unchanged for 2yrs now).&nbsp; Hi David, When the AoE script is triggering damages to monsters (and PC ?) and thus altering the health bar, wouldn't concentration trigger the auto-save con throw automatically ?
1643564995

Edited 1643565011
David M.
Pro
API Scripter
No, scripts that listen for token/character sheet changes ignore them when they are changed by another api script. Pretty sure it is a safety measure to prevent runaway scenarios. SmartAoE has a public-facing function that can be registered to other scripts, which I believe is the only way this will work.
ah ok.. could you post the change needed from concentration or SmartAoE to have such registration. I'm interested :p
1643572861

Edited 1643573558
David M.
Pro
API Scripter
To register SmartAoE to the Concentration script, you will need to manually install Concentration and replace its registerEventHandlers function (starts on line 436 of the latest version on one-click) with the following: registerEventHandlers = () =&gt; { on('chat:message', handleInput); on('change:graphic:bar'+state[state_name].config.bar+'_value', handleGraphicChange); on('change:graphic:statusmarkers', handleStatusMarkerChange); //register this script to SmartAoE to handle linked bar hp changes if('undefined' !== typeof SmartAoE &amp;&amp; SmartAoE.ObserveTokenChange){ SmartAoE.ObserveTokenChange(function(obj,prev){ handleGraphicChange(obj, prev); }); }; }, Let me know how this works. I've never used the Concentration script before, and it didn't seem to automatically add status markers for me in all cases. I may have messed something up with the configuration, though. Regardless, when I damaged a concentrating token with&nbsp; a SmartAoE Burning Hands, it auto-rolled the concentration check so the registration appears to be valid.
David M. said: To register SmartAoE to the Concentration script, you will need to manually install Concentration and replace its registerEventHandlers function (starts on line 436 of the latest version on one-click) with the following: registerEventHandlers = () =&gt; { on('chat:message', handleInput); on('change:graphic:bar'+state[state_name].config.bar+'_value', handleGraphicChange); on('change:graphic:statusmarkers', handleStatusMarkerChange); //register this script to SmartAoE to handle linked bar hp changes if('undefined' !== typeof SmartAoE &amp;&amp; SmartAoE.ObserveTokenChange){ SmartAoE.ObserveTokenChange(function(obj,prev){ handleGraphicChange(obj, prev); }); }; }, Let me know how this works. I've never used the Concentration script before, and it didn't seem to automatically add status markers for me in all cases. I may have messed something up with the configuration, though. Regardless, when I damaged a concentrating token with&nbsp; a SmartAoE Burning Hands, it auto-rolled the concentration check so the registration appears to be valid. That's perfect! Thanks again David!
Trying to craft a Mind Blast macro for Mind Flayers. Everything seems to be working except the spell DC is coming up 0 instead of 15. Not sure how to set the &lt;--rightsub|DC&gt; to a static value. !smartaoe {{ &nbsp; --title|Mind Blast &nbsp; --rightsub|DC @{selected|spell_save_dc} INT &nbsp; --oddrowbackground|#aaaaaa &nbsp; --evenrowbackground|#cccccc &nbsp; --oddrowfontcolor|#000000 &nbsp; --tablebgcolor|#cccccc &nbsp; --aoecolor|#ffffff00 &nbsp; --aoeOutlineColor|#ffffff90 &nbsp; --gridcolor|#000000 &nbsp; --aoeType|5econe &nbsp; --forceIntersection|0 &nbsp; --radius|60ft &nbsp; --origin|nearest, face &nbsp; --minGridArea|0.25 &nbsp; --minTokArea|0.25 &nbsp; --fx|beam-magic &nbsp; --dc|@{selected|spell_save_dc} &nbsp; --saveFormula|5eINT &nbsp; --damageformula1|[[4d8+4]] &nbsp; --damageType1|Psychic &nbsp; --ignore|SmartAOE_ignore,1&nbsp; &nbsp; --instant|1 &nbsp; --autoApply|1 &nbsp; --bar|1 &nbsp; --conditionFail|fist &nbsp; --zeroHPmarker|dead &nbsp; --desc|The mind flayer magically emits psychic energy in a 60-foot cone. Each creature in that area must succeed on a DC 15 Intelligence saving throw or take 4d8 + 4 psychic damage and be stunned for 1 minute. A creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. }}
David M. said: Have you installed the linInline script (available on one-click)? SmartAoE is dependent on that script. Hi! David, thank you so much for the advice! It was my fault, I haven't read the setup instructions properly. Apologies for such a late reply. I have another question though. I'm trying to create a macros for Create Bonfire spell for my Druid player, but having troubles with displaying the "damage zone", as the red zone doesn't fit inside a 5ft square. Here is the current code/macros: !smartaoe {{ --title|Create Bonfire --leftsub|Conjuration Cantrip --rightsub|DC @{selected|spell_save_dc} DEX --titlecardbackground|url('<a href="https://s3.amazonaws.com/files.d20.io/images/263532609/y1cpA-oyqwGEJxV_ctxbdg/max.jpg?1641564234');background-size" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/263532609/y1cpA-oyqwGEJxV_ctxbdg/max.jpg?1641564234');background-size</a>: 100% 100%; background-repeat: no-repeat --aoeColor|#ff0000 --aoeOutlineColor|#ffff00 --instant|1 --gridColor|#ffff50 --aoeType|square, float --forceIntersection|true --origin|center --radius|5ft --minGridArea|0.6 --minTokArea|1 --fx|burst-fire --dc|@{selected|spell_save_dc} --saveFormula|5eDEX --damageFormula1|[[1d8]] --damageType1|fire --ignore|SmartAoE_Ignore,1 --hideNames|FALSE --autoApply|1 --bar|1 --desc|You create a bonfire on ground that you can see within range. Until the spell ends, the magic bonfire fills a 5-foot cube. Any creature in the bonfire’s space when you cast the spell must succeed on a Dexterity saving throw or take 1d8 fire damage. A creature must also make the saving throw when it moves into the bonfire’s space for the first time on a turn or ends its turn there. The bonfire ignites flammable objects in its area that aren’t being worn or carried. The spell’s damage increases by 1d8 when you reach 5th level (2d8), 11th level (3d8), and 17th level (4d8). }} I'll be very happy if you could help me with this one. The current AoE zone looks like this.