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

1688482267

Edited 1688482947
I too am seeing TypeError: Cannot read properties of undefined (reading 'get') but only with a campaign I setup with 150 ppi, and only with the PF cones. I reloaded an older campaign with a 70 ppi grid and everything just works. In the 150 ppi campaign, if I use a 5e cone, it doesn't hit the error, but the grid is misaligned. Unfortunately, I've got dozens of maps in this campaign, so probably will leave it for now. I like the higher resolution but it has other side effects, like the name plate is so small it's unreadable and the door icons are tiny (which I actually like as you can see the doors on the map). These are from Dungeon Alchemist, so it only supports 72, 150 and 300, but I imagine using 72 the offset would not be as bad. I would simply resize the maps to 70, except then I can't use the vtt export for walls and lighting (although, lighting placement is not correct in the export). I was messing around with converting the json coordinates, but it's a lot of work. For now, I can just move the AOE drawings once placed, but would love to come up with a long term solution. I did some further testing and none of the squares or circles I tried worked, issuing the same error, but after one restart of the sandbox, I did get a 40ft PF circle to work, but only once. It seems to work for some positions on the map, but not others, so it's definitely getting confused trying to do the grid calculation.
1688491704
David M.
Pro
API Scripter
What do you mean by setting up with 150ppi? The resolution of the map images shouldn't have any effect. How is your grid set up on the page? Do you have a whole number for the Cell Width page property? For the offset grid example (your screenshot), does it work on another page? Sometimes it seems like the grid coordinates get corrupted on certain pages.
That's a red herring. I can reproduce this in a 70 ppi map. Just select a token and run !smartaoe {{ --aoeType | square, float }}
1688495022

Edited 1688495354
David M. said: What do you mean by setting up with 150ppi? The resolution of the map images shouldn't have any effect. How is your grid set up on the page? Do you have a whole number for the Cell Width page property? If you want to use a different image resolution than 70 ppi, you have to change your page or game settings. If I set the "Scale->px to 150, it gives me a Cell Width of 2.142... Really backward how that was implemented, so instead of a 31x19 map, it is 66.42857 x 40.71428, but the grid is correct (lines up with the source image exported at 150 ppi and the walls on the dynamic lighting layer line up). While it appears to work better on a 70ppi map, it still encounters this error with 70 ppi if you try a simple, variable cube. For the offset grid example (your screenshot), does it work on another page? Sometimes it seems like the grid coordinates get corrupted on certain pages. I have seen this work on other pages, if it doesn't encounter the TypeError. It's not too difficult to move the drawing. The TypeError is a bigger concern, as that errors and doesn't produce an AoE. I was messing around with a 15' cube and that seems to work pretty well. !smartaoe {{   --aoeType | square, float   --radius | 7.5ft,   --forceIntersection | 0 }} I cloned the project to take a look, but the script names in the error are not in the project. TypeError: Cannot read properties of undefined (reading 'x')     at getSquareLocations (apiscript.js:3135:75)     at getPathLocations (apiscript.js:3850:36)     at updateMapWithAoE (apiscript.js:3974:33)     at smartAoE_handleTokenChange (apiscript.js:4159:13)     at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:168:1), <anonymous>:65:16)     at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:168:1), <anonymous>:70:8)     at TrackedObj.set (/home/node/d20-api-server/api.js:1107:14)     at updateLocalCache (/home/node/d20-api-server/api.js:1442:18)     at /home/node/d20-api-server/api.js:1628:11     at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 I don't see any of those scripts, but I'm probably not understanding how it fits together on roll20. For example, in SmartAoE.js, getSquareLocations is lines 2747-2979, but error says it's line 3135, which is a comment.
1688496634
David M.
Pro
API Scripter
Hmm, lots to unpack here. I'm about to head out for July 4th stuff with the family. If you want, you can PM me an invite to your game and we can go over it on Discord or something (likely tomorrow or another day that is convenient for you).  
Wyrmwood said: That's a red herring. I can reproduce this in a 70 ppi map. Just select a token and run !smartaoe {{ --aoeType | square, float }} This works fine if you leave out float. Maybe we're just seeing a usability or error handling issue. If the user isn't giving it the right parameters, ideally the error would communicate that, if possible. Is it even possible to make a variable shape that can float? Maybe not, since the spawned token controls the size, not the location, which is centered on the original token and moving that original token has no effect on the AoE. Like you are limited to one or the other, movable or variable?
Sometimes, you do get a Config Error: <What you did wrong> I noticed on the macro attached to the SmartAoE control token, 30ft-Circle-Caster !smartaoe {{   --aoeType|circle, float   --controlTokName|self   --radius|30ft   --minGridArea|0.5   --forceIntersection|0   --fx|burn-fire }} You get this same TypeError. If I remove float, I get Config Error: Only AoE's of circle/square, with the float keyword, and with an explicit radius can use --controlTokName|self. If I then remove the controlTokName, it works. Nice! It appears some of the pre-generated macros on the SmartAoEControlToken have this issue with the float variable. You don't need it for an effect centered on the caster.
1688654482

