• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

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

Status
Not open for further replies.
Level 24
Joined
Feb 9, 2009
Messages
1,786
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.
2dgxg9.jpg


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?"
2dgxg9.png


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.
1640671098509.png
1640671054544.png

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

And Even more concerning it's not visually accurate either:
1640671242401.png
1640671292716.png


Using Default Flamestrike has no issue, highlighted units are dependent on their collision size and will still properly damage the edited Flesh golem unit:
1640670893874.png
1640670916849.png
 
Last edited:
Level 12
Joined
Mar 13, 2020
Messages
421
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:
Level 24
Joined
Feb 9, 2009
Messages
1,786
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.
 

Uncle

Warcraft Moderator
Level 67
Joined
Aug 10, 2018
Messages
6,953
I think I was correct here? -> Trigger Editor and Object Editor Range
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,233
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.
 
Level 24
Joined
Feb 9, 2009
Messages
1,786
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 64
Joined
Jan 18, 2005
Messages
27,233
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.
 
Status
Not open for further replies.
Top