Detecting unit standing in shallow and deep water

gameshow

New Member
Reaction score
1
I saw a post on this, which mentioned pathability tests, which also went right over my head. How can i detect, using triggers, if a unit is in shallow or deep water?
 

WolfieeifloW

WEHZ Helper
Reaction score
372
I don't believe so.
There's a way to determine what type of tileset the unit is on, but waters aren't listed.
 

WolfieeifloW

WEHZ Helper
Reaction score
372
No, different terrain-type's such as Lordaeron Dirt, Northrend Snow, Outland Rough Dirt, etc.

EDIT: You mean regions for water?
I guess you could do that.
Again, as far as I know, someone else could know how.
 

gameshow

New Member
Reaction score
1
Yeah, i meant just spamming regions all over my water (really not ideal - i expect terrain layout to change a lot)
 

WolfieeifloW

WEHZ Helper
Reaction score
372
For shallow water you can actually control which terrain-type it is for the bottom.
You could then save one specific type for shallow water and use that;
Then use a terrain-type comparison.
Deep water might actually use a terrain-type on the bottom of it in which case a type comparison would work;
As long as you only use that type of terrain in the water.
 

gameshow

New Member
Reaction score
1
That may be a good option (tho it makes it hard to have my rivers look good). I think there may be a JASS avenue that will work for me. Some function called IsTerrainPathable, and running a check on "float". i'm checking it out now
 

gameshow

New Member
Reaction score
1
Heh, me neither, but I have done a fair bit of c/c++ programming, so hopefully it isn't a big deal to pick up.
 

Naga'sShadow

Ultra Cool Member
Reaction score
49
There's a boolean condition terrain pathability. I know options include naval and amphibious, deep and shallow water. I'd offer more help but I was never able to get that specific trigger working.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> I think there may be a JASS avenue that will work for me.

FWIW, that works in GUI too...

Trigger:
  • Pathability
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Set Point = (Position of <some pre-placed unit that you can walk around>)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain pathing at Point of type Walkability is off) Equal to False
        • Then - Actions
          • Game - Display to (All players) the text: Walk
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain pathing at Point of type Buildability is off) Equal to False
        • Then - Actions
          • Game - Display to (All players) the text: Build
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain pathing at Point of type Floatability is off) Equal to False
        • Then - Actions
          • Game - Display to (All players) the text: Float
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain pathing at Point of type Amphibious Pathing is off) Equal to False
        • Then - Actions
          • Game - Display to (All players) the text: Amphibious
        • Else - Actions
      • Custom script: call RemoveLocation(udg_Point)


Give yourself some unit, walk around a bit, and press "escape" in interesting spots.

Shallow water shoud say "walk" and "float".
Deep water only says "float".

"Amphibious" applies to all of them so it isn't all that useful.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top