• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Unit Group and periodic tiggers

Status
Not open for further replies.

hdm

hdm

Level 9
Joined
Nov 19, 2011
Messages
384
How should I use the unit group to not damage the targets more than once in periodic triggers ? I mean, the units must be on any group and them changed to other when they're damaged or they shouldn't be in any group and them I add them to one when they are damaged ?

How the trigger should look like ? If you can do it by [triggers] [/triger] would be awesome.
 
Level 4
Joined
Sep 9, 2010
Messages
72
  • Actions
    • Player Group - Pick every player in (All players) and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Targeted_Unit is in Your_Unit_Group[(Player number of (Picked player))]) Equal to False
          • Then - Actions
            • Unit - Cause Your_Unit to damage Targeted_Unit, dealing x damage of attack type Spells and damage type Normal
            • Unit Group - Add Your_Unit to Your_Unit_Group[(Player number of (Picked player))]
          • Else - Actions
            • Do nothing
This is what I am using, you just need to clear that unit group when you turn off that trigger.

I hope it helps.

P.S. If you want a unit from a unit group to do the damage just use this:
  • Unit Group - Pick every unit in Your_Unit_Group and do (Actions)
    • Loop - Actions
      • -The Function from above-
 
Last edited:
  • Like
Reactions: hdm
Status
Not open for further replies.
Top