• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Spell] Disparity between AoE

Status
Not open for further replies.
Level 7
Joined
Jun 19, 2017
Messages
141
Have you encountered the disparity between the AoE of a spell in Object Editor and it's AoE made by a trigger? Just as an example, if you set the AoE of Rain of Fire to 300, but you want to add an additional effect with trigger, you use the function
Pick every unit within 300 of (target point of ability being cast), but this 300 range is less than the 300 range of RoF in object editor... what's the solution to that?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Have you encountered the disparity between the AoE of a spell in Object Editor and it's AoE made by a trigger? Just as an example, if you set the AoE of Rain of Fire to 300, but you want to add an additional effect with trigger, you use the function
Pick every unit within 300 of (target point of ability being cast), but this 300 range is less than the 300 range of RoF in object editor... what's the solution to that?
This is because the unit in range of point function works by unit origin while area of effect works by unit collision area.

The solution to deal correct 300 radius picks is to pick every unit in 300 + maximum collision size of point and then filter them for units in 300 range of point. The unit in range of point function does factor in the passed unit's collision size when performing the test and hence can be used to perfectly emulate area of effect mechanics.

Below are all the functions I know of that factor in unit collision size and so can be used for correct area selections.
JASS:
constant native IsUnitInRange takes unit whichUnit,unit otherUnit,real distance returns boolean
constant native IsUnitInRangeLoc takes unit whichUnit,location whichLocation,real distance returns boolean
constant native IsUnitInRangeXY takes unit whichUnit,real x,real y,real distance returns boolean
 
Level 5
Joined
Jun 13, 2017
Messages
83
Had that problem before I reduced ability Area of Effect until it is on what I want not the range in trigger.

Ability trigger damage is 400 range and the ability Area of Effect is on 385,
same with another ability of 200 range trigger and ability range Area of Effect 185.

Not 100% accurate but way more accurate than making Area of Effect of ability the same as trigger range.
 
Status
Not open for further replies.
Top