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

Deadly terrain

Status
Not open for further replies.
Level 7
Joined
Sep 19, 2020
Messages
190
tt8d_untitled.png

Can make deadly terrain (e.g. unit move to transparency grass "Black", Die). Can Do? (without region)
 
for event use: Unit enters region (Playable Map Area)?
No, a periodic trigger.

Save the location of the units that will die if they exit that area, save their locations to a point variable and then do a if/then/else terrain check at the saved location. Run the trigger at 0.1 or similar. Remember to clear the location when you are done using it.

Memory Leaks
Things That Leak
 
Level 7
Joined
Sep 19, 2020
Messages
190
No, a periodic trigger.

Save the location of the units that will die if they exit that area, save their locations to a point variable and then do a if/then/else terrain check at the saved location. Run the trigger at 0.1 or similar. Remember to clear the location when you are done using it.

Memory Leaks
Things That Leak
Can u send a trigger example?
 
  • Kill Units On Abyss
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Set VariableSet TempGroup = (Units in (Playable map area))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Set VariableSet TempLoc = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
              • (Terrain type at TempLoc) Equal to Outland - Abyss
            • Then - Actions
              • Unit - Kill (Picked unit)
            • Else - Actions
          • Custom script: call RemoveLocation (udg_TempLoc)
      • Custom script: call DestroyGroup (udg_TempGroup)
 
Level 21
Joined
Dec 4, 2007
Messages
1,478
^ That can work, but what if your trespassing unit is under the effect of spell immunity like avatar?
 
Status
Not open for further replies.
Top