I'm not too keen on triggers at all, and from what I can tell, setting up victory and defeat triggers are a real hassle. I really wish the editor had a simple "game rules" thing where you could select team vs team, deathmatch, free-for-all, etc.
Anyway, I need to know the exact triggers I would need to put into a 4-player map for both defeat and victory. Defeat would be when all a player's units are destroyed, victory when all opposing players units are destroyed.
Of course, I also need to figure out how to set up the game as a free-for-all. Right now it's stuck as a 3v1 team battle, and I can't figure out how to change team/ally settings.........
EDIT: actually, what we need are just a few blank maps with the basic triggers already implementedthings like victory and defeat, and starting up player cameras over player starting positions.
Create a new trigger and name it whatever you want. Create a new event and set it to map Initialization.
Create a new action and choose set alliance for player group. Click the Player Group link at the bottom and select All Players in the window that comes up. Then click the ally with shared vision link and choose enemy.
Ok so now we have to take care of the defeat trigger.
Create a new trigger and name it whatever you want. Set the event to be unit dies. Create a condition, select comparison in the window that comes up but do not click ok. Instead click the Value 1 link. At the top choose functions and choose "Number of Units in Unit Group" and hit ok. Now under Value 1: click Unit Group. Click Function in the top. Chose units in region matching condition. hit ok. Now choose Player: Any at the bottom. Click function and choose owner of unit. Then for value 2 enter the value 0. Now add an action of End Game, and choose defeat and for owner of unit.
So for the victory trigger,
Events
Player - Player Any Player leaves the game with Any
Conditions
(Number of players in (Active Players)) == 1
Actions Player Group - Pick each player in (Active Players) and do (Actions)
Actions
Game - End game in Victory for player (Picked player) (Show dialogs, Show score screen)
for the event, chose player leaves game and change with victory to any. for the condition choose number of players in player group, and then active players as th eplayer group. Make it equal to value 1 fro actions choose pick each player in player group, change it to active players. then under actions for that, choose end game, and choose victory.
Create a new trigger and name it whatever you want. Set the event to be unit dies. Create a condition, select comparison in the window that comes up but do not click ok. Instead click the Value 1 link. At the top choose functions and choose "Number of Units in Unit Group" and hit ok. Now under Value 1: click Unit Group. Click Function in the top. Chose units in region matching condition. hit ok. Now choose Player: Any at the bottom. Click function and choose owner of unit. Then for value 2 enter the value 0. Now add an action of End Game, and choose defeat and for owner of unit.
this script doesnt target any unit its just an empty code
I'm not too keen on triggers at all, and from what I can tell, setting up victory and defeat triggers are a real hassle. I really wish the editor had a simple "game rules" thing where you could select team vs team, deathmatch, free-for-all, etc.
Anyway, I need to know the exact triggers I would need to put into a 4-player map for both defeat and victory. Defeat would be when all a player's units are destroyed, victory when all opposing players units are destroyed.
Of course, I also need to figure out how to set up the game as a free-for-all. Right now it's stuck as a 3v1 team battle, and I can't figure out how to change team/ally settings.........
EDIT: actually, what we need are just a few blank maps with the basic triggers already implemented
things like victory and defeat, and starting up player cameras over player starting positions.to start i can help you with the ally problem.
Create a new trigger and name it whatever you want. Create a new event and set it to map Initialization.
Create a new action and choose set alliance for player group. Click the Player Group link at the bottom and select All Players in the window that comes up. Then click the ally with shared vision link and choose enemy.
Ok so now we have to take care of the defeat trigger.
Create a new trigger and name it whatever you want. Set the event to be unit dies. Create a condition, select comparison in the window that comes up but do not click ok. Instead click the Value 1 link. At the top choose functions and choose "Number of Units in Unit Group" and hit ok. Now under Value 1: click Unit Group. Click Function in the top. Chose units in region matching condition. hit ok. Now choose Player: Any at the bottom. Click function and choose owner of unit. Then for value 2 enter the value 0. Now add an action of End Game, and choose defeat and for owner of unit.
So for the victory trigger,
Events
Player - Player Any Player leaves the game with Any
Conditions
(Number of players in (Active Players)) == 1
Actions Player Group - Pick each player in (Active Players) and do (Actions)
Actions
Game - End game in Victory for player (Picked player) (Show dialogs, Show score screen)
for the event, chose player leaves game and change with victory to any. for the condition choose number of players in player group, and then active players as th eplayer group. Make it equal to value 1 fro actions choose pick each player in player group, change it to active players. then under actions for that, choose end game, and choose victory.
Hm... thank you. That was very clear and helpful.
sry for the late bump but....
this part wasnt clear at all
Create a new trigger and name it whatever you want. Set the event to be unit dies. Create a condition, select comparison in the window that comes up but do not click ok. Instead click the Value 1 link. At the top choose functions and choose "Number of Units in Unit Group" and hit ok. Now under Value 1: click Unit Group. Click Function in the top. Chose units in region matching condition. hit ok. Now choose Player: Any at the bottom. Click function and choose owner of unit. Then for value 2 enter the value 0. Now add an action of End Game, and choose defeat and for owner of unit.
this script doesnt target any unit its just an empty code