• 🏆 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!

[Trigger] Detecting unit's Z Height

Status
Not open for further replies.
I would do it how I did it, use a dummy unit, make a camara in the WE that is at an angle of like 335-345 and ajust the flying hight of the unit to different values. (For the dummy unit model, be sure to use a projectile, like an arrow)

Then, when a value is just right, like the lowest possible value to get a headshot with, then apply that to your trigger. This worked for me quite well.
 
There aren't any direct natives for finding a unit's height. Do you mean height as in 6 feet tall height or do you mean Z off the ground?

For the second one, you can use:
JASS:
native          GetUnitFlyHeight        takes unit whichUnit returns real
native          GetUnitDefaultFlyHeight         takes unit whichUnit returns real

EDIT: Whoops, I thought this was in the JASS forum for a second. :p
 
Level 12
Joined
Aug 10, 2004
Messages
1,141
I'm not sure if its possible, I don't hve WE up right now but I'm in a similar situation with height

For a Warcraft FPS-which I haven't taken seriously, but still plan on working on it

The Way i'm imagining fixing the problem would be putting the unit in a unit group

Unit casts spell
-Spell Equal to "I got a Big arse gun that I'm shooting... dayum..."
--Detect if unit got hit by Shockwave (Air and Ground) (1 area of effect)
--If then scenario
---If a unit gets hit by shockwave
---And THe Unit is in Unit Group X
-Then-If then scenario
-if- the Z aim of shooter is less then or equal (Head+FLing Height) (If the unit is in that particular group then just writing a value that detects both flying height and size)
-If- the Z aim of shooter is greater then or equa to (Flying height-Feet)

So pretty much your aimer detects both flying height, Top of the head and feet...
Though Your going to have to do it manually since I don't think you can detect real sizes in Warcraft
 
Status
Not open for further replies.
Top