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

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