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 .
×
Advertisement Create a free account

[Script] Areas of Effect

1475122360

Edited 1533764310
Stephen L.
Pro
Marketplace Creator
Sheet Author
API Scripter
GMs, your spellcasting players will love you for this script! With it, you can specify graphical areas of effect which your players can then spawn for their spells and other powers. All it takes is drawing a line to specify the effect's origin, range, and angle and selecting the effect from your list of saved AoEs. You can get the script early from here (Also available from the One-Click installer), along with instructions on how to use it: <a href="https://github.com/Roll20/roll20-api-scripts/tree/master/AreasOfEffect" rel="nofollow">https://github.com/Roll20/roll20-api-scripts/tree/master/AreasOfEffect</a> Demo: Note: Currently it is not possible to create effects from graphics purchased from the market place due to certain restrictions specified here: <a href="https://wiki.roll20.net/API:Objects#imgsrc_and_avatar_property_restrictions" rel="nofollow">https://wiki.roll20.net/API:Objects#imgsrc_and_avatar_property_restrictions</a> However, you can download them from your Roll20 purchased assets library and then upload them to your game in order to make use of them with this script. Roadmap: import/export saved areas of effect. Known issues: <a href="https://app.roll20.net/forum/permalink/4404533/" rel="nofollow">https://app.roll20.net/forum/permalink/4404533/</a>
Oh hot damn, very very nice!!
Where are those artworks from though out of curiousity?
1475151045
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
I'll be taking this ;)
Very cool script. &nbsp;Took a bit of figuring to get it working. &nbsp;It requires the utility scripts (all available in the script library) of: &nbsp;HTML Builder, MatrixMath, VectorMath, PathMath, and splitArgs. &nbsp;Once those are in place it's pretty intuitive to use.
1475155462
Stephen L.
Pro
Marketplace Creator
Sheet Author
API Scripter
Kevin said: Very cool script. &nbsp;Took a bit of figuring to get it working. &nbsp;It requires the utility scripts (all available in the script library) of: &nbsp;HTML Builder, MatrixMath, VectorMath, PathMath, and splitArgs. &nbsp;Once those are in place it's pretty intuitive to use. Oh... right. Forgot the dependencies since those are so conveniently taken care of by OneClick. &gt;_&lt; Saevar L. "Liquid-Sonic" said: Where are those artworks from though out of curiousity? The effects are my own artwork. The gnome is from one of the freebie packs. The map is from the Cybersmile promo pack.
Thank you for this Script. It is amazing. I modified it to add the following functionnality: I select a token, launch a macro, the macro ask which effect shall be displayed and ask to select the target. It then displays the choosen effect coming from the selected token and going to the target. This way i don't have to draw the line, it is done by the script. Then it uses your script to draw the special effect.
1475325452

Edited 1475325471
Alex C.
Pro
Marketplace Creator
Laurent said: Thank you for this Script. It is amazing. I modified it to add the following functionnality: I select a token, launch a macro, the macro ask which effect shall be displayed and ask to select the target. It then displays the choosen effect coming from the selected token and going to the target. This way i don't have to draw the line, it is done by the script. Then it uses your script to draw the special effect. Awesome! Could you share how you modified it?
Dont suppose we could mix a script to drop templates for aoes that don't have a point of origin. Such as the famous fireball spell? Or should I just try to custom add that myself?
Saevar L. "Liquid-Sonic" said: Dont suppose we could mix a script to drop templates for aoes that don't have a point of origin. Such as the famous fireball spell? Or should I just try to custom add that myself? I would be very interested in such a script. &nbsp;Something that could help "automate" generating and placing spell effects with a simple macro. &nbsp;I love the ability to define specific effects, but in some cases the ability to simply "drop a 20' radius circle on that guy over there" would be a nice addition to the functionality of this script. In my view having the ability to use the line to create a template is great and covers every type of case, so this is awesome. &nbsp;But also having a menu of predefined settings to call from would be tremendous addition!
1475332278

