[Solved]Pick every unit in range - Worrying results [Updated!]

Status
Not open for further replies.

Devalut

Level 24
I was playing around with an aoe spell that fires multiple projectiles at random points in the area.
Through testing I noticed something as large as a flesh golem takes the same average of damage regardless of it's size.

Now my solution is:
• Unit Group - Pick every unit in (Units within ((2.5 * Casting Area) of CastingPointVariable.) and do (Actions)
• Loop - Actions
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• ((Picked unit) is A structure) Equal to False
• ((Picked unit) is dead) Equal to False
• ((Picked unit) belongs to an ally of (Owner of CastingUnitVariable).) Equal to False
• Then - Actions
• Set VariableSet SoSh_Point[3] = (Position of (Picked unit))
• Set VariableSet SoSh_Point[4] = (SoSh_Point[3] offset by (Collision Size of (Picked unit)) towards (Angle from SoSh_Point[3] to CastingPointVariable) degrees.)
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• (Distance between SoSh_Point[4] and CastingPointVariable) Less than or equal to 120
• Then - Actions
• Unit - Cause CastingUnitVariable to damage (Picked unit), dealing (Max(10.00, ((Life of (Picked unit)) x (6.25 / 1000.00)))) damage of attack type Spells and damage type Universal
• Else - Actions
• Custom script: call RemoveLocation(udg_SoSh_Point[3])
• Custom script: call RemoveLocation(udg_SoSh_Point[4])
• Else - Actions
My question: "Is this the best solution?"

Update!
In the image below the Flesh golem has an edited 300 unit collision size in this image, the sheep has a standard peasant collision size.
Despite being highlighed by the custom spell in green the flesh golem remains unharmed by the custom spell.

In fact you need to ensure the unit is within the aoe display circle to actually damage it:

And Even more concerning it's not visually accurate either:

Using Default Flamestrike has no issue, highlighted units are dependent on their collision size and will still properly damage the edited Flesh golem unit:

Last edited:

Pwnica

Level 12
I would say yes... and Never really think about to be honest...

I think that’s why some spells have 3 diffrent areas in the damage circle
The high damage small area (center)
The mid damage mid area (around center)
And the low damage area (around mid damage area)

But that depends on the gameplay of your map
It would be more important in some Skillshot games where aiming and predicting movement should show the difference of skill

Question did you test around with normal aoe Warcraft spells (not triggered damage)?

Last edited:

Devalut

Level 24
I would say yes... and Never really think about to be honest...

I think that’s why some spells have 3 diffrent areas in the damage circle
The high damage small area (center)
The mid damage mid area (around center)
And the low damage area (around mid damage area)

But that depends on the gameplay of your map
It would be more important in some Skillshot games where aiming and predicting movement should show the difference of skill

Question did you test around with normal aoe Warcraft spells (not triggered damage)?
Updated post, it works fine for vanilla aoe but custom spells made with the normal method will not account for collision size and therefore visually not be accurate.

Devalut

Level 24
Oh crap I should've bumped this earlier.
Bump!

Uncle

Warcraft Moderator
Level 62
I think I was correct here? -> Trigger Editor and Object Editor Range

Dr Super Good

Spell Reviewer
Level 63
Enuming units in range of a point goes by unit origin point. It does not factor in unit collision size like AoE normally does. To factor in collision size you need to expand the enum search radius by the maximum unit collision size, and then filter the returned unit results for units that are within radius range of the impact point. The native function that performs this test does factor in unit collision size, so a point anywhere under a unit's collision radius with 0 range will pass the test.

A while ago I ran extensive tests and concluded that using such logic makes AoE match up perfectly with the shaded units of ability or splash targeting circles.

Devalut

Level 24
The native function that performs this test does factor in unit collision size, so a point anywhere under a unit's collision radius with 0 range will pass the test.

A while ago I ran extensive tests and concluded that using such logic makes AoE match up perfectly with the shaded units of ability or splash targeting circles.
And that's this native right?
" if IsUnitInRange(GetEnumUnit(), GetTriggerUnit(), udg_AoE_Value) then"

Also do you recall the default maximum collision size?

Dr Super Good

Spell Reviewer
Level 63
And that's this native right?
Yes that looks right.
Also do you recall the default maximum collision size?
I do not off the top of my head. You can try googling it otherwise insert some value like 256. Being as small as possible just is a minor optimisation that is unlikely to make much of a difference, as long as the number is kept reasonable.

Devalut

Level 24
Yes that looks right.

I do not off the top of my head. You can try googling it otherwise insert some value like 256. Being as small as possible just is a minor optimisation that is unlikely to make much of a difference, as long as the number is kept reasonable.

Status
Not open for further replies.

Replies
6
Views
1K
Replies
1
Views
510
Replies
2
Views
398
Replies
8
Views
318
Replies
4
Views
345