How To Get The Height Of A Unit's Chest

WolfieeifloW

WEHZ Helper
Reaction score
372
I'm using lightning effects and need to make the effect attach to the unit's chest.
I'm using this:
JASS:
call MoveLightningEx(d.l, true, d.cx, d.cy, 75., d.tx, d.ty, 75.)

But that obviously won't work for all units since their size changes.
I need to find the "Z" for a unit's chest;
Is this possible?

EDIT: The native:
JASS:
native MoveLightningEx takes lightning whichBolt, boolean checkVisibility, real x1, real y1, real z1, real x2, real y2, real z2 returns boolean
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
Other than going and looking at all the model information, I don't see how. It's different for every unit, some don't even have chests. There is no GetUnitBodyPartZ.

Of course there's always estimating based on the unit's Z position, but no way of actually getting the value.
 

Romek

Super Moderator
Reaction score
964
Use a rough guess.
GetUnitFlyHeight + ~75 will work for most units.
 

WolfieeifloW

WEHZ Helper
Reaction score
372
Alrighty.
That'll work I guess.
Just use "+ GLOBALVAR" ;) .

Someone should make someway to get a Z for certain things.
-looks at Jesus4Lyf and/or Vexorian-
 

Romek

Super Moderator
Reaction score
964
> Someone should make someway to get a Z for certain things.
GetUnitFlyHeight does that.

Getting a units chest would require attaching values to unit IDs, probably using Table.
It's easy to do, but it'd be very, very boring and time-consuming.
 

Romek

Super Moderator
Reaction score
964
> Change the "X" value, right?
And Y Value.
 

Rainther

I guess I should write something of value here...
Reaction score
61
left and right as in west and east is X, yes.

up and down, or north and south is Y. :D
 

Jesus4Lyf

Good Idea™
Reaction score
397
Someone should make someway to get a Z for certain things.
-looks at Jesus4Lyf and/or Vexorian-
Actually, I was thinking about this the other day, and realised... there is a way to get it.

Which I haven't tried.

Make a doodad with the model you want the height for, and then set it to walkable, and create one get the terrain Z. Remove the doodad, get the terrain Z again. Then you know the height of the unit... (and of course could do this for its different animations? :))

I was originally gonna make a spell which would rain down particles on units and have them bounce off their limbs and everything at the correct angles. Then I realised... why the hell would I do that? XD

I'd use a constant for this too, probably. :thup:

PS. I don't think you could use this method dynamically, for any unit, however. <_<
 

DonRoman

New Member
Reaction score
5
Save the chest z values for specific unit types (which are by far too big or small) in a table and for the rest use a constant value xD

Take care when using CreateLightningEx you got to take into consideration the terrain height, so it would be: GetLocationZ(loc) + GetUnitFlyHeight(unit) + ~ 75
 

GetTriggerUnit-

DogEntrepreneur
Reaction score
129
Yea, when creating unit, make 3 categories: small : medium : big.

Then use the "Point Value" 1, small : 2, medium : 3, big.
Then when attaching it, you can know if unit is small, medium of big, by asking it point value

**Point value are like custom values, unless you can't change them by triggers and it's set in the object editor. And obviously it won't bug because it's not a custom value.
 

Viikuna

No Marlo no game.
Reaction score
265
You should use Table to attach stuff to unit types, like Romek suggested.

Its usually good to know stuff like, units collinsion size, base armor, attackspeed, damage point, attack damage, primary attribute. ( If it is a hero )
 

WolfieeifloW

WEHZ Helper
Reaction score
372
Make a doodad with the model you want the height for, and then set it to walkable, and create one get the terrain Z. Remove the doodad, get the terrain Z again. Then you know the height of the unit... (and of course could do this for its different animations? :))
Huh :p ?
I think I get it, but how would you get his chest :eek: ?

I was originally gonna make a spell which would rain down particles on units and have them bounce off their limbs and everything at the correct angles. Then I realised... why the hell would I do that? XD
:p .


Anyways, the finished spell, which uses this, can be seen here.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top