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] GrowIt. Simply grow AOE graphics to the desired radius, centered.

1425852993

Edited 1426115973
update v0.6 Adds exact measurements for things that are not radial burst (which are most AOE effects in general as they expand from an intersection point). It will snap the center of the intersection to the upper left most corner of the 1x1 unit graphic. Uses the same exact syntax. !growit -exact update v0.55 Removed unrelated dead logic. Grows an AOE graphic that's 1 unit in size, to the desired radius (excluding the center square); centered at the origin. It also moves the graphic to the map layer as a bonus. Useful macros to use this easily: grow !growit ?{radius(ft)} grow-exact !growit -exact ?{radius(ft)-[exact]} Script <a href="https://github.com/Roll20KenL/Roll20_API_Scripts/blob/master/growit.js" rel="nofollow">https://github.com/Roll20KenL/Roll20_API_Scripts/blob/master/growit.js</a>
1425854295
The Aaron
Pro
API Scripter
That's pretty sweet!
Hey Aaron, can you tag [SCRIPT] on this topic? I kinda just whipped this up quickly.
1425859568
The Aaron
Pro
API Scripter
Done!
1426016774
Stephen Koontz
Forum Champion
Marketplace Creator
Sheet Author
API Scripter
Compendium Curator
I like the idea. Simple, practical, useful.
1426017318
The Aaron
Pro
API Scripter
I'd be tempted to monitor the status makers and set to a radius as a multiple of the number assigned to a specific status. =D
The Aaron said: I'd be tempted to monitor the status makers and set to a radius as a multiple of the number assigned to a specific status. =D I already made that script a while back for auras. // BlastIcon - Set to the name of the icon you want to use to determine // the size of the aura on BlastTarget. Suggestions include chemical-bolt, // grenade, radioactive, or rolling-bomb. var BlastIcon = "chemical-bolt"; // Square Aura - Set to true to use square auras for Bloodied Status and // the shape of the Blast Icon aura. var SquareAura = true; on("change:token", function (obj) { // Exit the script if the object is not a token or is a drawing... if (obj.get("subtype") != "token" || obj.get("isdrawing") == "true") return; // Check for the specified status icon on the BlastTarget and add an aura equal // to the number set on the status. if (obj.get("name") == "BlastTarget") { var AuraRadius = parseInt(obj.get("status_" + BlastIcon)); var Scale = parseInt(getObj("page", obj.get("pageid")).get("scale_number")); if (obj.get("statusmarkers").indexOf(BlastIcon + "@") != -1) { obj.set("aura1_radius", AuraRadius * Scale); obj.set("aura1_color", "#990000"); obj.set("aura1_square", SquareAura); obj.set("showplayers_aura1", true); } if (AuraRadius == false || obj.get("statusmarkers").indexOf(BlastIcon + "@") == -1) { obj.set("aura1_radius", ""); obj.set("status_" + BlastIcon, true); } } });
1426020052
The Aaron
Pro
API Scripter
HoneyBadger said: The Aaron said: I'd be tempted to monitor the status makers and set to a radius as a multiple of the number assigned to a specific status. =D I already made that script a while back for auras. Ah, great minds think alike. =D
I just realized that I have some blaster script in there.. I'll fix that.
1426115426

Edited 1426115807
Updated to 0.6 Adds exact measurements for things that are not radial burst (which are most AOE effects in general as they expand from an intersection point). It will snap the center of the intersection to the upper left most corner of the 1x1 unit graphic. Uses the same exact syntax. !growit -exact
Just an idea... If you use it as an explosion and afterwards the area is still burning or filled with acid, can you add damage when the character/monster is in the area until they leave? Or damage over time? !explosion 30feet damage=1d4 to taget hp I haven't looked at the api, but can you hook into the turn tracker? You could make cool stuff like, adding effects (blinded, poison etc.) with tokens on a character for 3 rounds. or !explosion 30feet 2rounds damage=1d4 to taget hp (token removed after 2 rounds)
Bo KH said: Just an idea... If you use it as an explosion and afterwards the area is still burning or filled with acid, can you add damage when the character/monster is in the area until they leave? Or damage over time? !explosion 30feet damage=1d4 to taget hp I haven't looked at the api, but can you hook into the turn tracker? You could make cool stuff like, adding effects (blinded, poison etc.) with tokens on a character for 3 rounds. or !explosion 30feet 2rounds damage=1d4 to taget hp (token removed after 2 rounds) My blaster API does that and more. I'm still fiddling with it though. This sorta came about as byproduct that I thought would be useful for a-lot of people.
This is actually super handy. Thanks. Also your blaster script is sounding more and more impressive o.O. Too bad its still in dat works.
Note though. It doesn't work on cards that behave as tokens for some reason. (I pull all my spell effects etc from a deck by choosing them. Easier to select an effect that way) Though it seems awesome still.
1431097327
The Aaron
Pro
API Scripter
It checks to see if the selected is a token on line 88. You can replace that line with this: if (token && (token.get('_subtype') == 'token' || token.get('_subtype') === 'card')) { And it works fine for cards.
That's an interesting use I haven't thought of. The original intention was for AOE effects (since I bought up all of Gabe's spell FX packs), but that's cool that it works for cards too. If you want cards drawn on the tabletop to be a a preset size, I think you can also configure the deck to do so as well.
1431105296
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Could use the on add event to whisper to the GM some API button links for common sizes. Drag image.... get links 10, 15, 20, 25, 30. Click link and DONE.
I have as well! Bought all of his Spell FX. Its just I dump them into a deck so I can pull them out visually. I combine other effects like debris, clouds, doors, etc from it. It allows me to add special effects with having to resort to keyboard, and load them all quickly just by opening the deck. As for configuring the deck to become preset sizes, that would be awesomes... But thats beyond my skills unfortunately. THanks Aaron!! More +5 xps for you. :D
1431107877
The Aaron
Pro
API Scripter
With configuring the deck, it's a fixed size for all cards, so you'd need on for 15', one for 20', etc.
hmm, very cool. i like shephens idea about dragging then getting an option to set the size, what about cones, just use the preset values 15' 30' 45' 60' etc?
I use half the size for a cone. So 15 I put 7.5, 15 for 30 etc. Its expanding the token in both directions so
Makes sense thanks Saevar