Edited 1688654593
Wyrmwood said: You don't need it for an effect centered on the caster. From what I understand this is correct behavior as you wouldn't need something emanating from yourself to "float". I am extremely glad you typed that out though, as I wasn't checking for that particular issue in my Script Generator - so thank you for unintentionally helping me haha I posted a separate thread for my AoE Script Generator so this thread won't have any unnecessary info, but here's a link for those interested:&nbsp; <a href="https://app.roll20.net/forum/post/11531456/tool-smartaoe-script-generator" rel="nofollow">https://app.roll20.net/forum/post/11531456/tool-smartaoe-script-generator</a> Again, huge thanks for this amazing script! This has been a lot of fun to tinker with!
Hi David,&nbsp; I get a similar error to wyrmwood. The API works great multiple times, but then will fail with this error. It breaks the other script I am using (group Init) when it goes down. Thanks, TypeError: Cannot read properties of undefined (reading 'get') TypeError: Cannot read properties of undefined (reading 'get') at updateMapWithAoE (apiscript.js:5859:36) at smartAoE_handleTokenChange (apiscript.js:6103:13) at smartAoE_handleInput (apiscript.js:8051:25) at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:168:1), &lt;anonymous&gt;:65:16) at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:168:1), &lt;anonymous&gt;:70:8) at /home/node/d20-api-server/api.js:1762:12 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147) at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546) at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489)
Is there a way to make the default macro collection ask what color I would like the AoE to be?
I'm getting an error when trying to use multiplication in my damage formulas ReferenceError: msg is not defined ReferenceError: msg is not defined at sendErrorMessage (apiscript.js:6684:16) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) This is the formula that I'm using which I took from another post on this thread: -- damageFormula1 | [[( ? { Cast at what level ?| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 } * 2 ) d4 ]] When I change it to addition, the error goes away. This is strange, I don't think I've encountered this before. Any help would be appreciated.
1691439516
timmaugh
Pro
API Scripter
Hey, Furious... if you install ScriptInfo and run: !scriptinfo 6684 ...that should help pin down the exact line for David (or the owner of whatever script is actually throwing the issue). (Just match the actual error number to what line number gets reported to you -- that is, if your script registration gets reordered a bit by installing a new script, you might have to regenerate the error to get the new line number... whatever it is, use it in place of 6684.) And I mentioned "whatever script is throwing the error" because that "processTickAndRejections" is&nbsp; usually an indicator of a character sheet issue. What sheet are you using in your game?
1691443162
David M.
Pro
API Scripter
FuriousMeatballs, try using nested inline rolls instead of parentheses.&nbsp; This seems to work for me: --damageFormula1|[[[[?{Cast at what level?|1|2|3|4|5|6|7|9}*2]]d4]] Something with the way I'm using the libInlines script to read and store the formula for later use (the trigger event) doesn't like the parens. It ends up trying to process the following via the Roll20 roll parser:&nbsp; [[(3&amp;#42;2)d4]] Nested inlines work fine, though. Interestingly, when I tried your original inline I didn't get a sandbox error. SmartAoE caught the error and told me in chat that "Something went wrong when processing rolls...etc". I'm guessing the sandbox error you saw was unrelated (something character sheet related as timmaugh suggested).&nbsp;
@tim thank you for the insight on that! I bet it will come in handy. And David, thank you for the help as always!
Hi David, &nbsp; &nbsp;I really love your script.&nbsp; So far a friend of mine and myself have created a large number of AoE spells, using custom tokens, updated markers etc.&nbsp; We are almost halfway through all of the AoE 5e spells.&nbsp; I have a question about using a specific server rules for damage on critical successes and failures.&nbsp; &nbsp;We want to add a rule for natural 1s to do double damage and natural 20ies no damage.&nbsp;&nbsp; Also do you know if there is a way to add combat master count down for token markers so they would countdown successive rounds? Thanks!
1691703434
David M.
Pro
API Scripter
Paul, unfortunately the script does not have a mechanism to handle that sort of logic (specific saving throw raw die roll affecting damage).&nbsp; &nbsp;&nbsp; Regarding turn tracking: I'm not sure about combat master (I don't use it), but SmartAoE does have options to add turnorder entries. See item #3 in this forum post for details.&nbsp;
Wow Thanks!
I just saw your notes about the new ability to include the caster in AOE spells.&nbsp; Just wanted to say Thank You for adding that.&nbsp;&nbsp;
Hi same issue here on non floating and also on all trigger nothing is written in the chat David, were you able to understand what is happening? thanks Andrea Wyrmwood said: Sometimes, you do get a Config Error: &lt;What you did wrong&gt; I noticed on the macro attached to the SmartAoE control token, 30ft-Circle-Caster !smartaoe {{ &nbsp; --aoeType|circle, float &nbsp; --controlTokName|self &nbsp; --radius|30ft &nbsp; --minGridArea|0.5 &nbsp; --forceIntersection|0 &nbsp; --fx|burn-fire }} You get this same TypeError. If I remove float, I get Config Error: Only AoE's of circle/square, with the float keyword, and with an explicit radius can use --controlTokName|self. If I then remove the controlTokName, it works. Nice! It appears some of the pre-generated macros on the SmartAoEControlToken have this issue with the float variable. You don't need it for an effect centered on the caster.
1694688899
David M.
Pro
API Scripter
Andrea, Wyrmwood's issue was due to copy/pasre errors on my part when setting up the pre-generated macros. When using self for the control token, the float keyword should not be included.&nbsp; Can you provide some more detail on your specific problem with no chat output?
1694767155

Edited 1694767320
David M. said: Andrea, Wyrmwood's issue was due to copy/pasre errors on my part when setting up the pre-generated macros. When using self for the control token, the float keyword should not be included.&nbsp; Can you provide some more detail on your specific problem with no chat output? Hi David I did some extra trial to provide context and the situation is as follows the code is for a generic AoE (I have 4 but for the moment focusing on instant floating AoE) !smartaoe {{ &nbsp; --title|Floating instant ?{shape?|circle, circle| square, square} &nbsp; --leftsub|@{selected|token_name}&nbsp; &nbsp; --rightsub|DC @{selected|spell_save_dc}&nbsp; &nbsp; &nbsp; --controlTokName|AoEControlToken &nbsp; --controlTokSize|1 &nbsp; &nbsp;--offset|0,0 &nbsp; --aoeColor|#8b251c &nbsp; --instant|1 &nbsp; --gridColor|#ea2011 &nbsp; --aoeType|?{shape?}, float &nbsp; --radius|?{radius}ft &nbsp; --forceIntersection|0 &nbsp; --minGridArea|0.25 &nbsp; --minTokArea|[[1d20*0.05]] &nbsp; --fx|burn-magic &nbsp; --damageFormula1|[[(?{damage?})]] &nbsp; --resource|lvl?{Cast at what level?|1,1|2,2|3,3|4,4|5,5|6,6|7,7|8,8|9,9}_slots_expended,1 &nbsp; --ignore|SmartAoE_Ignore,1&nbsp; &nbsp; --autoApply|0 &nbsp; --bar|1 &nbsp; --zeroHPmarker|dead &nbsp; --desc|Slot level ?{Cast at what level?}%br%area (ft) ?{radius}%br%damage ?{damage?} }} Now I've tried a few times before this message and the result of my test is the following Circle area level 3 spell damage 10d3 radius up to 20ft text in chat appears above 20ft it does not Square area level 3 spell damage 10d3 radius up to 15ft text in chat appears above 15ft it does not so I imagine there is some memory issue maybe? the map I am using it on is big but grid 5ft and width 1x70 so nothing special there i also tried on another map with 5ft grid and width 0,5*70 with the same results also use the trigger all macro on the AOE token many thanks&nbsp;
Hello, I apologize if this is covered somewhere, but I was unable to find it. In 1st Edition, a Wand of Fireballs does 6d6 damage, but all 1s are treated as 2s I am currently using the following: &nbsp; --damageFormula1|[[6d6]] Which is just a basic 6d6.&nbsp; Does anyone know how I would change that to make 1s treated as 2s? Thank you in advance
I tried playing with this more on my own... I figured out (reading various posts) that I can use the following in Roll20 to roll 6d6 and treat 1s as 2s [[({1d6,2d1}kh1) + ({1d6,2d1}kh1) + ({1d6,2d1}kh1) + ({1d6,2d1}kh1) + ({1d6,2d1}kh1) + ({1d6,2d1}kh1)]] However, if I change --damageFormula1|[[6d6]] to --damageFormula1|[[({1d6,2d1}kh1) + ({1d6,2d1}kh1) + ({1d6,2d1}kh1) + ({1d6,2d1}kh1) + ({1d6,2d1}kh1) + ({1d6,2d1}kh1)]] it hates it and gives me errors.&nbsp; So sorry to say, I am back to asking... does anyone know how to do a damageFormula in SmartAOE that will convert 1s to 2s? Thank you
1695745745
timmaugh
Pro
API Scripter
Couple of questions might help us narrow down what is going on... 1) When you say that SmartAoE hates you and gives you errors, what errors are you getting, specifically? 2) What is the full text of the SmartAoE command you are running? 3) What other scripts do you have installed?
timmaugh said: Couple of questions might help us narrow down what is going on... 1) When you say that SmartAoE hates you and gives you errors, what errors are you getting, specifically? 2) What is the full text of the SmartAoE command you are running? 3) What other scripts do you have installed? Thank you, but I just fixed it...&nbsp; &nbsp; I had to put another [[&nbsp; ]] brackets around it, so now it is --damageFormula1|[[[[({1d6,2d1}kh1) + ({1d6,2d1}kh1) + ({1d6,2d1}kh1) + ({1d6,2d1}kh1) + ({1d6,2d1}kh1) + ({1d6,2d1}kh1)]]]] Not exactly sure why I had to do that, as I am not a coder (more of a snippet re-user).&nbsp; &nbsp; Thank you for the response!
1696249836

