• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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