• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

check if terrain at a point is water

Status
Not open for further replies.
check if the point is walkable, shallow water is walkable, deep is not(unless you put some blockers in shallow water)

You could also check the Z coordinate of the point, if it is > -80 or w/e(I dont know how deep deep water is considered to be) then you are in shallow water, if it is lower, you are in deep water

I didnt try any of those, but the first should work, I dont know if you can get negative Z coordinate tho
 
i'm planning on using it with an ability, is there a way to stop anything not walkable being targeted? would the z axis one also pick up if the terrain was lowered but not water?
 
I don't think you can differentiate between deep and shallow water (I may be wrong), but you can tell if a point is water or now by using this condition:

(Terrain pathing at Point of type Floatability is off) Equal to False

or

Set Point = Wherever
Custom script: set udg_Real = GetLocationZ( udg_Point )

Water has a height of precisely 166.400
 
I don't think you can differentiate between deep and shallow water (I may be wrong)

  • Untitled Trigger 001
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • Set p = (Position of u)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain pathing at p of type Floatability is off) Equal to False
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain pathing at p of type Walkability is off) Equal to True
            • Then - Actions
              • Game - Display to Player Group - Player 1 (Red) the text: deep water
            • Else - Actions
              • Game - Display to Player Group - Player 1 (Red) the text: shallow water
        • Else - Actions
          • Game - Display to Player Group - Player 1 (Red) the text: not water
  • Custom script: call RemoveLocation(udg_p)
 
You're right. If you just create a map without changing the base height that's what the value is.

And, Maker, thanks for proving me wrong. It's good to know!
 
I used your suggestion Derdan then ran into this problem however i just grabbed the water heights in game, which all end in .400. then i tested other areas of the map and didn't come close to one of those values so hopefully it doesn't cause any issues.

  • Untitled Trigger 001
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • Set p = (Position of u)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain pathing at p of type Floatability is off) Equal to False
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain pathing at p of type Walkability is off) Equal to True
            • Then - Actions
              • Game - Display to Player Group - Player 1 (Red) the text: deep water
            • Else - Actions
              • Game - Display to Player Group - Player 1 (Red) the text: shallow water
        • Else - Actions
          • Game - Display to Player Group - Player 1 (Red) the text: not water
  • Custom script: call RemoveLocation(udg_p)

Also I can't seem to find these conditions?
 
Well the best solution to detect if the water is deep or not ... You should use an invisible dummy using a trigger to detect it's height . Well the deep water has a lesser height then the shallow water :p
Condition : Integer Condition - Height of 'dummy' less or equal to 'height'

getting the z location from above gave me the same height for shallow and deep?
 
Using Z location will indeed give you the same value for shallow and deep. If you look at Maker's trigger, the conditions can be found under Boolean > Environment.
 
Status
Not open for further replies.
Back
Top