• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

A question about GetLocationZ

Status
Not open for further replies.
So its pretty much only a graphical function right? Like let's say I want to make a full house intense type of map that uses a lot of projectiles which has to collide with other units in the air as well as terrain/mountains however what if I want them to take terrain level into account so it doesn't look lame sliding?

Also technically since flying height doesn't desync by itself, you should be able to locally set it for pretty cool effects in a multi player game.
 
Level 26
Joined
Aug 18, 2009
Messages
4,099
Clarify the question. GetLocationZ returns the terrain height of a spot, according to the local player's information of that spot, which may be async if for example there is a deformation but the player does not see it due to fog of war. Terrain height is also affected by walkable destructables like bridges. In case such destructable is animated, the terrain height is too. Flying height is only for graphical purposes in standard wc3, it does not alter the gameplay.
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
I have air-collision in my Missile System.
I pick units that collide on the X + Y axis and check if the flying height of the missile is not larger or smaller than the flying height of the unit with (Height) as maximum difference.
In that case you do not require GetLocationZ(). I do use it to calculate the route of the missile though.
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
Well you can indeed increase precision by also adding the difference (in same order) between the GetLocationZ() of missile and unit.
But as they are basically at the same spot. The GetLocationZ() would be almost the same.
So you basically add/remove 0-10 to the difference. You tell me if you think it is worth it or not...
I can see that some people wouldn't care.
 
Level 26
Joined
Aug 18, 2009
Messages
4,099
Even if you are not adding the terrain height in your collision check, basing it on flying height puts it in a sync context. And you most-likely set the flying height depending on terrain height anyway. You would normally save the current z of the missile in a variable and operate on that.
 
Status
Not open for further replies.
Top