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

Visual Area Attack?

So I'm hacking away to automate everything for Mutants and Masterminds 3e, and I have regular attacks working just fine. However, area attacks are also common, so I want to work out how to automate those as well. For single-target attacks, I run a macro, select the target, and then the script applies all of the conditions/damage automatically. For an area attack, I'd like if I could click the macro and then have something like a 30ft radius circle that follows the cursor around. Then, on click, it finds all targets in its area and attacks them. Alternately, some kind of target multi-select could work as well, since some area attacks in M&M allow you to choose who is affected within the area. Anyone have any ideas for getting an area circle down and then calculating the targets within?
1457928486
The Aaron
Pro
API Scripter
If it's always a circle, the math is not too difficult.  Probably I would have the API command create token with a translucent circular image (something in your User Library) of the correct size, controlled by the player issuing the command, and centered on the selected (or @{target}ed) token, then have them move it to the right location and issue a command to continue.  (The command might be linked via a token action on the created token, possibly getting some data from the bars to know which command is being completed, or perhaps you stored the created token's id.)  Then just take the center of the circle token and find all the tokens on the page whose location is within the given range. That could be a start anyway.  What do you think?
That could work. It's a more solid idea than anything I've come up with so far. There are other types of areas, but a circle is the most common. A line area should be simple to calculate as well, and I could do a cone like a line with a function for width per point of length or something. I'll see if I can get ot all figured out soon. Thanks, as always!
1457932574
The Aaron
Pro
API Scripter
For a cone, assuming a rounded end type (sector of a circle in geometry) you might find this useful:&nbsp; <a href="http://stackoverflow.com/questions/13652518/effici" rel="nofollow">http://stackoverflow.com/questions/13652518/effici</a>...
Neat. My work's cut out for me, but I think I can make it all work. Thanks!
1458066537
The Aaron
Pro
API Scripter
Reach out if you have any questions or wanna chat about it! =D