Edited 1475332848
It would not be a problem for me to share my script, but as Stephen L. is the author of the unmodified script, i can't share it without his approbation. For AOE without point of origin i(ve modified the script to create an AOE after selecting a target and selecting a size (number of squares). But it doesn't help if you want to place your AOE in the middle of several targets, only if your effect is centered on one target.
1475334808
Stephen L.
Pro
Marketplace Creator
Sheet Author
API Scripter
Nice mods to the script there, Laurent! It's fine with me if you want to share it. Given the convenience of not having to do the additional step of drawing the lines, I might assimilate it into the main script for the next version. :)
The script can be found here : <a href="https://dl.dropboxusercontent.com/u/91256389/Modif" rel="nofollow">https://dl.dropboxusercontent.com/u/91256389/Modif</a>... For the macros to use it (replace the part in Bold with your own effects): To create an effect between two targets: !spellfx @{selected|token_id} @{target|token_id} ?{Spell| Lightning,ligthningbolt|Cone of fire,firecone|Ray of fire,rayoffire|blue bolt,bluebolt|fire comets,firecomets|dragon flame,dragonflame|blue flame,blueflame|Flame blast,flameblast } To create an effect on a selected token: !aoespellfx @{selected|token_id} ?{Spell| Sun Burst,sunburst|Insects,insects } ?{Size|1}
Laurent said: The script can be found here : <a href="https://dl.dropboxusercontent.com/u/91256389/Modif" rel="nofollow">https://dl.dropboxusercontent.com/u/91256389/Modif</a>... For the macros to use it (replace the part in Bold with your own effects): To create an effect between two targets: !spellfx @{selected|token_id} @{target|token_id} ?{Spell| Lightning,ligthningbolt|Cone of fire,firecone|Ray of fire,rayoffire|blue bolt,bluebolt|fire comets,firecomets|dragon flame,dragonflame|blue flame,blueflame|Flame blast,flameblast } To create an effect on a selected token: !aoespellfx @{selected|token_id} ?{Spell| Sun Burst,sunburst|Insects,insects } ?{Size|1} Just crashes for me :/
Can you post the error that you have in the api console ?
Just wanted to say thanks for this. We had a big battle saturday night that got a bit rough especially for the mage in our party. I implemented this today and showed him how to use it, and he is already a big fan. Thanks for making my game better!
Is this going to be in the script repository? If yes then any idea when it should hit?
1475679936
The Aaron
Forum Champion
API Scripter
There is an open pull request for putting this in the repository: &nbsp;<a href="https://github.com/Roll20/roll20-api-scripts/pull/353" rel="nofollow">https://github.com/Roll20/roll20-api-scripts/pull/353</a>
1475680285

Edited 1476202425
Stephen L.
Pro
Marketplace Creator
Sheet Author
API Scripter
The pull is currently hung up on licensing details for the sample graphics I created for this script. Once the repository owners and I have settled that (hopefully soon), then you can expect to see it in there.
Outstanding- also is there a way for me to reference spell graphics I have purchased if I were to set up a table?&nbsp;
1475682247

Edited 1475682286
Stephen L.
Pro
Marketplace Creator
Sheet Author
API Scripter
Yes, but you would need to download them and then upload them into your library. Unfortunately, the Roll20 API doesn't allow spawned tokens to use image URLs directly from the marketplace because of this:&nbsp; <a href="https://wiki.roll20.net/API:Objects#imgsrc_and_avatar_property_restrictions" rel="nofollow">https://wiki.roll20.net/API:Objects#imgsrc_and_avatar_property_restrictions</a>
1475682538

