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

1676318574

Edited 1676386792
Hey, everything works perfectly in my game now.   Even though my game is still bloated and slow. I'm not 100% sure what I did to fix it, but for superstitions sake, here are a few things I did just before it started working.   @Jared , if you are still having problems maybe try these.  Because when I say everything works, I mean the tooltips now show all the proper rolls, and are different each time the smartaoe is triggered, not just the limited functionality I had before.  My players will be very excited. delete the control token and recreate it from the table sigh and curse disable the libInLine script and the smartAOE script re-enable libInLine and SmartAOE I strongly suspect it was redoing libInLine since smartAOE had been updated several time before when troubleshooting.  Or it was just random timing as the gremlins took a holiday as code was rolled back. One thing I did notice now, error messages still seem to be suppressed.   If there is a an error in the macro, it silently fails. edit:  Changed an "it" to clarify that the bloated and slow thing is my game, not SmartAOE.
1676325998

Edited 1676326037
kanoap said: Hey, everything works perfectly in my game now.   Even though it is still bloated and slow. I'm not 100% sure what I did to fix it, but for superstitions sake, here are a few things I did just before it started working.   @Jared , if you are still having problems maybe try these.  Because when I say everything works, I mean the tooltips now show all the proper rolls, and are different each time the smartaoe is triggered, not just the limited functionality I had before.  My players will be very excited. delete the control token and recreate it from the table sigh and curse disable the libInLine script and the smartAOE script re-enable libInLine and SmartAOE I strongly suspect it was redoing libInLine since smartAOE had been updated several time before when troubleshooting.  Or it was just random timing as the gremlins took a holiday as code was rolled back. One thing I did notice now, error messages still seem to be suppressed.   If there is a an error in the macro, it silently fails. Thanks @mkanoap! Yeah in the end I deleted and readded several of my APIs, had some issues with libTokenMarkers a couple of sandbox restarts got that going. Can't say if it helped but for anyone else it also seemed the order I have my API/Mods installed made a difference. Also installing them one by one, testing each time. My players are already super into it! Make sure to give your players access to use your smartAOE macros! 
1676521578
Jiboux
Pro
Sheet Author
Compendium Curator
Hello, first a big thanks for the amazing script... I think you finally decided me for squares instead of hex, because this is so useful. A question : I have been playing with the script and been able to setup all the "instant" aoe I need, but I have still more of a doubt for "persistant ones"... In the game I am playing, there is a Icy Surface, where spellcaster blows on the ground generating an icy surface starting from him (a cone)... This will be persistant for a few rounds with everyone risking to fall when crossing...  Is it me, or are cones not currently compatible with float (i.e. that I can't just trigger the effect, and then move the spellcaster without the cone being recalculated ?) Also for other shapes/persistent AoE, is there any automatic way to send the path (marked squares) to the map layer after triggering so that when moving tokens, you don't move accidentally the squares ? Thanks a lot!
Hi, i have an issue with the smart aoe script of fireball for instance. //**************************************************************************************************************************** // 5e Fireball // Author: FR // Prereq's: SmartAoE script // Notes: I use a custom rollable table token "character" for the --controlTokName called GenericSpellAoE, set to image side 5, size 8. // Either delete these three lines, or substitute for your own //**************************************************************************************************************************** !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|GenericSpellAoE --controlTokSize|8 --controlTokSide|5 --aoeColor|#99000050 --instant|1 --gridColor|#99000050 --aoeType|circle, float --radius|20ft --forceIntersection|1 --minGridArea|0.25 --minTokArea|0.25 --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. }} I get this message all the time, anyone can help? (From SmartAoE): Error: Character "GenericSpellAoE" must be in the journal with a default token
1676548192
David M.
Pro
API Scripter
Jiboux said: .......   Is it me, or are cones not currently compatible with float (i.e. that I can't just trigger the effect, and then move the spellcaster without the cone being recalculated ?) Also for other shapes/persistent AoE, is there any automatic way to send the path (marked squares) to the map layer after triggering so that when moving tokens, you don't move accidentally the squares ? Interesting re: a cone, float. Cones are currently tied to the source token (the caster) so the script knows what angle to place them. There's often a bit of finagling the control token to get the cone "just right". I'd have to play around with it to see how easy it would be to make a cone, float work. Shouldn't be too hard to add something like a --layer|map command.
1676548519
David M.
Pro
API Scripter
dehenn said: I get this message all the time, anyone can help? (From SmartAoE): Error: Character "GenericSpellAoE" must be in the journal with a default token This example is using a custom control token rather than the default "reticle". Have you made a character sheet called "GenericSpellAoE" with a default token that is a multi-sided image? Note that you can use whatever name you want for this sheet, as long as it matches what is written in the --controlTokName command. Also, your --controlTokSide should match the side of the token holding the image you want. ControlTokSide is not required if your custom control token is not a multi-sided token. 
Hi David, question for you...  I am setting up a 1st Edition Stinking Cloud AOE.  For the most part, I have it perfect.  The only thing that I do not have working (and it may not be possible) is the statusmarkers.    In 1st Edition Stinking Cloud, anyone that fails their save is affected for 2-5 rounds.  I know that I can set a statusmarker of Red, or even Red:3,  but is there a way I can do that basied on a 1d4+1 roll?  It is not always the same.   Thank you in advance
Hey David, bumping this in case you did not see the question.   Thanks
1676994629
David M.
Pro
API Scripter
Ah, thanks Tilt, I had indeed lost track of this. Do you need the 1d4+1 as a separate roll for each token? If so, there might be a way using the SelectManager metascript with deferral characters. I'll take a look at it tonight, but I might need to ping timmaugh if it's not straightforward.
Thanks David, yes... each token caught in the AOE (if they fail their save) would be nauseous for 2-5 rounds.  Thank you
1677030915
David M.
Pro
API Scripter
@Tilt: I'm afraid the best we can do right now is roll the 1d4+1 once and apply the same number to each, which you probably already knew. Something like:   --conditionFail|red@[[1d4+1]] Without getting to into the weeds of the code, delaying the rolling of individual values like I do for saving throws uses a fairly complicated structure (well, complicated for a hack like me) using javascript Promises and asynchronous processing. I'm pretty sure if I tried to implement this on a wider scale I would go completely insane. If you really need the individual rolling, then you may want to look into a scriptcard solution (using Kurt's Fireball example as a good head start). Or worst case just apply the red marker with SmartAoE and roll individually for those that failed (manually updating the numeric overlay). 
Thanks David, that is exactly what I was planning on doing if there was not a way built in.  I just have it give them the Red status and then I will individually roll.   I just wanted to make sure I was not missing anything where I could have it do it for me.  Thanks again for all your input/answers
Hi team,  I'm having a minor issue with SmartAoE and Combat Master. When I have a spell macro from AoE apply a condition that activates CombatMasters duration. It displays in chat: Abominable Yeti:selected|token_name. If this applies to multiple characters, it will display it for each affected character.  I can see someone else had a similar eval error coming up in the forum, and it seems to be coming from Combat Masters function handleStatusMarkerChange. This doesn't stop the API/Mods in any way; just minorly annoying. Any tips to make this go away? Any help would be much appreciated.  "ERROR: Unable to find character selected in chat command." "Error at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:172:1), <anonymous>:637:11) at String.replace (<anonymous>) at Object.d20.textchat.doChatInput (eval at <anonymous> (/home/node/d20-api-server/api.js:172:1), <anonymous>:549:29) at sendChat (/home/node/d20-api-server/api.js:1920:16) at sendCalltoChat (apiscript.js:2977:9) at doAddConditionCalls (apiscript.js:2911:17) at addConditionToToken (apiscript.js:1552:12) at apiscript.js:2161:29 at Array.forEach (<anonymous>) at handleStatusMarkerChange (apiscript.js:2157:38)"
1677336298
David M.
Pro
API Scripter
Hmm, I'm assuming that you have a manual install and have modified CombatMaster to recognize statusmarker changes initiated from SmartAoE? I peeked at the code on one-click and that version seems to only handle changes from the token-mod, DeathTracker, and InspirationTracker scripts.  Do you get the same behavior when you add a statusmarker using, say, token-mod?
David M. said: Hmm, I'm assuming that you have a manual install and have modified CombatMaster to recognize statusmarker changes initiated from SmartAoE? I peeked at the code on one-click and that version seems to only handle changes from the token-mod, DeathTracker, and InspirationTracker scripts.  Do you get the same behavior when you add a statusmarker using, say, token-mod? Thanks David,  Yep I had modified it for the event handlers. Tried token-mod with the same issue, thought to myself  maybe try and delete the condition in combat master and remake it ......and it solved my problem. Annoyingly the equivalent of turning it off and on again.  Cheers!
Hello, I've been playing around with the API, and its really neat! I would like to create all the spell/ability macros on a placeholder character and then make a reference macro for each character that needs to use them. The problem is, I cannot seem to find how to reference a macro on another sheet. Any advice?
1677520719
David M.
Pro
API Scripter
Tony, sounds like you are looking for a Macro Mule character sheet, described here .
1677955193

Edited 1677955362
Hey! I have a visual problem that's occured fairly recently where it wouldn't display the number of squares properly (the highlighted squares would be intersecting instead of overlaying on the grid, for example with a 10ft cube, it would highlight 6 squares instead of 4). Is there something I can do to fix this? I'm using the latest version Edit: I tried posting a picture but for some reason it's not working, so I tried this: <a href="https://gyazo.com/49d5339d52964b1db6b27c95076069ed" rel="nofollow">https://gyazo.com/49d5339d52964b1db6b27c95076069ed</a>
1677960454
Gauss
Forum Champion
It looks like your map grid might be offset from the Roll20 grid.&nbsp;
Gauss said: It looks like your map grid might be offset from the Roll20 grid.&nbsp; I'm not sure what you mean, the map is gridless, the grid displayed is from Roll20
1677964220
Gauss
Forum Champion
Floofffy said: Gauss said: It looks like your map grid might be offset from the Roll20 grid.&nbsp; I'm not sure what you mean, the map is gridless, the grid displayed is from Roll20 Nevermind then. It was just a thought. :)
1678051694
David M.
Pro
API Scripter
Floofy, can you try the same macro on a different map/page? At least twice in the last year or so I've seen particular maps freak out with respect to this script (some kind of corrupted coordinate system?). If it continues to be a problem on other maps, ping me and I can take a closer look at it for you if you'd like.&nbsp;&nbsp;
David M. said: Floofy, can you try the same macro on a different map/page? At least twice in the last year or so I've seen particular maps freak out with respect to this script (some kind of corrupted coordinate system?). If it continues to be a problem on other maps, ping me and I can take a closer look at it for you if you'd like.&nbsp;&nbsp; I just tried it with other maps, most of them don't cause any trouble, so I guess I just picked an unlucky one to test out. Thanks for your help!
1678125936
David M.
Pro
API Scripter
Thanks for checking. Were there multiple maps in your game that had this issue, or just the one? And the ones that are working have the same grid settings as the non-working map? It's historically been such a rare occurrence, I haven't yet been able to home in on what causes the problem.
David M. said: Thanks for checking. Were there multiple maps in your game that had this issue, or just the one? And the ones that are working have the same grid settings as the non-working map? It's historically been such a rare occurrence, I haven't yet been able to home in on what causes the problem. I've checked a couple of pages now and there are actually quite a few "broken" ones, I've collected some screenshots here:&nbsp; <a href="https://drive.google.com/file/d/1Yil1ylSLUF22CZnEzC5q9Na2w2LnbVtN/view?usp=sharing" rel="nofollow">https://drive.google.com/file/d/1Yil1ylSLUF22CZnEzC5q9Na2w2LnbVtN/view?usp=sharing</a> Let me know if there's anything else I can do to help!
Hi crew,&nbsp; I have a small issue, when I have SmartAoE use an image stored on a rollable table called up in a&nbsp;GenericSpellAoE sheet. If the image is created and intersects a dynamic lighting line, and if Dynamic Lighting Barriers restrict movement to ON. When the image appears intersecting over a dynamic lighting line it is stuck for my players&nbsp; If I as GM nudge it over a square then my players can move it, even if it is still over a dynamic line.&nbsp; Is there anyway around this? Thanks in advance!
1678278298
David M.
Pro
API Scripter
Jared, that sounds like a possible Roll20 limitation/quirk/bug. I'm assuming your control token is larger than one square - is it happening when spawned across a DL barrier close to the center, or if does merely any intersection (even towards the edge) trap the control token?&nbsp;&nbsp;
Question, is there a way to turn off vision on tokens within the AOE affect, like when a darkness spell is cast?&nbsp; I know how to add the "blindness" token maker, but it would be nice if it I could also have vision turned off at the same time.
I would think it would be easy to create a token-mod macro to toggle vision for anybody inside the darkness.&nbsp;&nbsp;
1679777313
David M.
Pro
API Scripter
Darryn, there is currently no way to do that directly with the script. Even if I turned it off for all tokens within the area, you'd have to turn it back on when they leave the area. Does give me an idea&nbsp;for a future feature, something like: --tokenPropsFail|Prop1,val1;Prop2,val2... etc. Spells causing Blindness, light emission (e.g. Faerie Fire), Reduce, etc. could be simulated.&nbsp; I'll put it on the wishlist and see how difficult it would be to add when I'm next poking around in the code.
Cool,&nbsp; Thanks!
1680705171

Edited 1680718420
Tilt
Pro
Hello, Looking for help if possible on an issue I am having applying status markers I am doing a Bless spell and no matter what I do, I can not get it to apply the status marker.&nbsp; Note: I am using custom makers. Before hand, I applied the status markers I am going to be making spells for and used Scriptcards to pull the status for me. I got the following:&nbsp; Bless::5968274,Curse::5968304 So with that information, I did the following &nbsp; --noSave|1&nbsp; (which causes those in the spell to auto-fail) &nbsp; --conditionfail|Bless::5968274&nbsp; &nbsp;&nbsp; So I thought I was doing it correctly, but does not appear to be so.&nbsp; &nbsp; I have also tried&nbsp; &nbsp; --conditionfail|"Bless::5968274" Any thoughts on what I am missing? Thank you in advance Update:&nbsp; I verified the ID in Token-Mod.&nbsp; It is indeed&nbsp; [ Bless::5968274 ]
Same here, It stops working for me some times ago. I even tried with roll20's markers with no luck. Tilt said: Hello, Looking for help if possible on an issue I am having applying status markers I am doing a Bless spell and no matter what I do, I can not get it to apply the status marker.&nbsp; Note: I am using custom makers. Before hand, I applied the status markers I am going to be making spells for and used Scriptcards to pull the status for me. I got the following:&nbsp; Bless::5968274,Curse::5968304 So with that information, I did the following &nbsp; --noSave|1&nbsp; (which causes those in the spell to auto-fail) &nbsp; --conditionfail|Bless::5968274&nbsp; &nbsp;&nbsp; So I thought I was doing it correctly, but does not appear to be so.&nbsp; &nbsp; I have also tried&nbsp; &nbsp; --conditionfail|"Bless::5968274" Any thoughts on what I am missing? Thank you in advance Update:&nbsp; I verified the ID in Token-Mod.&nbsp; It is indeed&nbsp; [ Bless::5968274 ]
1680772821
David M.
Pro
API Scripter
Ran a quick check and can confirm this is not working on my end, as well. I'll take a look at it this evening and see if I can figure it out.
David M. said: Ran a quick check and can confirm this is not working on my end, as well. I'll take a look at it this evening and see if I can figure it out. Thx
1680864234
David M.
Pro
API Scripter
Ok, so the confirmation I gave earlier regarding the customs statusmarkers appears to be premature. I am no longer able to replicate and everything seems to be working for me. Are you using --autoApply|1? If not, are you clicking the red box with the "F" result in the chat output to apply the effects of the spell? I'm actually wondering now if that was an oversight on my part when quickly testing this before going in to work yesterday.
David M. said: Ok, so the confirmation I gave earlier regarding the customs statusmarkers appears to be premature. I am no longer able to replicate and everything seems to be working for me. Are you using --autoApply|1? If not, are you clicking the red box with the "F" result in the chat output to apply the effects of the spell? I'm actually wondering now if that was an oversight on my part when quickly testing this before going in to work yesterday. Thank you David.. it is strange, I did not change anything and it is working today.&nbsp; Wonder if something was going on somewhere else in Roll20.&nbsp; &nbsp;Thanks again for the great Script.
Hi all,&nbsp; Quick question : About the controltokside command. Is there a way of having the reticle to appear when you launch the spell and only have the desired side appear when you place the reticle where it's supposed to be?&nbsp; For example, I would like to have the reticle appear when I want to launch a fireball, then move the reticle and have a particular side as an effect once move to the desired hit position. Is this doable?&nbsp; I usually only allownmy players to live the reticle. Once as they are supposed to master and know the aoe for their spells. If I use the controltokside command the aoe with the side appears directly, and it ruins the 0ossibility of a possible error from the caster...&nbsp; Thanks
1680957616
David M.
Pro
API Scripter
That's not currently possible, but an alternative is to set aoeColor,&nbsp; aoeOutlineColor, and&nbsp; gridColor to a fully transparent color and use fx to give a visual indication of where the fireball actually hit. For example, you could try these settings: &nbsp; --aoeColor|#ffffff00 &nbsp; --aoeOutlineColor|#ffffff00 &nbsp; --gridColor|#ffffff00 &nbsp; --fx|burn-fire
My idea would have been to spawn the reticle (like being side 1) and then, when moved, transform the token changing its side to show the actual area of effect or an animated aoe. But if not possible then forget it.&nbsp;
Hey Folks, is there a way to modify the stock "AoEGenerator" macro so that the areas are different colors for different players? Thanks!
I think that you can add a line in the macros of the AoEcontrol token such as aoeColor| @(player.@(selected.player).color)50 and you will get what you're asking for (the 2 last digits gives you the transparency if needed) NOTE: this requires to have FETCH installed
1682369607

Edited 1682369635
Hi, folks. I love this script as it elevates the game automation. But I am currently having lots of API crashes and it seems to be the cause of it. Anyone has tips on how to fix or how to troubleshoot it? This is the error I see the the API logs: "SmartAoE v0.28 initialized." "-=&gt; PathToWindowOrDoor v1 &lt;=- &nbsp;[Fri Dec 16 2022 03:27:43 GMT+0000 (Coordinated Universal Time)]" TypeError: Cannot read properties of undefined (reading 'get') TypeError: Cannot read properties of undefined (reading 'get') &nbsp; &nbsp; at updateMapWithAoE (apiscript.js:15874:36) &nbsp; &nbsp; at smartAoE_handleTokenChange (apiscript.js:16118:13) &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:1107:14) &nbsp; &nbsp; at updateLocalCache (/home/node/d20-api-server/api.js:1442:18) &nbsp; &nbsp; at /home/node/d20-api-server/api.js:1628:11 &nbsp; &nbsp; at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 &nbsp; &nbsp; at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147) &nbsp; &nbsp; at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546)
1682371163
timmaugh
Pro
API Scripter
Hey, Rodrigo... can you share an example SmartAoE command that would cause this error? And then,also... could you install the ScriptInfo script from the 1-click and run this command to help David pinpoint the line? !scriptinfo 15847 (just match the number to the line reported in the error message) Let us know what it says.
1682372687
David M.
Pro
API Scripter
Is it always happening? Only on certain maps or certain types of AoE's? Aside from getting some more information (like Tim suggested), you might try reinitializing the state associated with this script in case it has been corrupted in some way. Note if you do this, any existing AoE's generated from this script will be unlinked from their control token and you'll have to delete manually.&nbsp; If you want to try clearing the SmartAoE state, type the following into chat !smartclearcache
If you want to try clearing the SmartAoE state, type the following into chat !smartclearcache That seems to have done the trick for me. Sorry for the slow reply, but it was only happening when the players were there and I wanted to test.&nbsp; timmaugh &nbsp;said: !scriptinfo 15847 I will certainly remember that for another time when I see an error in the API Thank you both
I am having an issue with the Faerie Fire macro from the Git while using newest Oneclick version of SmartAoE. After clicking macro and then moving origin point with control token to area only two tokens are in radius. However in chat all tokens that are on my object layer get rolled for DC as well. They are about 20 ft away from FF cube. Thank you for any help you might be able to give.
1683407598
David M.
Pro
API Scripter
Whoa, never run into that one before! Can you try it on another page/map? You could also delete any active AoE's and run the following command, just to make sure there isn't anything strange going on with the persistent state object: !smartclearcache I've had a few reports of certain pages getting messed up (seemingly like the page grid coordinate system gets corrupted somehow), though the grid seems to jive with the drawn AoE scale so I'm not convinced that is exactly what is going on in your case.
David, sincerely thank you for quick response. And secondarily thank you for your great service to this community. That solved my issue and now the macros are working as intended. Thank you infinitely and good luck in your endeavors. Other pages were also working just fine.