View Single Post
Old 03-28-2010, 05:37 PM   #1
Panto
LASER DRAGONS IS RELEASED
 
Panto's Avatar


Development Moderator
User Project: Panto
 
Join Date: Mar 2003
Posts: 3,167

Submissions (2)

Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)

Approved Map: Call to Arms

Question The Mechanics Behind a Wave

Greets!

First, a confession: This isn't really for any particular project. I'm just trying to get a solid handle on the process involved in this trigger for my own education. Any help you can provide is fantastic, and I'm looking for the theoretical best answer more than the easy one. I speak jass if it is useful to answer in code.

So, to it.

Blizzard has a number of "wave" spells, like Carrion Swarm, Shockwave, Impale, Breath of Fire, Breath of Frost, Breath of Lemmings. Mostly these spells are pretty unfortunate: There's no way to easy "get" who the spell affected, they frequently have hardcoded targets or buffs, they lag through doodads and so on.

So I'd like to understand how these spells can be coded. Firstly, one must be able to get all the units/doodads/structures or whathaveyou inside the area that you want to affect. Let's suppose that we have:
  • The caster's X/Y
  • The angle between the caster and the target X/Y or unit
  • The full distance of the wave
  • The angle from either side of the casting direction that should also be affected
How do we get what widgets are in that space? It looks like this:

Zoom (requires log in)

Then there's another level of complexity. This is a wave, so it should affect the closest targets first, then farther out et cetera. How do we get the widgets in slices of a certain depth of the original area, so that we may affect them in stages? It might look like this:

Zoom (requires log in)

I ought to tell you that my geometry isn't very fresh, so I welcome any amount of detail you wish to give.

Thanks!
Attached Images
File Type: jpg Wave Diagram.jpg (77.1 KB, 94 views)
File Type: jpg Wave Diagram 2.jpg (103.2 KB, 94 views)
__________________
Pantokrator Maps forum.
LASER DRAGONS RELEASED!.
"One good test is worth a thousand expert opinions." Wernher von Braun
"The perfect is the enemy of the good." Voltaire
"When I became a man I put away childish things, including the fear of childishness and the desire to be very grown up." C.S. Lewis
Panto is offline   Reply With Quote
Sponsored Links - Login to hide this ad!