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

Damaging all units inside the region

Status
Not open for further replies.
Can someone help me make a trigger where all "ground, organic units" will be damaged when inside the region? (A trigger where their life will decrease (-10 life) every second).

  • Skirmish Storm Radiation
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Picked unit)) Equal to Barbarians Peasant [Barbarians])) and do (Actions)
        • Loop - Actions
          • Wait 1.00 seconds
          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 1.00)
This one don't seems to work for some reason, i suck at triggering anyway.
 
Level 12
Joined
Jan 2, 2016
Messages
973
Event: Every 1 seconds
Actions: Pick every unit in (The region you want) and do multiple actions
Loop:
if picked unit is ground unit equal to true
picked unit is equal to structure equal to false
picked unit is equal to mechanical equal to false
Then:
----------------------------------------------------
way 1: Set life of picked unit to (life of picked unit - 10)
----------------------------------------------------
way 2: (create a dummy before the loop, and give it expiration timer)
Cuase Last Created Unit to damage Picked unit for 10 damage, attack type Chaos, damage type Universal
 
way 2: (create a dummy before the loop, and give it expiration timer)
Cuase Last Created Unit to damage Picked unit for 10 damage, attack type Chaos, damage type Universal
That's going to double the population of the units in the map if i am understanding it right because it will make a dummy unit on every singe unit (matching the condition) existing on the map.

Anyway, i tried the way 1 and it works, thanks man!
---
Damn im weak at logic conditions.
 
Level 12
Joined
Jan 2, 2016
Messages
973
That's why I said "(create a dummy before the loop, and give it expiration timer)".
Then you will create just 1 dummy per second (and by giving it an expiration timer for 0.5 seconds - it will last only half of the time until you spawn the next one.
So the trigger will actually look like this:
Event: Every 1 seconds
Actions: Create 1 Dummy for Neutral Extra at Dummy_Point facing 0.00 deg
Add 0.5 seconds Generic expiration timer to Last Created Unit
Pick every unit in (The region you want) and do multiple actions
Loop:
if picked unit is ground unit equal to true
picked unit is equal to structure equal to false
picked unit is equal to mechanical equal to false
Then: Cuase Last Created Unit to damage Picked unit for 10 damage, attack type Chaos, damage type Universal
 
That's why I said "(create a dummy before the loop, and give it expiration timer)".
Then you will create just 1 dummy per second (and by giving it an expiration timer for 0.5 seconds - it will last only half of the time until you spawn the next one.
So the trigger will actually look like this:
Event: Every 1 seconds
Actions: Create 1 Dummy for Neutral Extra at Dummy_Point facing 0.00 deg
Add 0.5 seconds Generic expiration timer to Last Created Unit
Pick every unit in (The region you want) and do multiple actions
Loop:
if picked unit is ground unit equal to true
picked unit is equal to structure equal to false
picked unit is equal to mechanical equal to false
Then: Cuase Last Created Unit to damage Picked unit for 10 damage, attack type Chaos, damage type Universal

Yeah sure whatever, the first way is enough anyway, thank you once again :)
 
Status
Not open for further replies.
Top