• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Terrain Trap

Status
Not open for further replies.
Level 2
Joined
Jun 12, 2010
Messages
7
Hey guys,
I'm trying to do a lava trap where every unit standing inside the lava tile gets 50 dmg every .50 sec.

The problem is how do I detect the triggering units?

I can't work with areas (would be about 50 for the whole lava)
Till now i kinda solved the problem with "A unit gets a order without target" etc.

Can someone help me?
 
Level 11
Joined
Jun 20, 2009
Messages
880
  • Dmg
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Set TempLoc = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain type at TempLoc) Equal to Dungeon - Lava
            • Then - Actions
              • Unit - Cause Clint Eastwood 0000 <gen> to damage (Picked unit), dealing 50.00 damage of attack type Spells and damage type Normal
              • Custom script: call RemoveLocation(udg_TempLoc)
            • Else - Actions
Variables needed:
TempLoc - Point Variable
 
Level 5
Joined
Nov 30, 2010
Messages
184
There is a condition that checks what terrain the unit is on.
The trigger will be like this:
Event: every 0.5 seconds
Condition:
Action: pick every unit in playerable map area and do multiple actions
Loop - set tempPoint (a point variable) to position of picked unit
If then else multiple actions
If terrain type at tempPoint is equal to lava
Then set health of picked unit to health of picked unit - 50
 
Last edited:
Level 14
Joined
Nov 18, 2007
Messages
1,084
  • Dmg
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Set TempLoc = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain type at TempLoc) Equal to Dungeon - Lava
            • Then - Actions
              • Unit - Cause Clint Eastwood 0000 <gen> to damage (Picked unit), dealing 50.00 damage of attack type Spells and damage type Normal
              • Custom script: call RemoveLocation(udg_TempLoc)
            • Else - Actions
You should put
  • Custom script: call RemoveLocation(udg_TempLoc)
outside of the if.
 
Status
Not open for further replies.
Top