• 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.

Getting terrain/unit height or verticle angle?

Status
Not open for further replies.
Level 1
Joined
Apr 8, 2006
Messages
3
Hey, I've searched and searched in WE as well as on the forums, and I can't seem to find any way to grab terrain height or a verticle angle.

Essentially I'm creating a gun map where you can fire at just about anyone, but you have low chances to hit if the target is in trees, above you, far away, etc.
All my cliff levels are the same because I wanted rolling hills and beaches.
The shot is calculated by a trigger, which gathers up different variables such as distance and amount of obstructions.
I have most of the math worked out, if I can just figure out how to tell if, and how far, a unit is above or below another!

Thanks in advance for any help! ^^
 
Level 6
Joined
Feb 18, 2005
Messages
263
there is a function - but it's jass only:

GetLocationZ(location) returns real

the function has one disadvantage: it is asyncronous

i du not know, whether that may couse many bugs, but i heard, that as long as you run it for other than the host-player serversplits may happen
 
Level 10
Joined
Jul 14, 2004
Messages
463
Well, maybe it should be said, that this function returns the height of the pathing map. That means the grid you can show in WE and brigde-like (walkable) objects.
Say if you need more help because you can only enter it as custom text. :wink:

@Lord Raszul: What do you mean by "asycronous" (don't know the word and don't find it in any dictionary)?
 
Level 6
Joined
Feb 18, 2005
Messages
263
i missspelled it. it should have been written "asynchronous"

i quote from the file "common.j"

JASS:
// This function is asynchronous. The values it returns are not guaranteed synchronous between each player.
//  If you attempt to use it in a synchronous manner, it may couse a desync.

i am not quite shure what this means, but i guess tha,t if you use it like "ForEachPlayer... GetLocationZ(..." there might by a serversplit (desync)
 
Status
Not open for further replies.
Top