• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Water depth, Get location Z doesn't work.

Status
Not open for further replies.
Level 7
Joined
Apr 27, 2008
Messages
94
I was wondering if there is any way to calculate the depth of the water at (taking into account noise), say the current point of a unit (assuming the unit is walking in shallow water)? Get location Z only calculates to the surface of the water, so I was curious if there was some sort of work around (most likely in JASS, but I work in GUI.) Thanks!
 
Level 10
Joined
May 26, 2005
Messages
194
I ran into that problem once, too... for projectiles flying above water (with modified pathing types, well at least it was the same problem)

And I could not find a solution back then, I doubt there is one.

The difference in height is very small, so I think its best to just ignore this difference...

Otherwise, if its possible in your map (probably not), use custom water -> a little model instead of the actual wc3 water... but that isnt a very nice solution.

Another idea: Ive not tried it yet, and it should be laggy, but it could work... You could create terrain deformations not affecting water, increase the terrain height a lot, use GetLocationZ() then, and restore the old terrain height... laggy and annoying...

If its important, and needs to be fast, you could do all this on map start and save the values in a giant bunch of arrays... not recommended, but its the fastest option ingame probably... requires long loading time though

however, as i already said, my recommendation is to just forget about this little difference, or make shallow water even more shallow... OR you make the cliffs steeper, and shallow water on the same height everywhere, then you can always subtract a constant value from GetLocationZ()...

still best: forget about it
 
Level 7
Joined
Apr 27, 2008
Messages
94
I am randomly generating terrain for the map that I am working on, and it is turning out quite well. Water depth would still be relevant if I want to add in shallow water areas, but I am fine with just a blanket statement at the moment with water. Since it is randomly generated, the pathing map was really screwed up, so I just had to re-path the entire map. :wink:
 
Level 9
Joined
Jul 20, 2009
Messages
427
A random terrain generator?Now that's something to look forward to.Would you mind sharing that system once its done..
 
Status
Not open for further replies.
Top