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

How to make an group empty again?

Status
Not open for further replies.
Level 4
Joined
May 4, 2007
Messages
52
Hello again!

Now i got another problem i hope u can help me whit :D ^^

I have created a player-group with variables, when a players unit dies (the runner) the owner of the unit is added to the player group so that when someone comes and enters a region all players that are in the group gets a new runner (rescuing..) but how can i after that make the player group empty so that u dont get more heros if someone rescues if u even aren't dead?

i send an code..
Code:
Rescue
    Events
        Unit - A unit enters Make Kodo Move <gen>
    Conditions
        (Unit-type of (Entering unit)) Equal to Runner
    Actions
        Player - Add Gold_Award to (Owner of (Entering unit)) Current gold
        Set Gold_Award = 0
        Unit Group - Pick every unit in (Units in Make Kodo Move <gen>) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Unit-type of (Picked unit)) Equal to Flag
                    Then - Actions
                        Unit - Move (Picked unit) instantly to (Random point in Start <gen>)
                        Player Group - Pick every player in Flag_Group and do (Actions)
                            Loop - Actions
                                Unit - Remove (Picked unit) from the game
                                Unit - Create 1 Runner for (Picked player) at (Random point in Start <gen>) facing Default building facing degrees
                    Else - Actions
                        Do nothing

after the "Unit - Create 1 Runner for (Picked player) at (Random point in Start <gen>) " i would like something that makes the group empty again thankful for answers..
 
Level 1
Joined
Jan 7, 2008
Messages
6
With "Player Group - Remove Player 1 (Red) from Player Group - Player 1 (Red)
" you should work it out.
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
I don't know what that trigger is supposed to do, but the "Unit - remove (picked unit) from the game" action doesn't need to be inside the player group loop, instead just do this:

  • Rescue
    • Events
      • Unit - A unit enters Make Kodo Move <gen>
    • Conditions
      • (Unit-type of (Entering unit)) Equal to Runner
    • Actions
      • Player - Add Gold_Award to (Owner of (Entering unit)) Current gold
      • Set Gold_Award = 0
      • Unit Group - Pick every unit in (Units in Make Kodo Move <gen>) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Flag
            • Then - Actions
              • Unit - Remove (Picked unit) from the game
              • Player Group - Pick every player in Flag_Group and do (Actions)
                • Loop - Actions
                  • Unit - Create 1 Runner for (Picked player) at (Random point in Start <gen>) facing Default building facing degrees
            • Else - Actions
              • Do nothing
Finally, to destroy a playergroup, add the custom script
call DestroyForce (udg_Flag_Group)
 
Status
Not open for further replies.
Top