Edited 1475682552
Stephen L.
Pro
Marketplace Creator
Sheet Author
API Scripter
Alright, it looks like the script is now merged into the API repo. :) Have fun, everybody!
This is an awesome script- thank you greatly Stephen.&nbsp;
Sorry, there was an error in my script. Here is the new version: <a href="https://dl.dropboxusercontent.com/u/91256389/ModifiedAOS.js" rel="nofollow">https://dl.dropboxusercontent.com/u/91256389/ModifiedAOS.js</a>
Ive had an issue with it when trying to use it in my game (using from the API repo latest version). Im getting this error: "--- Initialized Areas Of Effect v1.0 ---" {"who":"error","type":"error","content":"Unable to find a player or character with name: Pord (GM)"}
1475985741
The Aaron
Forum Champion
API Scripter
Looks like a case where the _fixwho() function isn't being applied, or is failing.
1476122464
Stephen L.
Pro
Marketplace Creator
Sheet Author
API Scripter
Pord said: Ive had an issue with it when trying to use it in my game (using from the API repo latest version). Im getting this error: "--- Initialized Areas Of Effect v1.0 ---" {"who":"error","type":"error","content":"Unable to find a player or character with name: Pord (GM)"} Are you using just the core script, or are you using Laurent's mod?
Stephen- is there a way to transfer over the effects from game game to another? just a quality of life improvement for people with multiple campaigns.&nbsp;
Stephen L. said: Pord said: Ive had an issue with it when trying to use it in my game (using from the API repo latest version). Im getting this error: "--- Initialized Areas Of Effect v1.0 ---" {"who":"error","type":"error","content":"Unable to find a player or character with name: Pord (GM)"} Are you using just the core script, or are you using Laurent's mod? The one that's in the repo. It's the latest version selected on the API there. Not coded myself. It's on the drop down.&nbsp;
1476129058
Stephen L.
Pro
Marketplace Creator
Sheet Author
API Scripter
Gary W. said: Stephen- is there a way to transfer over the effects from game game to another? just a quality of life improvement for people with multiple campaigns.&nbsp; No, the effects are stored in the API state for your campaign, which is currently untransferable. Pord said: Stephen L. said: Pord said: Ive had an issue with it when trying to use it in my game (using from the API repo latest version). Im getting this error: "--- Initialized Areas Of Effect v1.0 ---" {"who":"error","type":"error","content":"Unable to find a player or character with name: Pord (GM)"} Are you using just the core script, or are you using Laurent's mod? The one that's in the repo. It's the latest version selected on the API there. Not coded myself. It's on the drop down.&nbsp; Ok. I'll try to get that fixed soon.&nbsp;
Did you incorporate Laurents quick action options? &nbsp;They would be useful.
Stephen L. said: Gary W. said: Stephen- is there a way to transfer over the effects from game game to another? just a quality of life improvement for people with multiple campaigns.&nbsp; No, the effects are stored in the API state for your campaign, which is currently untransferable. Pord said: Stephen L. said: Pord said: Ive had an issue with it when trying to use it in my game (using from the API repo latest version). Im getting this error: "--- Initialized Areas Of Effect v1.0 ---" {"who":"error","type":"error","content":"Unable to find a player or character with name: Pord (GM)"} Are you using just the core script, or are you using Laurent's mod? The one that's in the repo. It's the latest version selected on the API there. Not coded myself. It's on the drop down.&nbsp; Ok. I'll try to get that fixed soon.&nbsp; Found the issue. There seems to be an issue with my name on the game.... if i use "Pord" or "Pord gm" its fine. However if I use "Pord (GM)" it gives the error... perhaps doesnt like the use of the brackets for name?
1476190624
The Aaron
Forum Champion
API Scripter
Oh! &nbsp;You're actually typing the '(GM)' part? &nbsp;That's generally added by Roll20 to names. &nbsp;The _fixWho() function I mentioned strips that from the name before whispering it. &nbsp;If you had typed that, it would wrongly strip it. &nbsp; In my own strips, I don't generally trust the msg.who and instead freshly pull the name from the playerid and so avoid both problems, but it doesn't account for when a character takes an action, so I can see that it would be preferable to keep in some situations.
1476475372
Stephen L.
Pro
Marketplace Creator
Sheet Author
API Scripter
Kevin Flynn said: Did you incorporate Laurents quick action options? &nbsp;They would be useful. I'm planning on including Laurent's quick action options in the next version. I will make an announcement when that becomes available.
1477945959
Stephen L.
Pro
Marketplace Creator
Sheet Author
API Scripter
Update: v1.1 now available for beta This update includes an arrow button for each effect, implementing Laurent's functionality for spawning an effect from one token to another. Get it here:&nbsp; <a href="https://github.com/Cazra/roll20-api-scripts/tree/A" rel="nofollow">https://github.com/Cazra/roll20-api-scripts/tree/A</a>...
The delete button doesn't seem to work?
1478129239
Stephen L.
Pro
Marketplace Creator
Sheet Author
API Scripter
Gary W. said: The delete button doesn't seem to work? Oops... Guess I broke something. I'll have it fixed in the next version.
1478193865
Stephen L.
Pro
Marketplace Creator
Sheet Author
API Scripter
I've got it fixed for v1.2. You can grab it early from here:&nbsp;<a href="https://raw.githubusercontent.com/Cazra/roll20-api-scripts/AoE1.2/AreasOfEffect/1.2/aoe.js" rel="nofollow">https://raw.githubusercontent.com/Cazra/roll20-api-scripts/AoE1.2/AreasOfEffect/1.2/aoe.js</a>
Stephen, If I wanted to use the arrow version in a macro is there a way to skip chosing it from from the menu and just designate the effect and target?
1478212981
Stephen L.
Pro
Marketplace Creator
Sheet Author
API Scripter
Gary W. said: Stephen, If I wanted to use the arrow version in a macro is there a way to skip chosing it from from the menu and just designate the effect and target? You mean like a token macro?
This is an awesome script- really adds to the flavor of the table session. But it does take some time to access it. I don't think there is a way to avoid that extra time for the aoe centered on a point. The value of having the graphic on the screen makes that extra time worthwhile. On the single target spells spending that extra time isn't really worth the amount of wow factor. BUT- if you could just add something like !areaofeffect --NameOfEffect that runs uses a @target command there wouldn't really be any extra work to use it. &nbsp;And you get all the wow factor.
1478267126
Stephen L.
Pro
Marketplace Creator
Sheet Author
API Scripter
Gary W. said: This is an awesome script- really adds to the flavor of the table session. But it does take some time to access it. I don't think there is a way to avoid that extra time for the aoe centered on a point. The value of having the graphic on the screen makes that extra time worthwhile. On the single target spells spending that extra time isn't really worth the amount of wow factor. BUT- if you could just add something like !areaofeffect --NameOfEffect that runs uses a @target command there wouldn't really be any extra work to use it. &nbsp;And you get all the wow factor. Ah, I see. I'll see what can be done to reduce the time it takes to use the script. Thanks for the ideas.
Just something to note. &nbsp;When you updated the script it apparently removed it from the auto install function of Roll20. &nbsp;I was getting a "Could not load script, no scripts exist for this campaign." error until I copy/pasted your script as a new script (after deleting the old version). &nbsp;Not sure why this happened, but I thought I'd let you know in case you know what happened.
1478544270
Stephen L.
Pro
Marketplace Creator
Sheet Author
API Scripter
Feadel Morauko said: Just something to note. &nbsp;When you updated the script it apparently removed it from the auto install function of Roll20. &nbsp;I was getting a "Could not load script, no scripts exist for this campaign." error until I copy/pasted your script as a new script (after deleting the old version). &nbsp;Not sure why this happened, but I thought I'd let you know in case you know what happened. By auto-install, do you mean it no longer appears in One-Click?
1480566296

