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

1647797797
David M.
Pro
API Scripter
Carsten, currently tokens on the GM layer are also affected by any SmartAoE in play. If so, they will have their results whispered to the GM when the effect is triggered. While automatically changing the layer of a targeted token is not a current option, the script can automatically add status markers to tokens on both the objects and GM layers.
Ideally instead of bringing it up to the token layer, it would be nice to affect an aura on the token layer (a bit like what bump script does). But yeah, being able to affect auras on a condition fail (or pass) would be wonderful. It is already possible to create a status marker on these conditions. I don't know what would be the solution. If the character is invisible through bump, that means that you could affect a status marker to the bumped aura and it would then appear on the layer.Ideally i'd prefer to have a visible to players' aura on the bumped character. If the character is invisible because on the gm layer, it' probably a lot more complicated to have the token switch from layer to layer.
Something strange is happening on some maps in my campaign. In some of them the script works perfectly, but in others the AoE is not aligned with the grid. It is the same macro (burning hands). Any idea why it happens and how I can fix it? Here it works as expected. ??? I have made sure that the maps are correctly aligned with the grid.
1647817893

Edited 1647818055
David M.
Pro
API Scripter
Iosu, what version do you have installed? v0.25 is the latest. Are the grid settings different between the two pages? If so, what are they? There was a bug in older versions that caused this behavior for certain non-unity grid scales, but I thought this had all been taken care of. If we can't resolve this easily on the forum, the next thing might be to PM me a link to your game and promote me to GM so I can troubleshoot. EDIT - Something else to try might be to make a copy of the problem page and try it over there. I seem to recall witnessing a "corrupted" map one time a few months ago in one of my friend's games. 
1647908105

Edited 1647989294
I think I have already found the problem (and the solution). I have some maps that I have fitted taking into account the pixels and not the cells. When the number of cells is not an integer (eg 20.5) in width or height, the AoE does not fit the grid. In fact, the offset is proportional to the decimal number. If I can, I'll add some screenshot later. Amazing script. I love it. EDIT:
1647918194
David M.
Pro
API Scripter
Ah interesting, and nice sleuthing! I had never considered testing a grid with "partial squares" that have been cut off on the map edge before. I'll have to think about how I'm handling that. 
with the condition added on fail, the script doesnt interact with the combat master api as i thought it would, is there a workaround for this?
1648213744

