I need help making a trigger that kills all the units of players that are not in the game, and end game for defeat for that player. I have placed units that are there in the beginning of the map for them, so I need help having them killed if the owner of the units is not in the game.
I need help making a trigger that kills all the units of players that are not in the game, and end game for defeat for that player. I have placed units that are there in the beginning of the map for them, so I need help having them killed if the owner of the units is not in the game.
Ammi'doin'it'right?
Event:
(Any Player) Leaves The Game
Action:
Pick All Units In (Entire Map) Owned By (Triggering Player)
I'm not sure if that would remove pre-placed units. You could try putting a loop in map initialization:
For x from 1 to 15 (num of max players) do:
if controller of player x != user
pick all units etc
If you just kill the units of players who leave then you will not correctly remove pre placed units. uiasdnmb was on the right track however his way will remove anything controlled by a computer player and if you do just that it won't remove players who leave. You must implement both a trigger to remove all the units of any player who leaves and a trigger like this psedocode.
Variable Remove Group (Player Group) = all players
For each player Player in player group active players
remove player Player from player group Remove Group
You may want to manually remove neutral & hostile from the player group here if you use them.
For each player Player in Remove Group
pick each unit and remove it from the game
I need help making a trigger that kills all the units of players that are not in the game, and end game for defeat for that player. I have placed units that are there in the beginning of the map for them, so I need help having them killed if the owner of the units is not in the game.
Ammi'doin'it'right?
Event:
(Any Player) Leaves The Game
Action:
Pick All Units In (Entire Map) Owned By (Triggering Player)
* Kill (Picked Unit)
If you just kill the units of players who leave then you will not correctly remove pre placed units. uiasdnmb was on the right track however his way will remove anything controlled by a computer player and if you do just that it won't remove players who leave. You must implement both a trigger to remove all the units of any player who leaves and a trigger like this psedocode.
Variable Remove Group (Player Group) = all players
For each player Player in player group active players remove player Player from player group Remove Group
You may want to manually remove neutral & hostile from the player group here if you use them.
For each player Player in Remove Group pick each unit and remove it from the game
hope that helps
If he only wants to have 1 unit yes but if players have entire pre-placed cites, armies, ect then no.