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

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