Edited 1696250893
Extra piece of info a lighting bolt 100' line appeared about 2 minutes after the "trigger all" and still no chat Andrea L. said: David M. said: Andrea, Wyrmwood's issue was due to copy/pasre errors on my part when setting up the pre-generated macros. When using self for the control token, the float keyword should not be included.&nbsp; Can you provide some more detail on your specific problem with no chat output? Hi David I did some extra trial to provide context and the situation is as follows the code is for a generic AoE (I have 4 but for the moment focusing on instant floating AoE) !smartaoe {{ &nbsp; --title|Floating instant ?{shape?|circle, circle| square, square} &nbsp; --leftsub|@{selected|token_name}&nbsp; &nbsp; --rightsub|DC @{selected|spell_save_dc}&nbsp; &nbsp; &nbsp; --controlTokName|AoEControlToken &nbsp; --controlTokSize|1 &nbsp; &nbsp;--offset|0,0 &nbsp; --aoeColor|#8b251c &nbsp; --instant|1 &nbsp; --gridColor|#ea2011 &nbsp; --aoeType|?{shape?}, float &nbsp; --radius|?{radius}ft &nbsp; --forceIntersection|0 &nbsp; --minGridArea|0.25 &nbsp; --minTokArea|[[1d20*0.05]] &nbsp; --fx|burn-magic &nbsp; --damageFormula1|[[(?{damage?})]] &nbsp; --resource|lvl?{Cast at what level?|1,1|2,2|3,3|4,4|5,5|6,6|7,7|8,8|9,9}_slots_expended,1 &nbsp; --ignore|SmartAoE_Ignore,1&nbsp; &nbsp; --autoApply|0 &nbsp; --bar|1 &nbsp; --zeroHPmarker|dead &nbsp; --desc|Slot level ?{Cast at what level?}%br%area (ft) ?{radius}%br%damage ?{damage?} }} Now I've tried a few times before this message and the result of my test is the following Circle area level 3 spell damage 10d3 radius up to 20ft text in chat appears above 20ft it does not Square area level 3 spell damage 10d3 radius up to 15ft text in chat appears above 15ft it does not so I imagine there is some memory issue maybe? the map I am using it on is big but grid 5ft and width 1x70 so nothing special there i also tried on another map with 5ft grid and width 0,5*70 with the same results also use the trigger all macro on the AOE token many thanks&nbsp;
Hi everyone, hoping this is the place to jump in real quick:&nbsp; I'm quite new to scripts in general (about 3 weeks), and have been trying to climb the fairly large learning curve at the bottom of around 9 scripts at once. For SmartAOE, I've been trying to find a way to TriggerAll for lingering Self spells like Spirit Guardians. In our campaign, there are often large amounts of minions, and it would be a great time-saver to be able to roll all the damage at once after they're inside the spell effect area, rather than one at a time. However, every time I try to TriggerAll, I receive the following error in chat:&nbsp; Error: Cannot read properties of undefined (reading 'indices') I have attempted disabling and re-enabling my scripts, but I'm not accomplished enough at parsing through them to know which index is giving trouble for this particular command.&nbsp; Any help would be greatly appreciated!
1697993605

Edited 1697993888
David M.
Pro
API Scripter
Nods, is this using the Spirit Guardians example from the wiki? You should be able to trigger-all using that version of the macro by selecting the caster token and running a !smarttrigger command. If you are not using the wiki example, try it out or post the macro you are using so that I or others can test. Edit - Note: since we are using&nbsp; --controlTokName|self , there is no additional control token. to remove the AoE effect, you will need to select the caster token and run the !smartremove command. I would put this into a token action on the casters character sheet.&nbsp; Assuming it is not an error in your macro somewhere, there is a possibility that you have a corrupted State object (a persistent memory location that stores information for SmartAoE and other scripts). You can try running the !smartclearcache command to perform a reset of State (this only affects the SmartAoE script). Be sure to have no active AoEs when you run this command because it will unlink them and you will have to manually delete them from the page. If neither of these things works, let us know what other scripts you have installed. It is possible that there might be some kind of unintended interaction.
1698003672

Edited 1698003721
Nods
Pro
David, apologies, yes this is using the example macro from the wiki.&nbsp; I used the !smartclearcache, and now the !smarttrigger command works (it did not before), as does selecting individual targets while using the Trigger-Target Macro with the AoEControlToken selected. I still get the same error message when attempting to use the Trigger-ALL from the token, but obviously I can bypass that with the !smarttrigger command now. Thank you for your quick response!&nbsp; Just in case that error is still something that shouldn't be happening, here are the scripts I currently have running:&nbsp; Combat Master TokenMod GroupInitiative libTokenMarkers PowerCards PowerCards Macro Helper Alterbars libinline SmartAoE
1698099714
David M.
Pro
API Scripter
Hmm, you still shouldn't be getting that error. I just want to clarify your steps: 1) You are selecting the caster token and generating an AoE using the Spirit Guardians macro found in the wiki (verbatim). 2) You want to trigger all creatures within the AoE at once, so instead of using&nbsp; !smartquery @{target|Choose a Target|token_id} &nbsp;at the start of another creatures turn, you are selecting the caster token with the active AoE and running a&nbsp; !smarttrigger &nbsp;command? I can generate that error if I select a token that is not linked to an active AoE. It sounds to me like you might be selecting one or more potential target tokens? Unfortunately, the script is not currently set up to allow that. All AoE triggers require the AoE control token (either the caster or a dedicated control token) to be selected, not the other way around.&nbsp; Technically, I could modify the script to behave in that manner (selecting potential targets and checking what AoE's they are within), but there would not be a good way for the script to know which one(s) to trigger if they were within multiple persistent zones.
1698322344

Edited 1698333469
Hi David still struggling with the chat non appearing issue tried a regular sized map to avoid memory behaviors and four that If I launch the exact same script in an empty area chat appears normally while if I overlap another token then it does not appear but I have no clue on what could be the command line that makes the script misbehave here again the script I built (the "trigger all" is the standard one) !smartaoe {{ &nbsp; --title|Floating instant ?{shape?|circle, circle| square, square} &nbsp; --leftsub|@{selected|token_name}&nbsp; &nbsp; --rightsub|DC @{selected|spell_save_dc}&nbsp; &nbsp; &nbsp; --instant|1 &nbsp; --gridColor|#ea2011 &nbsp; --aoeType|?{shape?}, float &nbsp; --radius|?{radius}ft &nbsp; --minGridArea|0.5 &nbsp; --minTokArea|0.5 &nbsp; --fx|bomb-magic &nbsp; --damageFormula1|[[(?{damage?})]] &nbsp; --resource|lvl?{Cast at what level?|1,1|2,2|3,3|4,4|5,5|6,6|7,7|8,8|9,9}_slots_expended,1 &nbsp; --desc|Slot level ?{Cast at what level?}%br%area (ft) ?{radius}%br%damage ?{damage?} }} available to invite you to the game if you need to see it for yourself thanks Andrea Forget all my notes above it was a vary badly written script on my part But I leave it here for future similar issues: turns out that you really need the --saveformula line or the full description box appears when targeting an empty space and it does not when you include in the area a target token Andrea
1698364764
David M.
Pro
API Scripter
Ah, interesting. Thanks for sharing. I should probably add a check in there somewhere to give the user a message.
new issue.... tooltip seems not working I get a&nbsp; (From SmartAoE): &nbsp;Unexpected argument identifier (tooltip). with this code --tooltip|sampletext but this seems written as described in the script wiki page. to extra test 1)I created a new ability copying the spirit guardian macro from the wiki page. 2) on test work fine 3) then added a line&nbsp; &nbsp;--tooltip|spirit 4) and on test asks for the spell level and then provides the same error as above
1698418192