Edited 1648213831
David M.
Pro
API Scripter
CombatMaster would have to be modified to recognize the SmartAoE script. I've never used CombatMaster, but from a quick peek at the code it looks like all you would need to do is edit the registerEventHandlers function (starts on line 4547 of the one-click version on github, found here ).  This is the original function: registerEventHandlers = function() { on('chat:message', inputHandler); on('close:campaign:turnorder', handleTurnorderChange); on('change:campaign:turnorder', handleTurnorderChange); on('change:graphic:statusmarkers', handleStatusMarkerChange); on('change:campaign:initiativepage', handeIniativePageChange); on('change:graphic:top', handleGraphicMovement); on('change:graphic:left', handleGraphicMovement); on('change:graphic:layer', handleGraphicMovement); on('change:graphic:'+state[combatState].config.concentration.woundBar+'_value', handleConstitutionSave); if('undefined' !== typeof DeathTracker && DeathTracker.ObserveTokenChange){ DeathTracker.ObserveTokenChange(function(obj,prev) { handleStatusMarkerChange(obj,prev); }); } if('undefined' !== typeof InspirationTracker && InspirationTracker.ObserveTokenChange){ InspirationTracker.ObserveTokenChange(function(obj,prev) { handleStatusMarkerChange(obj,prev); }); } if('undefined' !== typeof TokenMod && TokenMod.ObserveTokenChange) { TokenMod.ObserveTokenChange(function(obj,prev) { handleStatusMarkerChange(obj,prev); }); } }; Try changing it to this. I've bolded the new code block to add to the end of the function. Since I totally stole Aaron's naming convention for the public-facing SmartAoE function that combat master will use, it looks pretty clean. Pay attention to where the curly braces are when pasting the bolded part in your live copy, as pasting in the wrong place will likely cause errors. registerEventHandlers = function() { on('chat:message', inputHandler); on('close:campaign:turnorder', handleTurnorderChange); on('change:campaign:turnorder', handleTurnorderChange); on('change:graphic:statusmarkers', handleStatusMarkerChange); on('change:campaign:initiativepage', handeIniativePageChange); on('change:graphic:top', handleGraphicMovement); on('change:graphic:left', handleGraphicMovement); on('change:graphic:layer', handleGraphicMovement); on('change:graphic:'+state[combatState].config.concentration.woundBar+'_value', handleConstitutionSave); if('undefined' !== typeof DeathTracker && DeathTracker.ObserveTokenChange){ DeathTracker.ObserveTokenChange(function(obj,prev) { handleStatusMarkerChange(obj,prev); }); } if('undefined' !== typeof InspirationTracker && InspirationTracker.ObserveTokenChange){ InspirationTracker.ObserveTokenChange(function(obj,prev) { handleStatusMarkerChange(obj,prev); }); } if('undefined' !== typeof TokenMod && TokenMod.ObserveTokenChange) { TokenMod.ObserveTokenChange(function(obj,prev) { handleStatusMarkerChange(obj,prev); }); } if('undefined' !== typeof SmartAoE && SmartAoE.ObserveTokenChange){ SmartAoE.ObserveTokenChange(function(obj,prev){ handleStatusMarkerChange(obj,prev); }); }; }; I'm on work travel right now (with terrible wifi btw), so this is untested but it seems pretty straightforward. You would need to disable or uninstall the one-click version of combat master, then create a "new script" by copying and pasting the code from github that I linked above. Then add the bolded lines from the second code block above in the appropriate location and click on "Save script". Hope that helps!
I love this tool, it is really awesome. I do have some questions on it. I am trying to make Sleep and I have been running into some issues. I'm having an issue with rolling the damage formula but then not applying the result to the tokens as it doesn't damage them. I realize it is too much of an ask to sort through the tokens in the aoe by HP from lowest to highest and then subtract the npcs HP the total rolled. But I am fine with it displaying the total rolled then manually doing the math and selecting those affected by Sleep.  Do you think there is a way to do this? I hope this made sense, if not I can clarify! Thank you.
Sleep is an interesting spell, I went down the path of creating a specific SmartAoE for it but found there was no way to trigger the sleep effect the way it is written.  I myself went for a dumb version, just using an area of effect mechanism and then selecting the creatures that failed manually.  There may be a way to accomplish this, but its currently beyond me.
1648585030