Edited 1480566673
i tried installing this script via one click and also via raw. &nbsp;neither way allowed the script to start up without giving an error about save undefined. &nbsp;anyone else seen this issue, or am i maybe missing a prereq? &nbsp;i have all of these installed: &nbsp;HTML Builder, Matrix Math, Path Math, Vector Math &&nbsp;splitArgs. &nbsp;any help would be greatly appreciated. here is the error in full: TypeError: Cannot read property 'saved' of undefined TypeError: Cannot read property 'saved' of undefined at getEffectNamePrompt (apiscript.js:10079:44) at apiscript.js:10235:65 at Function._.each._.forEach (/home/node/d20-api-server/node_modules/underscore/underscore.js:153:9) at _updateShortcutMacros (apiscript.js:10229:7) at apiscript.js:10286:5 at eval (eval at (/home/node/d20-api-server/api.js:144:34), :65:16) at Object.publish (eval at (/home/node/d20-api-server/api.js:144:34), :70:8) at checkForReady (/home/node/d20-api-server/api.js:1205:12) at /home/node/d20-api-server/api.js:1284:9 at c (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:14:64) i also have the following scripts installed: tokenmod, trackerjacker, 5th ed. ogl companion, pagefx, mark, chatsetattr, shell, groupinit. &nbsp;i have tried deleting the scripts and readding them ( i believe i added splitargs after 1st installation so just troubleshooting ). &nbsp;no love....&nbsp; here is the api sandbox output: Spinning up new sandbox... "-=&gt; TokenMod v0.8.23 &lt;=- [Thu Nov 10 2016 19:21:57 GMT+0000 (UTC)]" TypeError: Cannot read property 'saved' of undefined TypeError: Cannot read property 'saved' of undefined at getEffectNamePrompt (apiscript.js:10079:44) at apiscript.js:10235:65 at Function._.each._.forEach (/home/node/d20-api-server/node_modules/underscore/underscore.js:153:9) at _updateShortcutMacros (apiscript.js:10229:7) at apiscript.js:10286:5 at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:144:34), &lt;anonymous&gt;:65:16) at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:144:34), &lt;anonymous&gt;:70:8) at checkForReady (/home/node/d20-api-server/api.js:1205:12) at /home/node/d20-api-server/api.js:1284:9 at c (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:14:64)
1480602972

