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

The character sheet does have a default token set, I've triple checked it. Here's the macro: !smartaoe {{   --title|Ice Storm   --leftsub|Slot level ?{Cast at what level?|4,4|5,5|6,6|7,7|8,8|9,9}   --rightsub|DC @{selected|spell_save_dc} DEX   --titlecardbackground|linear-gradient(blue, cyan)   --oddrowbackground|#00ccff   --evenrowbackground|#edfcfc   --oddrowfontcolor|#000000   --tablebgcolor|#edfcfc     --controlTokName|Ice Storm     --aoeColor|#00ccff50   --aoeOutlineColor|#0099ff   --aoeType|circle, float   --radius|20ft   --minGridArea|0.25   --minTokArea|0.25   --fx|burn-frost   --dc|@{selected|spell_save_dc}   --saveFormula|5eDEX   --damageFormula1|[[(?{Cast at what level?}-2)d8]]   --damageType1|Bludgeon   --damageFormula2|[[4d6]]   --damageType2|Cold   --ignore|SmartAoE_Ignore,1    --instant|1   --autoApply|0   --bar|1   --zeroHPmarker|dead   --desc|A hail of rock-hard ice pounds to the ground in a 20-foot-radius, 40-foot-high cylinder centered on a point within range. Each creature in the cylinder must make a Dexterity saving throw. A creature takes 2d8 bludgeoning damage and 4d6 cold damage on a failed save, or half as much damage on a successful one.%br%%br%Hailstones turn the storm's area of effect into difficult terrain until the end of your next turn. }}
1660130225
David M.
Pro
API Scripter
I tried your macro and it worked fine for me once I set up the "Ice Storm" character sheet and default token properly. You say you uploaded the image to your personal library. Was this originally a marketplace purchase? If so, are you sure the default token is using that version of the image, and not the marketplace version? They will have different URLs, and the marketplace version would give you the error message you described.
Can someone help me figure out how to apply the "evil creatures have disadvantage on the save?" I assume I can look if npc_Type contains evil, but I can't figure out how to apply that. !smartaoe {{   --title|Trumpet of Sparkles   --leftsub|30 ft. Cone   --rightsub|DC 14 CON   --aoeColor|#88888850   --aoeOutlineColor|#ffffff   --aoeType|5econe   --forceIntersection|0   --radius|30ft   --origin|nearest, face   --minGridArea|0.25   --minTokArea|0.25   --fx|burn-smoke   --dc|14   --saveFormula|5eCON   --damageFormula1|[[4d8+4]]   --damageType1|Radiant   --ignore|SmartAOE_ignore,1    --instant|1   --autoApply|1   --bar|1   --zeroHPmarker|dead   --desc|Lulu blows air through her trunk, creating a trumpet sound that can be heard out to a range of 600 feet. The trumpet also creates a 30-foot cone of energy with the following effect: %br%%br%Creatures in the cone must make a DC 14 Constitution saving throw, taking 4d8 + 4 radiant damage on a failed save, or half as much damage on a successful one. Evil creatures have disadvantage on the saving throw. Good creatures in the cone take no damage. }}
I am trying to set up an Ice Knife spell with smart aoe and script cards with script cards handling the ranged spell attack and then smart aoe to do the burst. I am pretty new to all of this and have basically been using the premade scripts found here and in GitHub to mash together what I've needed but this one has me stumped, is it even possible?
1661989384
David M.
Pro
API Scripter
@JeepDave:   There is currently not a good way for "some" targets to be at adv/disadv and others not (except for the built-in adv if they have magic resistance on the 5e sheet). Right now it is otherwise an "all or nothing" thing for adv/disadv. The part about good creatures not taking damage can be done using the following,  since there are not other effects except damage for this item/spell. --ignore|npc_type;good You could also give everyone disadv using the following --saveFormula|<<2d20kl1 + a{constitution_save_bonus}>>    ...and ignore good creatures with the --ignore line above, but that's  unfortunately  as close as it could currently get.
1661989783
David M.
Pro
API Scripter
@Leonard: Try something like this?  Script dependencies: Scriptcards, SmartAOE, SelectManager Due to a Roll20 bug that confuses the api if both selected and targeted tokens are sent to a mod, we need to use SelectManager (the "forselected" parts below) and explicitly tell the api what token to select. See the first line below. I did it for a token named "Trix" - you will want to replace that appropriately. I omitted the attack roll portion of this scriptcard, as this is pretty standard. Note the macro below determines the size of the targeted token and uses that to calculate the AoE radius and the appropriate "forceIntersection" state.   !forselected script {& select Trix } {{ --#sourcetoken|@{selected|token_id} --#targettoken|@{target|token_id} --+All of your attack roll logic goes here| removed for this example --/SmartAoE dynamic syntax| --&dc|[*S:spell_save_dc] --=size|[*T:t-width]/70 --=radius|[$size] + 2 * 5 / 2 --=sizeIsOdd|[$size] % 2 --?[$sizeIsOdd] -eq 1|=forceToggle;0|=forceToggle;1 --/Here's where we actually call SmartAoE (via SelectManager)| --@forselected(^)| smartaoe _title|Ice Knife _leftsub|Slot level ?{Cast at what level?|1|2|3|4|5|6|7|8|9} _rightsub|DC [&dc] DEX _titlecardbackground|linear-gradient(blue, cyan) _oddrowbackground|#00ccff _evenrowbackground|#edfcfc _oddrowfontcolor|#000000 _tablebgcolor|#edfcfc _aoecolor|#00ffff50 _aoeoutlinecolor|#0000ff _aoeType|square, float _forceIntersection|[$forceToggle] _radius|[$radius.Raw]ft _fx|burn-frost _dc|[&dc] _saveFormula|5eDEX _damageFormula1|[^[(?{Cast at what level?}+1)d6]^] _damageType1|cold _instant|1 _autoApply|1 }}
@David M: That did the trick, thanks!
Is it possible to have this script show who gets effected by the aoe when triggered but not roll saves and damage ?
1662093652
David M.
Pro
API Scripter
@PearWithMe: Are you saying you have an effect that automatically imposes some sort of condition but deals no damage? If so, this example shows how to do that. --noSave will actually force the rolls to be a 0 and the DC to 99999, then just enter 0 for --damageFormula1 and apply a --conditionFail to add a statusmarker of your choice.  !smartaoe {{   --title|Auto statusmarker example   --aoeType|square, float   --radius|10ft   --noSave|1   --conditionFail|red   --instant|1   --autoApply|1 }} I could be misunderstanding your question, though. 
Thanks for the response David. This is close, I want to be able to as a player have something like dragons breath that does the aoe and rolls damage generally, but doesnt roll saves for people in the area while still showing who is effected. The method you showed is close, I can not have it roll saves so I as a player don’t see npc saves but it still could apply damage if I hit the fail button. I want it to just list who’s hit if possible in the card and show the damage rolls for the spell generally. 
1662241350

Edited 1662241438
David M.
Pro
API Scripter
Got it. If you don't mind ignoring the parts of the output with a false save roll of "0" and a "F" saving throw result, then you could do something like this. Edit -  changes vs previous version are autoApply set to 0, no conditionFail, and added damageFormula1 back in !smartaoe {{ --title|Damage roll and targeting only --aoeType|square, float --radius|10ft --noSave|1 --damageFormula1|[[1d6]] --instant|1 --autoApply|0 }}
Cool, that should work. Thanks!
1662978984

Edited 1662979098
Really cool script! Definitely gonna be a game changer for the spellcasters in my campaign! One question though. Is it possible to hide the "Roll" part of the displayed table, so players don't know what a creature rolled (and therefore its modifier)? My players has asked me to give them as little information as possible and in order to respect that, I need to hide creature modifiers :) Edit: I tried using "--hidenames|1", but the creatures image is still displayed, meaning that in fights with different monsters, particularly one where there's a "boss", they instantly know who's who.
1662981797
David M.
Pro
API Scripter
GM-only output is going to be in the next release, though I can also look into an option to mask some fields that would give away information (like save/damage totals and the immunity/resistance/vulnerability superscript). Right now, the only way to accomplish this would be to temporarily move the target creatures to the GM layer before the player triggers the effect, which is obviously not an ideal situation. 
1663348302

Edited 1663348380
Is there a way for --conditionFail` to accept a random roll as duration? --conditionFail|CondNauseated::5348140@[[d4+1]] works, in a way, but it looks like the d4+1 is rolled once and then applied every time. A syntax similar to the one from `--saveformula ` does not work. (This is for a PF1 stinking cloud, as you might have guessed.)
1663352774
David M.
Pro
API Scripter
What you are describing makes sense, since the inline roll gets expanded by the chat parser before it is sent to the script, so they will all get the same value. The script doesn't handle what you are asking out of the box. What you could do is have SmartAoE just apply the statusmarker without any number on conditionFail, then select the tokens that just gained the marker and run the following scriptcard macro, which rolls the 1d4+1 individually for each selected token and will replace the custom statusmarker with the rolled number. I'm sure there's probably a more concise macro possible using token-mod and one of timmaugh's meta-scripts (like SelectManager with deferral characters), but I'm prepping for my upcoming game and had the scriptcard functions handy :)  !script {{ --#hidecard|1 --~token|getselected --%i|1;[&tokenCount] --=roll|1d4+1 -->ADD_STATUS_MARKER|[*[&token[&i]]:t-id];CondNauseated::5348140;[$roll.Raw] --%| --X| End Macro --:FUNCTIONS| --:ADD_STATUS_MARKER|Token_ID;Status Marker;Count -->REMOVE_STATUS_MARKER|[%1%];[%2%] --~|array;statusmarkers;Conditions;[%1%] --&toAdd|[%2%] --?"[%2%]" -ne "dead" -and "X[%3%]" -ne "X" -and "X[%3%]" -ne "X0"|=countToAdd;[%3%] {MIN:0} {MAX:9} --?"[%2%]" -ne "dead" -and "X[%3%]" -ne "X" -and "X[%3%]" -ne "X0"|&toAdd;[%2%]@[$countToAdd.Raw] --~|array;add;Conditions;[&toAdd] --~newConditions|array;stringify;Conditions --#parameterdelimiter|$ --~newConditions|string$replaceall$;$,$[&newConditions] --#parameterdelimiter|; --?"[&newConditions(0,1)]" -eq ","|&newConditions;[&newConditions(1)] --!t:[%1%]|statusmarkers:[&newConditions] --:DONE_ADD_STATUS_MARKER| --<| --:REMOVE_STATUS_MARKER|Token_ID;Status Marker -->CHECK_STATUS_MARKER|[%1%];[%2%];MarkerExists;MarkerCounter --?[&MarkerExists] -eq 0|< --~|array;statusmarkers;Conditions;[%1%] --?[&MarkerCounter] -eq 0|&toCheckFor;[%2%]|&toCheckFor;[%2%]@[&MarkerCounter] --~hasCondition|array;indexof;Conditions;[&toCheckFor] --?[&hasCondition] -eq "ArrayError"|DONE_REMOVE_STATUS_MARKER --~|array;remove;Conditions;[&toCheckFor] --~newConditions|array;stringify;Conditions --#parameterdelimiter|$ --~newConditions|string$replaceall$;$,$[&newConditions] --#parameterdelimiter|; --!t:[%1%]|statusmarkers: [&newConditions] --:DONE_REMOVE_STATUS_MARKER| --<| --:CHECK_STATUS_MARKER|TokenID;MarkerToFind;Exists;Counter --~|array;statusmarkers;Conditions;[%1%] --&FoundMarker|-1 --%loop|0;[@Conditions(maxindex)] --&Temp|[@Conditions([&loop])] --?[&Temp(indexof,[%2%])] -eq 0|&FoundMarker;[&loop] --%| --?[&FoundMarker] -ne -1|FOUND_STATUS_MARKER --&[%3%]|0 --&[%4%]|0 --<| --:FOUND_STATUS_MARKER| --&[%3%]|1 --&[%4%]|0 --&ThisMarker|[@Conditions([&FoundMarker])] --?[&ThisMarker(contains,@)] -eq 0|< --~[%4%]|string;after;@;[@Conditions([&FoundMarker])] --<| }}
That's useful. Thanks!
Hi Dave Its been awhile since I've needed your help, but here I am again. I've recently started a new game using the same PC's and mostly the same API's and macros.  Going from Wildmount to Call of the Netherdeep.  Everything that effects multiple targets seems to work. However some others work in the old game but only partially work in the new game. Guiding bolt for example goes off and the card comes up correctly but it will not apply damage. The same macro in the old game does everything including apply damage ?????
1663930677

Edited 1663930743
David M.
Pro
API Scripter
Is it for sure the same exact macro (including an --autoApply|1 line)? Assuming it is not a copy/paste error, can you post the problem macro you're using?  Does it work on a different target and/or caster token in the problem game, or perhaps on a different map?  Guiding bolt - so you are using the attack roll workaround where the dc is set to target AC is and the saveFormula is the caster token spell attack roll. I'd check that the attributes your are comparing against are actually populated correctly in the character sheets. Particularly the AC, as I've seen many reports of disappearing ACs on npc tokens. EDIT - re-read your post and saw that the "card comes up correctly", so my last paragraph is probably not relevant.
Included copies of cards. Working macro from original game !smartaoe {{ &nbsp; --title|Guiding Bolt &nbsp; --leftsub|Slot level ?{Cast at what level?|1|2|3|4|5|6|7|8|9} &nbsp; --rightsub|No Save &nbsp; --titlecardbackground|linear-gradient(gold, yellow) &nbsp;&nbsp; &nbsp; --oddrowbackground|#00ccff &nbsp; --evenrowbackground|#edfcfc &nbsp; --oddrowfontcolor|#000000 &nbsp; --tablebgcolor|#edfcfc &nbsp;&nbsp; &nbsp; --controlTokName|AoEControlToken &nbsp; --controlTokSize|1 &nbsp;&nbsp; &nbsp; --aoeColor|#00ccff50 &nbsp; --aoeOutlineColor|#0099ff &nbsp; --aoeType|circle, float &nbsp; --radius|2ft &nbsp; --minGridArea|0.25 &nbsp; --minTokArea|0.25 &nbsp;&nbsp; &nbsp; --fx|burst-holy &nbsp; --noSave|1 &nbsp;&nbsp; &nbsp; --damageFormula1|[[(?{Cast at what level?}+3)d6]] &nbsp; --damageType1|Holy &nbsp; --instant|1 &nbsp;&nbsp; &nbsp; --autoApply|yes &nbsp; --bar|1 &nbsp; --zeroHPmarker|dead &nbsp;&nbsp; &nbsp; --desc| A flash of light streaks toward a creature of your choice within range. Make a ranged spell attack against the target. On a hit, the target takes 4d6 radiant damage, and the next attack roll made against this target before the end of your next turn has advantage, thanks to the mystical dim light glittering on the target until then.%br%%br% At Higher LevelsWhen you cast this spell using a spell slot of 2nd level or higher, the damage increases by 1d6 for each slot level above 1st. }} SmartAoE: Guiding Bolt Slot level 1 ♦ No Save Dmg: <span class="userscript-showtip userscript-tipsy" title="Rolling (1+3)d6 = ( 3 + 6 + 3 + 6 )" style="box-sizing: content-box; min-width: 1em; display: inline-block; color: rgb(0, 0, 0); font-size: 1.2em; padding: 0px 3px; vertical-align: middle; background-color: rgb(254, 246, 142); cursor: help; border: 2px solid rgb(63, 179, 21);">18 Holy Target Roll P/F? Dam. Skeleton 0 F 18 A flash of light streaks toward a creature of your choice within range. Make a ranged spell attack against the target. On a hit, the target takes 4d6 radiant damage, and the next attack roll made against this target before the end of your next turn has advantage, thanks to the mystical dim light glittering on the target until then. At Higher LevelsWhen you cast this spell using a spell slot of 2nd level or higher, the damage increases by 1d6 for each slot level above 1st. Non-working macro from new game !smartaoe {{ &nbsp; --title|Guiding Bolt &nbsp; --leftsub|Slot level ?{Cast at what level?|1|2|3|4|5|6|7|8|9} &nbsp; --rightsub|No Save &nbsp; --titlecardbackground|linear-gradient(gold, yellow) &nbsp;&nbsp; &nbsp; --oddrowbackground|#00ccff &nbsp; --evenrowbackground|#edfcfc &nbsp; --oddrowfontcolor|#000000 &nbsp; --tablebgcolor|#edfcfc &nbsp;&nbsp; &nbsp; --controlTokName|AoEControlToken &nbsp; --controlTokSize|1 &nbsp;&nbsp; &nbsp; --aoeColor|#00ccff50 &nbsp; --aoeOutlineColor|#0099ff &nbsp; --aoeType|circle, float &nbsp; --radius|2ft &nbsp; --minGridArea|0.25 &nbsp; --minTokArea|0.25 &nbsp;&nbsp; &nbsp; --fx|burst-holy &nbsp; --noSave|1 &nbsp;&nbsp; &nbsp; --damageFormula1|[[(?{Cast at what level?}+3)d6]] &nbsp; --damageType1|Holy &nbsp; --instant|1 &nbsp;&nbsp; &nbsp; --autoApply|1 &nbsp; --bar|1 &nbsp; --zeroHPmarker|dead &nbsp;&nbsp; &nbsp; --desc| A flash of light streaks toward a creature of your choice within range. Make a ranged spell attack against the target. On a hit, the target takes 4d6 radiant damage, and the next attack roll made against this target before the end of your next turn has advantage, thanks to the mystical dim light glittering on the target until then.%br%%br% At Higher LevelsWhen you cast this spell using a spell slot of 2nd level or higher, the damage increases by 1d6 for each slot level above 1st. }} Guiding Bolt Slot level 1 ♦ No Save Dmg: <span class="userscript-showtip userscript-tipsy" title="Rolling (1+3)d6 = ( 1 + 5 + 4 + 1 )" style="box-sizing: content-box; min-width: 1em; display: inline-block; color: rgb(0, 0, 0); font-size: 1.2em; padding: 0px 3px; vertical-align: middle; background-color: rgb(254, 246, 142); cursor: help; border: 2px solid rgb(179, 21, 21);">11 Holy A flash of light streaks toward a creature of your choice within range. Make a ranged spell attack against the target. On a hit, the target takes 4d6 radiant damage, and the next attack roll made against this target before the end of your next turn has advantage, thanks to the mystical dim light glittering on the target until then. At Higher LevelsWhen you cast this spell using a spell slot of 2nd level or higher, the damage increases by 1d6 for each slot level above 1st.
1663952765
David M.
Pro
API Scripter
The only difference between those two macros is --autoApply|yes vs&nbsp; --autoApply|1, but both should be ok to use.&nbsp; Try increasing your radius to 2.5ft. When I used radius 2ft in my test game, no grid square was highlighted (and no tokens can be "in" a non-existent highlighted area).&nbsp; Radii smaller than 1/2 of a single grid width can give funky results like that, due to some other reasons and assumptions the script is making.&nbsp; Is it possible your other game was using a different map scale, so the 2ft radius was covering more grid area? Note that the way you have it set up, the spell may not correctly target a creature of size 3x3 or larger, due to the small AoE and the --mintokarea requirement of at least 25%. Also, you aren't rolling an attack like the spell description states. Homebrew, maybe? Or you are rolling outside of the script and then using the script to apply damage? There are less clicky ways to do that. I actually don't use the script for single target spells/attacks due to the higher overhead. Scriptcards is a great tool for automating single target attacks, btw.
That worked thanks
Just for information sake: when is the next release with GM-only output going to be (if you know)? I'm really tired of my players finding out which creatures are immune to their spells, the names of creatures they shouldn't know yet, and other information being given them through use of the SmartAOE spell scripts. :-) David M. said: GM-only output is going to be in the next release, though I can also look into an option to mask some fields that would give away information (like save/damage totals and the immunity/resistance/vulnerability superscript). Right now, the only way to accomplish this would be to temporarily move the target creatures to the GM layer before the player triggers the effect, which is obviously not an ideal situation.&nbsp;
1664105250

Edited 1664109432
Another question. In PF1 there are spells like "Black Tentacles", which are AoE, but the enemies in the area do not get a save. Instead the spell attacks them. Is something like that possible? Basically, each round the spell would roll its attack (CMB in this case) once and compare it to the defense (CMD) of each creature in the area of effect. Edit: With Black Tentacles, the CMB is effectively caster level +5. d20+CMB is compared to the creature's CMDs. What I did now is this: --dc|[[@{caster1_level}+15]] --saveFormula|&lt;&lt;1d20 + a{cmd_mod}-11&gt;&gt; This makes it so the creatures roll their CMD-11 vs the attackers CMB+10. Which should statistically yield the same results. But I know my players will be confused by this. 😀
1664109165

Edited 1664109174
Also—and I may be doing something wrong here—it seems to me that SmartAoE can apply the same token marker multiple times. Is this intentional? I mean, I can not really see a case where I would want that. Not for PF1 or 5e at least. Don't think there are too many stackable conditions.
1664119884

Edited 1664119907
timmaugh
Pro
API Scripter
David will have to answer for the SmartAoE script, specifically, and any way to limit multiple instances of the same token marker if that's what you want... but as for the general ability to add multiple instances, I think there are lots of ways to think about token markers besides just specific conditions for the token... especially with the new version of Fetch able to return all kinds of data about the markers to your command line in real-time. You could use a particular marker as a stand-alone magical defense, or spell-duration... and use two copies of it to get a value of 0 to 99 (could be defense or rounds, etc.). I'm sure David has a way to suppress the behavior for an individual implementation, but I would like to keep the option available generally, since it opens up a ton of creative flexibility in how you approach some problem of storing/reporting some data.
Yeh, there might be use cases for multiple instances of the same token marker. But if it's possible to limit it to only one instance via a parameter, that would be very useful, too.
1664146953

Edited 1664147067
David M.
Pro
API Scripter
Saul J. said: Just for information sake: when is the next release with GM-only output going to be (if you know)? I'm really tired of my players finding out which creatures are immune to their spells, the names of creatures they shouldn't know yet, and other information being given them through use of the SmartAOE spell scripts. :-) I hope to have something out within a couple days, though I live in west central FL and we are about to get hammered by a hurricane (or tropical storm, fingers crossed). I had several new features planned, but I will scale this back to try to get something out sooner, as it's likely we will lose power for several days.&nbsp; Note: at least for the names of creatures, you can currently use the --hideNames|1 switch to change the displayed names to "Target_1", "Target_2" etc.
Hello. &nbsp;Not sure if I’ve missed it somewhere. &nbsp;But I’m using the smart aoe and I can not get the color of the trigger fx &nbsp;to change to green( for acid). It does let me change it to - - fx|burn-fire to do red and - -fx|burn-frost for the blue/cyan but will not let me do a green. &nbsp;Any help or advice&nbsp;
1664212518
David M.
Pro
API Scripter
"burn-acid" should work
1664306218

Edited 1664306539
David M.
Pro
API Scripter
Version Update v0.26 - found&nbsp; here &nbsp;(Note Manual install required for this development version) (1) Whisper options :&nbsp; Added a couple different options. The first option whispers the entire chat card, while the second prints the Title, base damage, and description but whispers the saving throw results and damage application to the GM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Syntax: --whisperAll|&lt;true/yes/1/false/no/0&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// whispers all output --whisperResults|&lt;true/yes/1/false/no/0&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// whispers only the saving throw lines and damage messages to GM (2) SoundFX : You can now play tracks from your jukebox when you spawn, move, trigger, and/or delete the control token. Note that if you have multiple conditions (ex. spawn and move sounds), you must wait for the current jukebox track to finish playing before triggering the next. Otherwise, all sound triggers will be ignored if they occur while a jukebox track is currently playing &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Syntax: --spawnSound|&lt;trackName&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//track that plays when controlTok is spawned --moveSound|&lt;trackName&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//track that plays when controlTok is moved --triggerSound|&lt;trackName&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//track that plays when controlTok is triggered --deleteSound|&lt;trackName&gt;&nbsp;&nbsp;&nbsp;&nbsp; //track that plays when controlTok is deleted (3) Automatic TurnOrder entries : You can now populate a custom turnorder entry when the control token is spawned, so you can more easily track durations, etc. You must specify a name, and then a current value, a formula, and a switch to determine if the entry is tied to the control token are optional. If tied to the control token, then the entry will be deleted when the control token is deleted. Otherwise you will have to delete the entry manually. The default behavior is to link to the control token. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Syntax: --turnOrder|&lt;name&gt;,&lt;optional value&gt;,&lt;optional formula&gt;,&lt;optional true/yes/1/false/no/0&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Examples: --turnorder|Stinking Cloud,0,+1 //current value 0, adds 1 every turn, default condition in effect to link entry to controlTok --turnorder|Stinking Cloud,0,1, true //same as above, note the plus sign is not necessary, and this time we are explicitly linking to the controlTok --turnorder|Hold Person,10,-1, false //current value 10, subtracts 1 every turn, entry not linked to controlTok (4) Tooltips for your control Tokens : You can now add a token tooltip to your control tokens. Useful if you have multiple persistent AoEs present, mousing over the controlTok will display the tooltip &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; Syntax: --tooltip|&lt;text&gt;
Is there a way to have two damage types but only apply half damage to one of them on a successful save? Using Ice Knife as an example, it has two damage types, and only the second damage type is subjected to the saving throw.
1665581172

Edited 1665581232
David M.
Pro
API Scripter
Hmm, I can't think of a way to do this fully with SmartAoE. Ice Knife is weird because it's both an attack roll and a save. I would probably do the attack roll separately and then spawn the AoE control token to handle the secondary effect. I suppose you could also use scriptcards to help automate this. Doing the attack with scriptcards and calling SmartAoE automatically.
1665841351

Edited 1665841668
@David M.&nbsp; This may be a repeat but I keep getting the following message when using the sample EDIT Forum Spirit Guardians spell.&nbsp; (Interestingly, the macro does seem to work though.) "Error &nbsp; &nbsp; at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:172:1), &lt;anonymous&gt;:637:11) &nbsp; &nbsp; at String.replace (&lt;anonymous&gt;) &nbsp; &nbsp; at Object.d20.textchat.doChatInput (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:172:1), &lt;anonymous&gt;:549:29) &nbsp; &nbsp; at sendChat (/home/node/d20-api-server/api.js:1897:16) &nbsp; &nbsp; at apiscript.js:16443:7 &nbsp; &nbsp; at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:168:1), &lt;anonymous&gt;:65:16) &nbsp; &nbsp; at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:168:1), &lt;anonymous&gt;:70:8) &nbsp; &nbsp; at TrackedObj.set (/home/node/d20-api-server/api.js:1086:14) &nbsp; &nbsp; at updateLocalCache (/home/node/d20-api-server/api.js:1421:18) &nbsp; &nbsp; at /home/node/d20-api-server/api.js:1607:11" EDIT I get an infinite loop error when using the sample from Github.
1665853887
David M.
Pro
API Scripter
Not sure exactly what's going on here, but looks like another script (or internal Roll20 process) is throwing the error. SmartAoE doesn't have a function named "updateLocalCache" nor a "TrackedObj" object. Those sounded familiar, though, and I checked a Discord discussion I had with some folks a couple weeks ago: the PingBuddy script was causing a similar (but not exactly identical) error even though TrackedObj &amp; updateLocalCache didn't appear in that script, either. The issue arose in that case when a token existed on the map that represented a deleted character. PingBuddy has been updated since then, though, which eliminated that error for that script at least. Maybe you have an older version of it?&nbsp; Or perhaps SmartAoE is triggering a similar error for the same reasons (related to tokens representing deleted characters)? Does the error pop up if you target different tokens within the AoE? Ones that come from a clean compendium drop, say? Finally, I'm stuck at work all weekend so my ability to troubleshoot this further is going to be severely hampered.
I'm having a problem where macros that use "--controlTokName|GenericSpellAoE" have stopped working.&nbsp; &nbsp;GenericSpellAoE has a default token that is a rollable table. Since my session last week, (where it worked),&nbsp; I have&nbsp; been testing a new macro using it and couldn't get it to work.&nbsp; So I went back to test the macros on other character sheets and they don't work any longer either. The control token simply doesn't spawn and on the mod output console I get the message " ERROR: You must specify a valid layer to create this object type ." I tried making a new token from a new table, and updating the default to token to that, but no luck.&nbsp; &nbsp;If I take the "--controlTokName" line out, so it uses the standard control token, the macros all work again.&nbsp; But my fireball looks less cool with a giant crosshairs than it did with an actual fireball. One think I've noticed is that roll20 has changed how default tokens are set, there are now a new new buttons under the default token when editing the character sheet, and an "update token" button.&nbsp; &nbsp;Did something change about the token API that has broken this?&nbsp; Is my token not storing the fact that it should be on the objects layer? Other things I have tried or contemplated: * I have moved a token to other layers and then back to the object layer, and then clicked the "use selected token" button. * I have changed layers and then removed the default token before clicking the "use selected token" button. * I have made a new table with nothing in it but the image of the default token for each entry, and made it the default. * I have NOT made a new character sheet for the control token. * I have NOT manually updated to v0.26 * I have successfully summoned the token with the !spawn script, it works just fine that way.
1666264083
David M.
Pro
API Scripter
Not sure what is going on here. I am still able to spawn a custom multi-sided control token in my test game (using the Ice Storm example from the wiki). That error message is not something that I wrote. Looks like a Roll20 message. Not sure if the "problem" token is the one you are trying to spawn or the "caster" token. Though since !Spawn worked this is really weird. They use pretty much the same code for spawning. When you !Spawned, were you using the same selected token? Possible things to try: Try the same macro on another map Try the macro with a different "caster" token Try in a different game If none of these gives any more clues, if you invite me to your game via PM and promote me to GM I could try to take a look at it this evening (I'm US Eastern).
I manually updated and have the same issue as well
1666276133
David M.
Pro
API Scripter
Can one of you share the macro(s) you are seeing the issue with? I will try to replicate using that exact syntax in case it is related.&nbsp; Off is still on the table for either of you for me to poke around with an invite.
I sent you a pm with a game link.&nbsp; An example of a macro doing this is below.&nbsp; &nbsp;Once I remove the "controlTokName" line, it works with the default crosshairs.&nbsp; The only different between this and the one in the git repo is I hardcoded max spell level to match the warlock casting it. I'll try this in a fresh game and report back. //**************************************************************************************************************************** //&nbsp; 5e Fireball //&nbsp; &nbsp; &nbsp; Author: FR //&nbsp; &nbsp; &nbsp; Prereq's: SmartAoE script //&nbsp; &nbsp; &nbsp; Notes: I use a custom rollable table token "character" for the --controlTokName called GenericSpellAoE, set to image side 5, size 8. //&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Either delete these three lines, or substitute for your own&nbsp; // //&nbsp; Spell level is hardcoded.&nbsp; Update macro when warlock minimum level goes up //**************************************************************************************************************************** !smartaoe {{ &nbsp; --title|Fireball &nbsp; --leftsub|Slot level 4 &nbsp; --rightsub|DC @{selected|spell_save_dc} DEX&nbsp; &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|[[9d6]] &nbsp; --damageType1|Fire &nbsp; --ignore|SmartAoE_Ignore,1&nbsp; &nbsp; --autoApply|1 &nbsp; --bar|1 &nbsp; --zeroHPmarker|dead &nbsp; --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. }}
Update:&nbsp; I made a blank game with only the smartaoe script added.&nbsp; I used the transmogrifier to copy over the user, the genericspellAoE character, and the table used to make the token.&nbsp; After confirming the problem still happens, I started from scratch in that blank game.&nbsp; I made a new character to cast the spell, made a new table that had two png images images in it, made a new token from that table, made a new control token character to attach the token and trigger scripts to, and then updated the macro to point to the new token.&nbsp; Still doesn't work, but it throws a new error in the api console window!&nbsp; "SmartAoE v0.25 initialized." "Roll20 Environment: Web" "ERROR: You must specify a valid layer to create this object type." {"who":"error","type":"error","content":"Unable to find a player or character with name: mkanoapUnhandled"} {"who":"error","type":"error","content":"Unable to find a player or character with name: mkanoapUnhandled"} "ERROR: You must specify a valid layer to create this object type." {"who":"error","type":"error","content":"Unable to find a player or character with name: mkanoapUnhandled"}
1666293733
David M.
Pro
API Scripter
Frustrating! FYI your macro works for me exactly as written so something is funky. I joined your game, so promote me when you get a chance and I can take a look at it later today / tonight.
1666309136
David M.
Pro
API Scripter
Ok, looks like Roll20 changed the number of token properties saved in the default token JSON without telling anybody. Prior behavior had the layer property stored with the default token but now it's gone.&nbsp; !Spawn continued to work because that script explicitly assigns the layer. I'll need to implement that for SmartAoE as well.
Thank you for the quick response!&nbsp; &nbsp;Right before I noticed that it was not working I had added a new image to the token, so maybe tokens created before the change still have the property, so it only affects new or changed tokens. If so, it works when using the default control token because that token predates the change and I had not touched it.
1666320167
David M.
Pro
API Scripter
Yep, that's why it was working for me when I tested your macro. My tokens pre-dated the change. When I created new ones I started to see the error on my end as well.
1666320513
David M.
Pro
API Scripter
Version Update v0.27 - found&nbsp; here &nbsp;(Note Manual install required for this development version) Now explicitly sets the controlTok to object layer prior to spawning. A recent change to how Roll20 saves the default token JSON was causing an error. Default tokens created after this change no longer have a "layer" property in the token JSON. Previously created default tokens still functioned as normal prior to this fix, but newly created default tokens errored out.&nbsp;
Hey David, love your API but I can't seem to figure out to make a cone up to 150 without extending the icon to the edge of the screen. Is there a way to bypass that?
1666612755

Edited 1666612765
David M.
Pro
API Scripter
Joel, very large AoE's (especially cones) can sometimes get a little squirrely, depending on the size of your map and sometimes the direction of the cone. A couple questions for you: Is the behavior that you are seeing that you move the control token somewhere and no AoE highlighting shows up? Do you have the 1-click install (v25) or one of the newer manual installs? There was a minor unreported change (typo correction) in the newer versions that could possibly help out here depending on the aspect ratio of your map and direction of your cone What size is your map? If you increase the map size considerably, does it suddenly start working? I would go at least 1.5x the size of your cone in both dimensions as a starting point. If still fails, keep bumping up until it works for all cone directions. A little background: In order to align the highlighted squares and allow grid snapping, I first create a lookup of grid centers. The size of this lookup table is larger than the current VTT map (because sometimes AoE's may extend off the map), but is still based on the map dimensions. The issue stems from me trying to limit the size of the lookup table to prevent massive lag every time the control token is moved (even for small AoE's). But, if you have a very large cone relative to your map size, potential cone points could extend past the limits of the lookup and cause a silent failure.&nbsp; 5e cones are weird, as they are actually triangles whose max cone width equals the length of the center line (the "radius"). This makes the length of the cone sides longer than the radius, as shown in the figure below. You may find your map size works fine until you point the cone at "diagonal" directions, due to the extra "z" distance shown below. For a 150ft cone, that z length is a bit over 35.4ft! &nbsp; If making your VTT map bigger fixes the issue, you can still keep your map graphic the same size and just block out two sides of the perimeter of the graphic with dynamic lighting lines so there isn't an awkward transition to map background color. If this doesn't solve it, let me know and we can troubleshoot further.
1666624477

Edited 1666625186
I really love the new features.&nbsp; &nbsp;I've updated most of my macros to make sounds, put custom events on the turn tracker, and to whisper the results to the GM, so I'm using them all. I noticed some behavior that surprised me, and I don't know if it's new, or if I just never noticed it before, and I'm curious if it is the intended behavior. When Triggering an effect with !smarttrigger, hovering over the damage roll shows "Rolling &lt;result&gt; = &lt;result&gt;" instead of the dice actually rolled.&nbsp;&nbsp; Furthermore, when the effect is triggered again (like for moonbeam), the result is always the same.&nbsp; &nbsp;If the initial roll was 2d10= 1+1, it will do 2 points of damage each time smarttrigger is called instead of re-rolling.&nbsp; Am I just defining the damage incorrectly, missing some brackets or html entities?&nbsp; I'm defining the damage as: &nbsp;--damageFormula1|[[?{Cast at what level?}d10]]
1666627994
David M.
Pro
API Scripter
mkanoap, that's not the behavior I'm seeing? I temporarily replaced the DamageFormula1 in my Cloudkill macro with your formula and got different results each time I triggered it, and the tooltip showed the die rolls correctly. Can you post your entire macro for me to test? Optionally, I hadn't left your game yet in case there were some follow-up issues with the one-off I temp installed there when troubleshooting your other issue. I could look at it directly there if you want to PM me details of where to look.