Edited 1648585279
David M.
Pro
API Scripter
Yeah, spells like sleep and color spray are really funky and outside the scope of this script at the moment. SmartAoE is only going to be useful for targeting purposes in those cases.  Well, if you really wanted to use the script to target and also trigger / roll damage, you could try something like this. It sets the DC to something stupid, rolls a meaningless save, and reports the same damage for successful and failed saves (but we're ignoring that anyway). No autoApply in this case, so you would apply the sleep hp mechanic manually. I just used the default appearance below but that is easily changed. Given the kluge-y nature of all this, though, I would probably just use a std 5e macro for sleep damage tbh.  !smartaoe {{ --title|Sleep --leftsub|Slot level ?{Cast at what level?|1|2|3|4|5|6|7|8|9} --rightsub|No Save --aoeType|square, float --offset|1,0 --radius|10ft --fx|glow-charm --dc|100 --saveFormula|5eCON --damageFormula1|[[(3+?{Cast at what level?}+?{Cast at what level?})d8]] --damageType1|Sleep --damagesaverule|*1 --instant|1 --desc|This spell sends creatures into a magical slumber. Roll 5d8; the total is how many hit points of creatures this spell can affect. Creatures within 20 feet of a point you choose within range are affected in ascending order of their current hit points (ignoring unconscious creatures).%br%Starting with the creature that has the lowest current hit points, each creature affected by this spell falls unconscious until the spell ends, the sleeper takes damage, or someone uses an action to shake or slap the sleeper awake. Subtract each creature's hit points from the total before moving on to the creature with the next lowest hit points. A creature's hit points must be equal to or less than the remaining total for that creature to be affected.%br%Undead and creatures immune to being charmed aren't affected by this spell. }}  Btw I noticed something funky with the damageFormula when testing this. The formula should be [[(3 + 2*?{Cast at what level?})d8]], but it is not liking the "*" for multiplication (it fails silently and doesn't output to chat). That's why you may have noticed the double reference to spell level in the formula above instead of multiplication. I'll have to look into that. Some kind of interaction with the libInline script.
Thank you for a quick response! Yeah I figured this was the approach I was going to have to take. I appreciate you taking the time to respond. I did just have a thought though, can you change it to the opposite? Like make the dc stupid easy, change damagesaverule to *0 and then apply  --conditionpass | sleepy? I'm  going to try it real quick! EDIT: Yeah I got it to work how I was hoping! So I just changed how the targets do their saving throw to guarantee a successful save. Then on a successful save, take no damage and apply the sleepy icon. !smartaoe {{ --title|Sleep --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} --rightsub|No Save --controlTokName|AoeControlToken --controlTokSize|1 --aoeColor|#99000050 --instant|1 --gridColor|#99000050 --aoeType|circle, float --radius|20ft --forceIntersection|1 --minGridArea|0.25 --minTokArea|0.25 --fx|explosion-charm --dc|@{selected|spell_save_dc} --saveFormula|<<1d20+30>> --damageFormula1|[[(3+?{Cast at what level?}+?{Cast at what level?})d8]] --damagesaverule|*0 --conditionpass|sleepy --ignore|SmartAoE_Ignore,1 --autoApply|0 --desc|This spell sends creatures into a magical slumber. Roll 5d8; the total is how many hit points of creatures this spell can affect. Creatures within 20 feet of a point you choose within range are affected in ascending order of their current hit points (ignoring unconscious creatures).Starting with the creature that has the lowest current hit points, each creature affected by this spell falls unconscious until the spell ends, the sleeper takes damage, or someone uses an action to shake or slap the sleeper awake. Subtract each creature’s hit points from the total before moving on to the creature with the next lowest hit points. A creature’s hit points must be equal to or less than the remaining total for that creature to be affected.Undead and creatures immune to being charmed aren’t affected by this spell. At Higher Levels. When you cast this spell using a spell slot of 2nd level or higher, roll an additional 2d8 for each slot level above 1st. }}
1648594012
David M.
Pro
API Scripter
Your solution is much better! Forcing to pass in that way allows you to apply the condition marker more easily by just clicking the green "P" in the output table as needed. I would probably change the saves to the following hardcoded values to make it look more uniform and obvious that no saves are "really" being rolled. Everyone rolls a 0, which still "passes" against a dc of -1 haha. --dc|-1 --saveFormula|<<0>> Finally, the fx keyword for explosion is actually "explode", so if you want that big explosion use this:   --fx|explode-charm That has been a typo in the Roll20 fx toolbar (or in the api) since forever and the Devs have never fixed it :/
Sweet, thank you so much! Out of curiosity, does SmartAoE support hexes?
1648607954
David M.
Pro
API Scripter
Unfortunately, no hex support. I started writing a paragraph explaining why this would be so difficult, but let's just say that there is a ton of math involved in this script already and the thought of adding support for two types of hexes to SmartAoE is... daunting. The thought crossed my mind briefly when I first started this project, but for now that is a huge can of worms that I am not prepared to open!
haha I understand lol but seriously thank you for putting in the work for this! It is such an awesome tool!
Such a great script. Thanks for your work, David. One issue I'm having is with the fireball macro from the repository. I've deleted the token face command and replaced the token itself with a Fireball template i purchased. Whenever I or a player uses this macro, it sends the control token to the GM layer. I can switch layers and allow them to move it afterward but I can't figure out why it is doing so in the first place. Any advice would be greatly appreciated. !smartaoe {{   --title|Fireball   --leftsub|Slot level ?{Cast at what level?|3,3|4,4|5,5|6,6|7,7|8,8|9,9}   --rightsub|DC @{selected|spell_save_dc} DEX      --controlTokName|Fireball   --controlTokSize|10   --aoeColor|#99000050   --instant|1   --gridColor|#99000050   --aoeType|circle, float   --radius|20ft   --forceIntersection|1   --minGridArea|0.5   --fx|burn-fire   --dc|@{selected|spell_save_dc}   --saveFormula|5eDEX   --damageFormula1|[[(5+?{Cast at what level?})d6]]   --damageType1|Fire   --ignore|SmartAoE_Ignore,1    --autoApply|1   --bar|1   --zeroHPmarker|dead   --desc|A bright streak flashes from your pointing finger to a point you choose within range and then blossoms with a low roar into an explosion of flame. Each creature in a 20-foot-radius Sphere centered on that point must make a Dexterity saving throw. A target takes 8d6 fire damage on a failed save, or half as much damage on a successful one.%br%%br%The fire spreads around corners. It ignites flammable Objects in the area that aren’t being worn or carried. }}
1649170245
David M.
Pro
API Scripter
Nico, I did a little testing and think I might have an explanation. The spawned token is a copy of the "default token" in all respects except for a few options that are explicitly set. The token layer is not one of those. I didn't realize it, but if the default token is on the GM layer when it is saved as the default token for the character sheet, that default layer is apparently preserved. Since I am not explicitly setting the layer during the token spawn, I think it is "remembering" the gm layer setting!  Try resaving your fireball default token when it is on the object/token layer and see if it resolves your issue. Sorry, that had never come up before. I didn't even realize that it was a thing haha. If you are still having issues, let me know. I really should explicitly set the control token layer in future revisions.  
That was it, David. I am much obliged :D
Sorry if this has been asked before or if I missed something in the wiki. Is there a way to have the damage applied to the caster as well? I am using a modified version of the Aura of Vitality from the wiki as a Mass Cure Wound. I would like it to also apply the healing (damage) to the caster as well if they are within the sphere.
1649763735
David M.
Pro
API Scripter
Yeah, that is for sure something that I'll need to address. There is reasoning behind currently ignoring the source token that I won't get into here, and tbh I wasn't even considering healing spells when the script was originally developed. The easiest solution might be for me to add something like a --includeSource|1 option to the script. I'll think about it and try to get something out in the next couple days.
Thanks for the info! I might also try and mess around with the GroupCheck macro and come up with something for AoE heals as well. Other than that I have macros working great for fireball, faerie fire, cone of cold, and thunderwave. This API works great! 
1649800430
David M.
Pro
API Scripter
Great! Regarding healing: in my own games we actually just handle healing manually. Caster rolls and players update their tokens with linked bars. It's already such a simple and fast process. Automation doesn't buy me much, personally. 
  Daryl C.   - The damage formula for Cloud of Daggers is: --damageFormula1|[[([[2*?{Cast at what level?}]])d4]] So the completed scripts will look like this (with the change in bold):  !smartaoe {{   --title|Cloud of Daggers   --leftsub|Slot level ?{Cast at what level|2,2|3,3|4,4|5,5|6,6|7,7|8,8|9,9}   --rightsub|No Save   -- titlecardbackground|linear-gradient(silver, grey)   --oddrowbackground|#c2bdbd   --evenrowbackground|#ffffff   --oddrowfontcolor|#856e6e   --tablebgcolor|#ffffff   --controlTokName|AoEControlToken   --controlTokSize|1   --aoeColor|#ffffoo   --aoeOutlineColor|#d9d9d9   --aoeType|square, float   --radius|5ft   --forceIntersection|0   --minGridArea|0.5   --minTokArea|0.25   --fx|burn-blood   --noSave|1   --damageFormula1|[[([[2*?{Cast at what level?}]])d4]]   --damageType1|Blood   --ignore|SmartAoE_Ignore,1    --autoApply|1   --bar|1   --zeroHPmarker|dead   --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. }}
1650234614

Edited 1650234773
Hey folks,&nbsp; I'd like to say firstly thanks for such an awesome script! I'm very new to this all but I'm trying to link the spellbook macro couertsay of @Fluffanutter to these spells. Does anyone know how to do such a thing? I've added the scripts for 'Thunderwave' and 'Shatter' but I would like to link them somehow. Here is the script: &amp;{template:default}{{name=@{selected|character_name} Spellcasting }}{{ Spell DC @{selected|spell_save_dc} = +@{selected|spell_attack_bonus} to hit with spell attacks }}{{ Cantrips = [@{selected|repeating_spell-cantrip_$0_spellname}](~selected|repeating_spell-cantrip_$0_spell) [@{selected|repeating_spell-cantrip_$1_spellname}](~selected|repeating_spell-cantrip_$1_spell) [@{selected|repeating_spell-cantrip_$2_spellname}](~selected|repeating_spell-cantrip_$2_spell) [@{selected|repeating_spell-cantrip_$3_spellname}](~selected|repeating_spell-cantrip_$3_spell) }}{{ 1st (Slots) @{selected|lvl1_slots_expended}|@{selected|lvl1_slots_total} = [@{selected|repeating_spell-1_$0_spellname}](~selected|repeating_spell-1_$0_spell) [@{selected|repeating_spell-1_$1_spellname}](~selected|repeating_spell-1_$1_spell) [@{selected|repeating_spell-1_$2_spellname}](~selected|repeating_spell-1_$2_spell) [@{selected|repeating_spell-1_$3_spellname}](~selected|repeating_spell-1_$3_spell) }}{{ 2nd (Slots) @{selected|lvl2_slots_expended}|@{selected|lvl2_slots_total}= [@{selected|repeating_spell-2_$0_spellname}](~selected|repeating_spell-2_$0_spell) [@{selected|repeating_spell-2_$1_spellname}](~selected|repeating_spell-2_$1_spell) }} Thunderwave for example: &nbsp;Name:&nbsp;Thunder-wave !smartaoe {{ &nbsp; --title|Thunderwave &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|DC @{selected|spell_save_dc} CON &nbsp; --titlecardbackground|url('<a href="https://s3.amazonaws.com/files.d20.io/images/253624290/aHQ8iSGWD1gYyR94kocxOg/max.png?1635893578');background-size" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/253624290/aHQ8iSGWD1gYyR94kocxOg/max.png?1635893578');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|[[(?{Cast at what level?}+1)d8]] &nbsp; --damageType1|Thunder &nbsp; --instant|1 &nbsp; --ignore|SmartAoE_Ignore,1&nbsp; &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 2d8 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. }} Thank you :)
I'm trying to create an "aura of the storm (tundra) macro for a barbarian in my 5e game.&nbsp; This aura gives 2 temporary hit points when it is first activated, and renews them when they activate it with a bonus action.&nbsp; &nbsp;So, setting bar3 as hp_temp, I tried modifying the sample macro for aura of vitality to do -2 negative temporary HP, but only if they don't have more than 2 temporary hit points already.&nbsp; i.e. I don't want it to keep adding temporary hit points when activated if they already have some. I thought I had it cracked with this: &nbsp; --damageFormula1| [[ 0 - {[[2+floor(@{Nanduc Sturgugian|Level}/5)]], [[0+@{selected|hp_temp}]]}kh1 + [[0+@{selected|hp_temp}]] ]] i.e. "0-{aura bonus or current temp_hp, whichever is higher)+ current_temp_hp".&nbsp; Returns 0,-1 or -2 for the current aura bonus of 2. The inline calculation works fine in chat, but I discovered that it doesn't work as the damage formula because the value of "selected" remains the selected token, no matter which token is getting the "damage" applied to it.&nbsp; &nbsp;There there a way to reference an attribute of each token as the !smarttrigger loops through them? Or if not that, maybe a way to set it so damage won't take a value above or below a certain value?&nbsp; That way you could say "apply -2 damage to bar 3, but never let the value go beyond 2" so the -2 damage will only change the value if it starts at 0 or 1.
1650623708
David M.
Pro
API Scripter
Shivverz , AFAIK you would have to explicitly reference individual SmartAoE spell abilities, which seems to defeat the purpose of the generalized spellbook macro.&nbsp; mkanoap , I unfortunately don't have a solution for you right now, either. The same damage roll is used for all tokens (only the "saves" are deferred for each token), so no attribute deferral method would apply. For this reason, I don't think SmartAoE is going to be the best script for this application.&nbsp; If you really want automation for this, I would probably use token-mod to toggle a regular token aura on/off and then use a second "targeted" token-mod macro/ability to set the temp hp. You should be able to use a simplified variation of your formula for that.
1650638335

Edited 1650640797
Thanks David! I found a cheesy workaround like this:&nbsp; !smartremove !smartaoe {{ smartaoe that does 2 points of "reset" damage to bar 3 and then deletes itself, relying on the fact that 0 is the floor }} !smarttrigger !smartaoe {{ smartaoe that does 2 negative points of healing damage to bar 3, and sticks around }} !smarttrigger !token-mod --set bar3_value|[[ 0 + {[[2+floor(@{ barbarian |Level}/5)]], [[0+@{selected|hp_temp}]]}kh1]] set the temp HP on the barbarian in the center of the storm So now my question is, is there a way to suppress the output, or make it just whisper to the GM?&nbsp; My macro ends up spamming the chat with unneeded info. edit: Corrected the last line.
Thanks David,&nbsp; I've been playing around with some scripts using the others for reference and from trial and error I managed to create a dragon breath :) Hope this helps anyone who needs it! !smartaoe {{ --title|Fire Breath -- titlecardbackground|url('<a href="https://s3.amazonaws.com/files.d20.io/images/253615223/QhQiZxJ2ufS_ry8uXVYPLQ/max.png?1635890238');background-size" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/253615223/QhQiZxJ2ufS_ry8uXVYPLQ/max.png?1635890238');background-size</a>: contain; --aoeType|5econe --forceIntersection|0 --radius|90ft --origin|nearest, face --minGridArea|0.25 --minTokArea|0.25 --fx|burn-fire --dc|@{selected|spell_save_dc} --saveFormula|5eDEX --damageFormula1|[[26d6]] --damageType1|Fire --instant|1 --ignore|SmartAoE_Ignore,1 --autoApply|1 --bar|1 --zeroHPmarker|dead --desc|The Ancient Red Dragon breathes fire in a 90-foot cone. Each creature in that area must make a DC 24 Dexterity saving throw, taking [[26d6]] fire damage on a failed save, or half as much damage on a successful one. }}
Amazing script. Thanks! I'm wondering if it's possible to have the damage rolls account for Elemental Adept?
1650746373
David M.
Pro
API Scripter
Hmm. Would it work if you explicitly added this line? &nbsp; --resistanceRule|*1 Untested, but that should just multiply any damage matching one of the types in the npc_resistances attribute by 1. You might be able to turn that into a query if you want the same macro to handle the spell for those with/without the feat. Query result would be either *1 or *0.5.&nbsp; Note that if you had a spell with multiple damage types and only one type matched the adept type, this would break the math for the non-adept type. This should be very rare, though.
Hi all, I'm trying to make a mass cure wounds Aoe and i'm struggling with the damage (healing) formula as it's a calculation + the spellcasting ability modifier but i cannot find the right attribute to add (or substract actually) Also it's supposed to evolve with the level casted and with the spellcasting ability modifier&nbsp; Something like that ? --damageFormula1|[[(0 + [[0 - ((?{Cast at what level?}-2)]]d6 - @{selected|spell_casting_ability_mod)]] couldn't find that attribute Not sure this attribute exists BTW, and i'm sure there's an easier way to script all that Using 5e ogl sheet. Any Idea ?
1651107421
David M.
Pro
API Scripter
Not exactly easier, as negative numbers with inline rolls is super weird. But, assuming wisdom is your casting ability, this should work --damageFormula1|[[0 + [[0 - [[?{Cast at what level?|5}-2]]d8 - @{selected|wisdom_mod}]]]] Note that with all the nested inlines, you will lose the mouseover math check.
Ah great,&nbsp; I wasn't that far from truth hehe thanks
1651228884

Edited 1651235974
Hi again,&nbsp; And how would you deal the damages formulas for flame strike, where when you cast it on a higher level, only one of the 2 inflicted damages types are increased ? Initially you cast it at level 5, and you get 4d6 of fire and radiant damages. If you cast it at higher level, either radiant or fire damage (choice of the caster) is increased by 1d6 for each spell level higher than 5. There should be a query somewhere asking you (if the spell is casted at a level higher than 5) what damage shall be increased but i keep turning this in my head without finding the solution... When should this be asked and how to install that conditionality in the macro...i'm lost As you guessed, i love so much your script that i'm currently converting all the area spells of our players to smart AoE. but this one is currently giving me some headaches...lol Another Area that is, IMO, missing in the script is a circle, and i'm talking about a circle more than a sphere. Some spells (blade barrier, wall of fire, and some others) can be shaped as straight or circular, thus affecting only the perimeter of the walls and not the entire circle area.
1651237076
David M.
Pro
API Scripter
--damageFormula1 and --damageFormula2 should be used for Flame Strike, along with --damageType1 and --damageType2. See the Ice Storm example in the wiki. I have a "ring" aoeType (doughnut-shape) that has been half completed for a while, but it was causing issues with some other types so more troubleshooting is required. It's on the horizon.
1651237816

Edited 1651237990
David M. said: --damageFormula1 and --damageFormula2 should be used for Flame Strike, along with --damageType1 and --damageType2. See the Ice Storm example in the wiki. I agree on that and I configured the spell that way. My issue is on the additional 1d6 if the spell is casted on higher levels. This additionnal 1d6 per level above 5 is on one of the 2 damages only, on the choice of the caster. That's my query/conditional issue on that particular spell EDIT 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.
1651238599
David M.
Pro
API Scripter
Ah, the only way I can see that working is to have two separate queries, one in each damageformula. Or you could write a scriptcard that handles that logic with a single query and dynamically builds the smartaoe syntax during runtime. I am traveling and on mobile so I can only offer general advice right now.&nbsp;
yeah I tried the queries, but I can't seem to find the right syntax, and also it asks for the additional damages even if the spell is casted at level 5 and not only when casted at higher levels (that was my conditional problem) Scriptcards is probably the right and easiest way to deal with that thing.&nbsp;
Hi.&nbsp; First timer here and let me say (as many others have) WOW! What an amazing treat this script is! I built one for synaptic shock before finding yours and was pleased to see that mine was almost identical to yours.&nbsp; My question is: Is there a way to have the macro roll and display on the card the d6 for the "muddled thoughts" for the creatures that fail their save?&nbsp; I tried doing something with the --damage formula2 line but I couldn't figure out how to make it not apply that d6 as damage.
1651269471
David M.
Pro
API Scripter
Hmm, that is a tricky one. I unfortunately can't think of a satisfying solution to that interpretation of the spell. The only rolls tied to each target are the saves and up to two damage rolls. :( FWIW, in my games we treat the d6 as a bane-like status effect that is rolled each time the affected target makes an attack roll or ability check, not something rolled when the spell is initially cast and never changes.
I actually like that way of doing it better. I can do a --condition fail and put a status marker on as a reminder. Perfect. Thanks a lot!
David M. said: Ah, the only way I can see that working is to have two separate queries, one in each damageformula. Or you could write a scriptcard that handles that logic with a single query and dynamically builds the smartaoe syntax during runtime. I am traveling and on mobile so I can only offer general advice right now.&nbsp; Could you help me on the syntax for a damage query ? I can't find the right way... Basically it's something like : Damage = (4d6 + (additional ? if yes &gt; (at what level -5)d6, if no &gt; 0)) but i can't sort myself out of the brackets, curly ones, etc.... :(
Hi David. I'm working on making a script for Stinking Cloud. I have --conditionPass|green and --conditionFail|red. Unfortunately when the creatures are in the area for even a second round, they often wind up with both green and red applied.&nbsp; Is there a way to make --conditionPass| apply a green while removing a red and vice versa for --conditionFail|?
Robert K. said: Hi David. I'm working on making a script for Stinking Cloud. I have --conditionPass|green and --conditionFail|red. Unfortunately when the creatures are in the area for even a second round, they often wind up with both green and red applied.&nbsp; Is there a way to make --conditionPass| apply a green while removing a red and vice versa for --conditionFail|? I'm also realizing that any spell that applies a condition on a failed save and which offers subsequent chances to save will apply a second marker if the save is failed a second time. If it were possible to have a line that said--conditionFail| (remove red), (apply red) would keep the tokens much cleaner throughout the combat. I don't know nearly enough to know if this is possible.
You could use another API called Tokenmod to clear any red and green status markers before calling smartaoe in your macro. example; !token-mod --set statusmarkers|-red|-green !smartaoe blah, blah, blah
Doug E. said: You could use another API called Tokenmod to clear any red and green status markers before calling smartaoe in your macro. example; !token-mod --set statusmarkers|-red|-green !smartaoe blah, blah, blah Hey Doug. Thanks for reaching out. I didn't realize that you could put multiple !Lines into one macro.&nbsp; But, wouldn't the "!token-mod..." line have to be embedded in the spell for it to run each time I hit the Trigger? Forgive my complete lack of intuition with all of this- I barely know what a computer is.
Oh, right! I guess I was thinking of the Trigger-All macro that comes with the example AOEControlToken sheet ability, which has the command; !smarttrigger Change my example from !smartaoe, etc to !smarttrigger and it should work. I haven't tested though.
1651497445
David M.
Pro
API Scripter
I think you would also need to use the --ids syntax for the token-mod command and pass the target token_id that is used by the !smarttrigger command. Make sure the "players can use ids" option is checked (true) for token-mod or this will fail.&nbsp;&nbsp;
Hi! Thanks for this great script. I have a couple of players that have thunderwave as one of their main go-to spells and was wondering if there a way that the tokens surrounding the caster can be automatically pushed 10ft away upon a failed constitution saving throw?