Edited 1698418222
David M.
Pro
API Scripter
One thing: tooltips currently are only created if a controlToken is spawned, so using controlTokName|self will ignore the tooltip. That said, in testing I am at least not getting an error. W hat version are you using? Is it from one-click or a manual install?&nbsp;
1698446528

Edited 1698470818
The one click one but taken some months ago &nbsp;there is a need for an update? the 0.25 and I am using the “standard” aoe control token David M. said: One thing: tooltips currently are only created if a controlToken is spawned, so using controlTokName|self will ignore the tooltip. That said, in testing I am at least not getting an error. W hat version are you using? Is it from one-click or a manual install?&nbsp;
mmm I just saw that tooltips are listed as a 0.26 feature! so not working on 0.25 makes perfect sense how do I replace the one click with the GitHub version? OR are you going to push a more recent version to one-click? also may I suggest adding in the wiki an info in the notes if a command is only available in the GitHub and not in the one-click? thanks again for this fantastic script Andrea L. said: The one click one but taken some months ago &nbsp;there is a need for an update? the 0.25 and I am using the “standard” aoe control token David M. said: One thing: tooltips currently are only created if a controlToken is spawned, so using controlTokName|self will ignore the tooltip. That said, in testing I am at least not getting an error. W hat version are you using? Is it from one-click or a manual install?&nbsp;
1698581910
David M.
Pro
API Scripter
Yeah, I have been slacking on pushing out to one-click. I can do that today but it likely won't go live until Roll20's weekly update (usually on Tuesdays). You can manually install by going to your mod page, clicking on New Script, giving it a name, pasting the source code, and saving. You'll want to either uninstall or disable the one-click version first. The easiest way to copying a large script like this from GitHub is to go to the source code and click "Raw" in the upper right corner, then Ctrl-A to select all (or I think cmd-A if on Apple device?).&nbsp;
1700261085

