HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Getting Unit flying height

08-31-2009, 07:53 PM#1
Mendel
I was told that the only way to get a ground unit flying height is by using jass command GetUnitFlyingHeight.. dunno, i am not a jass man :D
So my Question is:
If i put different mountains using The Height Toll, Not Cliff. (Cliff tool makes normals cliffs i am talking about the one wich only raises the land...)
Does the flying height of the unit wich is walking above them gets affected by the height?
And if it is
i would realy aprreciate it if some one could write me a short jass command wich will detect every 0.1 seconds the flying height of each variable "hero"array from 1 to 6 (unit variable)

Hero[1} = bla bla
Hero[2] = bla bla...
u get the point :]

i would realy aprreciate it, thanks in advance
08-31-2009, 09:07 PM#2
Zerzax
Unless you change it, flying height remains constant. The only variation occurs in terrain height. When terrain height changes, the game engine constantly raises or lowers the unit (without changing fly height) based on the terrain height of the point it is hovering over.
09-01-2009, 12:28 AM#3
Silvenon
There is a JASS trick to get the terrain height of a certain point (in case you need it some time):

Trigger:
GetLocationZ
Events
Conditions
Collapse Actions
Set Loc = ...
Custom script: set udg_TerrainHeight = GetLocationZ(udg_Loc)

So you would need two globals: a point and a real variable. You can name them whatever you want, just remember to rename those parts in the custom script call to your custom names (those parts after udg_).

I don't know why I just did that, I thought I just spam a bit.
09-01-2009, 11:25 AM#4
Mendel
Quote:
Originally Posted by Zerzax
Unless you change it, flying height remains constant. The only variation occurs in terrain height. When terrain height changes, the game engine constantly raises or lowers the unit (without changing fly height) based on the terrain height of the point it is hovering over.
So.. how can i get the ground units height, i need this for 3rd view camera :S

Quote:
Originally Posted by Silvenon
There is a JASS trick to get the terrain height of a certain point (in case you need it some time):


Trigger:
GetLocationZ
Events
Conditions

Actions
Set Loc = ...
Custom script: set udg_TerrainHeight = GetLocationZ(udg_Loc)


So you would need two globals: a point and a real variable. You can name them whatever you want, just remember to rename those parts in the custom script call to your custom names (those parts after udg_).

I don't know why I just did that, I thought I just spam a bit.
does it change if the ground is raised using the height tool?
09-01-2009, 11:32 AM#5
Anachron
Quote:
Originally Posted by Mendel
does it change if the ground is raised using the height tool?
Yes
09-01-2009, 11:49 AM#6
Mendel
i need the 1.24 expansion for this?
09-01-2009, 11:55 AM#7
Chocobo
no.
09-01-2009, 12:03 PM#8
Mendel
I Don't understand what to write after u did there Set Loc=...
let's say i want to know the height of mounain king 001 for example... how do i set this loc :S
that Loc is a real variable?

Edit nvm i got it! Huge thanks you all !! :D