• 🏆 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!

damaged when entering water?

Status
Not open for further replies.
Well, create a periodic trigger and make a check:
  • Water Damage
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Custom script: if IsTerrainPathable (GetUnitX (GetEnumUnit()), GetUnitY (GetEnumUnit()), PATHING_TYPE_FLOATABILITY) == false then
          • Unit - Cause (Picked unit) to damage (Picked unit), dealing 20.00 damage of attack type Normal and damage type Normal
          • Custom script: endif
By the way, I'd use regions or some submerge trick to check that.

Test Map:
 

Attachments

  • Water Damage.w3x
    17.3 KB · Views: 51
Status
Not open for further replies.
Top