Edited 1480603300
Stephen L.
Pro
Marketplace Creator
Sheet Author
API Scripter
aaron h. said: i tried installing this script via one click and also via raw. &nbsp;neither way allowed the script to start up without giving an error about save undefined. &nbsp;anyone else seen this issue, or am i maybe missing a prereq? &nbsp;i have all of these installed: &nbsp;HTML Builder, Matrix Math, Path Math, Vector Math &&nbsp;splitArgs. &nbsp;any help would be greatly appreciated. here is the error in full: TypeError: Cannot read property 'saved' of undefined TypeError: Cannot read property 'saved' of undefined at getEffectNamePrompt (apiscript.js:10079:44) at apiscript.js:10235:65 at Function._.each._.forEach (/home/node/d20-api-server/node_modules/underscore/underscore.js:153:9) at _updateShortcutMacros (apiscript.js:10229:7) at apiscript.js:10286:5 at eval (eval at (/home/node/d20-api-server/api.js:144:34), :65:16) at Object.publish (eval at (/home/node/d20-api-server/api.js:144:34), :70:8) at checkForReady (/home/node/d20-api-server/api.js:1205:12) at /home/node/d20-api-server/api.js:1284:9 at c (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:14:64) i also have the following scripts installed: tokenmod, trackerjacker, 5th ed. ogl companion, pagefx, mark, chatsetattr, shell, groupinit. &nbsp;i have tried deleting the scripts and readding them ( i believe i added splitargs after 1st installation so just troubleshooting ). &nbsp;no love....&nbsp; here is the api sandbox output: Spinning up new sandbox... "-=&gt; TokenMod v0.8.23 &lt;=- [Thu Nov 10 2016 19:21:57 GMT+0000 (UTC)]" TypeError: Cannot read property 'saved' of undefined TypeError: Cannot read property 'saved' of undefined at getEffectNamePrompt (apiscript.js:10079:44) at apiscript.js:10235:65 at Function._.each._.forEach (/home/node/d20-api-server/node_modules/underscore/underscore.js:153:9) at _updateShortcutMacros (apiscript.js:10229:7) at apiscript.js:10286:5 at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:144:34), &lt;anonymous&gt;:65:16) at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:144:34), &lt;anonymous&gt;:70:8) at checkForReady (/home/node/d20-api-server/api.js:1205:12) at /home/node/d20-api-server/api.js:1284:9 at c (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:14:64) I wasn't getting this error with an upgraded copy of the script, but in a fresh new game, I was immediately able to reproduce your error. I'll look into fixing that soon. For now follow the steps for this work-around: 1.&nbsp;Disable the AreasOfEffect script. 2.&nbsp;Create a script with the following contents: _.defaults(state, { &nbsp; AreasOfEffect: {} }); _.defaults(state.AreasOfEffect, { &nbsp; saved: {} }); 3. Re-enable the AreasOfEffect script.
1480607286
thanks. &nbsp;i will try that. &nbsp;also, i loaded laurent's script from above ( stated 1.0 ) and it worked. &nbsp;was getting ready to diff the scripts to see if i could find something. &nbsp;i will do what you suggest and reply to here with result.
1480607990
that additional script worked like a charm. &nbsp;thanks for the quick reply. &nbsp;now should be all set for my saturday game. &nbsp;:) &nbsp;
Stephen I didn't notice the update to the Area of Effect script- it is awesome. The burst effect is a huge time saver and lets you enjoy the look of the spell and gauge the area it covers without a ton of work. Thanks so much.&nbsp;
1482329637
Stephen L.
Pro
Marketplace Creator
Sheet Author
API Scripter
You're welcome! :)
It seems that the burst operates a bit differently in scale? How do you recommend getting an accurately sized effect when setting up?