Edited 1700261179
Hey, short question. Recently when I drop the token onto the map, and it automatically clips, instead of clipping to an intersection of the grid it into the middle of two squares. Is there any value I need to tweak to fix it? I am using the new U.I.
David M. said: Yeah, I have been slacking on pushing out to one-click. I can do that today but it likely won't go live until Roll20's weekly update (usually on Tuesdays). Ciao David any decision on pushing a new release to one click? thanks Andrea
1700515086
David M.
Pro
API Scripter
Arg! Sorry Andrea (and everyone), I just put in a pull request. Hopefully it will get pushed with tomorrow's update (assuming normal release schedule). @Miha, does your macro work on a different map? I've seen rare cases before where the coordinate system of a given map gets corrupted, resulting in the behavior you are describing.
Hi David M. Just curious if the one-click was updated to make the "castercondition" feature work? I tried running a script with the line below and got an error &nbsp; --casterCondition|stopwatch&nbsp; Error = Unexpected argument identifier (castercondition) Full script is below: !smartaoe {{ &nbsp; --title|Spike Growth &nbsp; --leftsub|Slot Level 2 "&nbsp; --desc|The ground in a 20-foot radius centered on a point within range twists and sprouts hard spikes and thorns. The area becomes difficult terrain for the duration. When a creature moves into or within the area, it takes 2d4 piercing damage for every 5 feet it travels.%br%%br% The transformation of the ground is camouflaged to look natural. Any creature that can’t see the area at the time the spell is cast must make a Wisdom (Perception) check against your spell save DC to recognize the terrain as hazardous before entering it." &nbsp; --titlecardbackground|url('<a href="https://s3.amazonaws.com/files.d20.io/images/253361929/Sum-uYKHEGJObbOmhPWTGQ/max.png?1635735131');background-size" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/253361929/Sum-uYKHEGJObbOmhPWTGQ/max.png?1635735131');background-size</a>: 100% 100%; background-repeat: no-repeat &nbsp; --subtitlefontcolor|#ffffff &nbsp; --tablebgcolor|#d1e1cb &nbsp; --evenrowbackground|#ffffff &nbsp; --oddrowbackground|#d1e1cb &nbsp; --radius|20ft &nbsp; --aoetype|circle, float &nbsp; --forceIntersection|0 &nbsp; --mingridarea|0.25 &nbsp; --mintokarea|0.25 &nbsp; --fx|bubbling-acid &nbsp; --aoeColor|#10872d50 &nbsp; --aoeOutlineColor|#10872d &nbsp; --gridcolor|#10872d00 &nbsp; --spawnSound|entangle &nbsp; --triggerSound|entangle &nbsp; --damageformula1|[[2d4]] &nbsp; --damagetype1|piercing &nbsp; --bar|1 &nbsp; --autoapply|1 &nbsp; --resource|lvl2_slots_expended,1, Level 2 Slots &nbsp; --noSave|TRUE &nbsp; --casterCondition|stopwatch&nbsp; }}
1701105631
David M.
Pro
API Scripter
I just got email confirmation today that my pull request from a week ago was approved, so we should see it live during the rollout tomorrow.
1701184862

Edited 1701184892
Pak
Pro
David M. said: I just got email confirmation today that my pull request from a week ago was approved, so we should see it live during the rollout tomorrow. I'm happy to report that "castercondition" worked for me!!&nbsp; Thanks David M.!!!
1703364887

Edited 1703421297
Hello, I'm getting the "Error: Cannot read properties of the undefined (reading ' X') when running !smarttrigger using the following code. It's my attempt at manipulating your Dragon's Breath macro. !script {{ &nbsp; --&amp;brace|{ &nbsp; --&amp;cbrace|} &nbsp;&nbsp; &nbsp; --#emoteState|0 &nbsp; --#sourcetoken|@{selected|token_id} &nbsp; --#title|Spell Slots Remaining &nbsp; --&amp;level|?{Cast at what level?|1,1|2,2|3,3|4,4|5,5|6,6|7,7|8,8|9,9} &nbsp; --&amp;damageFormula1|&lt;&lt;(?{Cast at what level?}+2)d6&gt;&gt; &nbsp; --/&gt;GetAndCheckSlotInformation| &nbsp; --@forselected|smartaoe &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_title|Earth Tremor &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_leftsub|Slot level [&amp;level] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_rightsub|DC @{selected|spell_save_dc} DEX&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_subtitlefontcolor|#fffebd &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_titlecardbackground|linear-gradient(#672223, #672223) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_aoeType|square, float &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_radius|12.5ft &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_origin|center &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_minGridArea|0.25 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_minTokArea|0.25 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_dc|@{selected|spell_save_dc} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_saveFormula|5eDEX &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_aoeColor|#80ff0000 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_aoeOutlineColor|#80ff0000 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_damageFormula1|[&amp;damageFormula1] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_damageType1|bludgeoning &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_autoApply|1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_bar|1 &nbsp; &nbsp;_controlTokSize|5 &nbsp; &nbsp; &nbsp;_controlTokName|EarthTremor &nbsp;_isDrawing|1 &nbsp;_ignore|SmartAoE_Ignore,1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_desc|You cause a tremor in the ground in a 10-foot radius. Each creature other than you in that area must make a Dexterity saving throw. On a failed save, a creature takes 1d6 bludgeoning damage and is knocked prone. If the ground in that area is loose earth or stone, it becomes difficult terrain until cleared. At Higher Levels. When you cast this spell using a spell slot of 2nd level or higher, the damage increases by 1d6 for each slot level above 1st. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --X|End Macro &nbsp; --:GetAndCheckSlotInformation| &nbsp; &nbsp; &nbsp; --=SlotLevel|[&amp;level] &nbsp; &nbsp; &nbsp; --=SlotsTotal|[*S:lvl[$SlotLevel]_slots_total] &nbsp; &nbsp; &nbsp; &nbsp;--=SlotsExpended|[*S:lvl[$SlotLevel]_slots_expended] &nbsp; &nbsp; &nbsp; --?[$SlotsExpended.Total] -eq 0|&gt;NoSlotsLeft &nbsp; &nbsp; &nbsp; --?[$SlotsExpended.Total] -gt [$SlotsTotal.Total]|&gt;NoSlotsLeft&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; --&gt;DeductSpellSlot| &nbsp; --&lt;|&nbsp; &nbsp; --:DeductSpellSlot| &nbsp; &nbsp; &nbsp; --=SlotsExpended|[$SlotsExpended] -1&nbsp; &nbsp; &nbsp; &nbsp; --@setattr|_charid [*S:character_id] _lvl[$SlotLevel]_slots_expended|[$SlotsExpended] _silent &nbsp; &nbsp; &nbsp;--=SlotsRemaining|[$SlotsTotal] - 1&nbsp; &nbsp; &nbsp; --+|[c][b]Level [$SlotLevel] Spell Slots Left: [/b][$SlotsExpended][/c]&nbsp; &nbsp; --&lt;| &nbsp;--:NoSlotsLeft| &nbsp; &nbsp; &nbsp;--+|[b][*S:character_name] has no level [$SlotLevel.Total] spell slots available.[/b] &nbsp; &nbsp; &nbsp;--X|NoSlotsLeftStop &nbsp; --&lt;| &nbsp;&nbsp; }} Anything in this code that seems off? Thanks Edit: Sorry for the poor post formatting, I haven't figured out the table selection on this forum.
It seems having smartaoe run from within Scriptcards doesn't trigger the autoapply parameter.&nbsp; Is there any way to make that happen?
1703419633
David M.
Pro
API Scripter
Timothy, hmm your Earth Tremor scriptcard macro worked fine for me in my test game, including autoapply for damage. What version of smartaoe are you currently using? Does it work with different target tokens in the AoE (replace them and test)? Or on a different map? Oh, and you can format with code blocks by selecting your text and using the following text format: &nbsp;
1703421842

Edited 1703421957
Thanks David, not being able to find the code thing was drivin' me nuts. I have the latest version of SmartAoE. I think the problem is that I'm trying to apply the script in a way in which is wasn't intended. SmartAoE works perfectly fine for most spells I've used it for, except for Earth Tremor. Earth tremor triggers on the caster and damages everything in a 10ft radius, which I was trying to do immediately. But, SmartAoE requires the control token to move to a different square first to be triggered. I've been trying to use TokenMod to first move the token and then trigger the attack, but I just can't seem to get it to work. Using SelectManager I was able to move the control token 1ft, but not trigger the attack. It looks like it really wants to be physically selected over using TokenMod/SelectMod. If you have any ideas, I'd greatly appreciate it. In the end, moving the token one square and then one square back and triggering it isn't the worst possible thing to have to do while playing. Thanks
1703425623
David M.
Pro
API Scripter
To center on the caster without a separate control tojen, use the following: &nbsp;--controltokname|self If you do this, you will have to either nake it an instant effect or later use this command to remove the AoE !smartremove Typing this on mobile with my old eyes so hopefully not too many typos haha
Earth Tremor permanently changes the landscape, so I was using an image to represent that, I was even going to send it to the map layer after it triggered using tokenmod. I think I'm trying to automate things a little too much and I should probably cool it a bit. I've spent way too much time doing this to the point that when the players get to the next level I'll have a whole new set of spells and abilities to rewrite. I'm my own worst enemy. Thanks for the help.