• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] AoE = How much.

Status
Not open for further replies.
Level 17
Joined
Jun 12, 2007
Messages
1,261
Oke, I suck at making good titles.

Let's say I create a spell with "A" AoE, let's say it's 1000.
I then proceed to create a dummy at that point and let it pick the units in this area.
For this I use, units in range. But what range do I need to use in order to match with the AoE the spell will show.

I would love if somebody could tell me the formula or at what ratio I should look it like:

Ratio Example:
1000AoE = 580 range
500AoE = 265 Range

Formula Example: (Math please, no wc3 math.)
( "AoE" x 1.5 ) + 20 = "Range"

(I know that these examples are wrong, that's what I'm asking. That somebody shows me what the real values are.)
 
Level 8
Joined
Apr 30, 2009
Messages
338
to be precise it would be the radius of the circle plus half of the unit's collision size, so for an AOE 1000 units wide, it would be 516.

This is because the triggers select units if their centers are in range, but hardcoded AOE spells will hit units whose edges are in range.

Keep in mid that units with larger than 32 collision sizes will be excluded if they are on the very edge.

Range = 0.5(AOE + collision zie)
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
I would recommend something like this:
JASS:
call GroupEnumUnitsInRange(g,x,y,RANGE+SAFETY,Filter)

//the filter func:
function FilterFunction takes nothing returns boolean
    return IsUnitInRangeXY(x,y,GetFilterUnit(),RANGE)
endfunction
this is because GroupEnumUnitsInRange is bugged, or something. IsUnitInRangeXY takes collision in it's calculations..
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
@ Yixx
Oh yeh, I forgot to mention: "Jass = bullcrap" to me. I know it's better, I know it's 'easier' but I just hate coding. Can't read it, can't write it. No way I ever will. :p

En de groeten uit Friesland, het land met het lelijkste Nederlands volgens de krant. xD


@ tml616
Hmm, so let's say the casting dummy has 0 collision and I cast a spell with 500 AoE.
I need to pick units in (500 + 0 = 500) 0.5 = 250.
Correct? (Because it is a dummy that's placed in the center of the AoE that will cast the actual spell on everything inside the AoE of the casting Hero's spell.)
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
Ok,
  • Set TempGroup = Units within XXX range of (Location)
that bugs, i dont know how, but making XXX larger than your wanted range, and checking via Custom Script (IsUnitInRangeXY) deals with that..

Ge ken de groeten uit brabant krijgen, Kut! xD
 
Level 8
Joined
Apr 30, 2009
Messages
338
Yes the range is just the radius of your AOE circle. But the collision size of the targets is what matters. So if most of the units on your map have 32 collision size, it would be radius + 16.
 
Status
Not open for further replies.
Top