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

JASS (mby) - Detection of swimming unit

Status
Not open for further replies.
Level 4
Joined
Apr 26, 2011
Messages
65
Is it possible to detect if unit is swimming ? Example: If naga enters deep water, it aquires ms bonus... if it goes to swallow water or on land, movement bonus will be removed.
Do you think it is possible ?
 
Make two checks every 0.10 seconds:
  • Actions
    • Set Point = (Position of (Picked unit))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Terrain cliff level at Point) Equal to 0
        • (Terrain pathing at Point of type Floatability is off) Equal to False
      • Then - Actions
        • -------- Actions here --------
      • Else - Actions
    • Custom script: call RemoveLocation (udg_Point)
The default cliff level has a deep water of level 0, while normal ground level and shallow water are on 2 and 1 respectively. Up to the cliff level of your map, change that.
 
Status
Not open for further replies.
Top