I need some help with victory and defeat conditions in my map.
My map is playable in 1v1, 2v2 and 3v3 and at the start each player chose one special unit (with massive attribut) in a dialog. What I want is when all specials units of a team are destroyed, the team loses and the other team wins.
So if the game is played in 3v3, each player of a team must lose their special unit to lose the game (In 3v3 if only two player, in the same team, lose their special unit the game still continues until the third player of that team lose his special unit or the other team lose all their specials units).
I try multiple times but I cant find something that work.
The last trigger I try was something like this, if their is no units with massive condition on the map for team 1, each player in team 1 is defeated and each player in team 2 win and if their is no units with massive condition on the map for team 2, each player in team 2 is defeated and each player in team 1 win.
How should I do this guys? Anyone as an idea and can help me out?
I think you want to use Variables for each special unit. For example team have 3 points at beginning of map and when 1 special unit dies modify variable by -1 and when team (=players in player group) have 0 points they lose.
Thats my idea in short.
Ask any more specfic questions since I don't know how much you already know about triggers. I'm trying to help you out :)
Thank you for your time, yeah I am not really good with triggers but I already play around with them a little bit, I am not a complete newbie ;)
I try your idea, first I create 2 variables, one for each team (integer, value 0) and I create for both team a trigger to be equal to the number of players in the team to function in all 3 modes (1v1, 2v2, 3v3) the trigger looks like this for team 1 :
Events : map creating
Actions : if number of players in team 1 = 1
then define variable team 1 = 1
if number of players in team 1 = 2
then define variable team 1 = 2
if number of players in team 1 = 3
then define variable team 1 = 3
the 2nd trigger for team 1 looks like this :
Events : any unit dies
Conditions : Or and I put each special triggering unit
Actions : if owner of triggering unit equal owner of triggering unit in team 1 (dont know if work)
then variable modify team 1 : -1
if team 1 variable = 0
then pick each player in team 1 and do end game in defeat for players picked
then pick each player in team 2 and do end game in victory for players picked
That didnt work. I dont know which part is good, could you tell me where are the mistakes?
(I also need to add events if players leaves the game but for now I want to finish this)
Okay... does each player only have and control 1 unit?
Make an Integer variable "Player's Team," with an array size of the # of players possible in the game.
Make another Integer variable "Team # Of Units," with an array size of the number of teams in the game.
When the game starts set Player's Team[a] = The team number that player "a" belongs to, for each player in the game.
Set Team # Of Units[b] = The number of players in each team.
Add all players in team 1 to Player Group Team 1
Add all players in team 2 to Player Group Team 2
Event: Unit dies
Conditions: Whatever
Actions:
Modify Variable: Team # Of Units[Player's Team[Owner of Triggering Unit]] -1
If Then Else-If
If Team # Of Units[1] = 0
Action: Set Victory for players in Player Group Team 2
and Defeat for players in Player Group Team 1
Else If Team # Of Units[2] = 0
Action: Set Victory for players in Player Group Team 1
and Defeat for players in Player Group Team 2
I follow what you say Terhonator and I finally succeed to make it work. I think all is done correctly.
Thx terhonator for your explanation and your test map it helped me a lot.
Thank you Monictor to also try to help me (to specify each player can control more than 1 unit).
I need some help with victory and defeat conditions in my map. My map is playable in 1v1, 2v2 and 3v3 and at the start each player chose one special unit (with massive attribut) in a dialog. What I want is when all specials units of a team are destroyed, the team loses and the other team wins. So if the game is played in 3v3, each player of a team must lose their special unit to lose the game (In 3v3 if only two player, in the same team, lose their special unit the game still continues until the third player of that team lose his special unit or the other team lose all their specials units).
I try multiple times but I cant find something that work. The last trigger I try was something like this, if their is no units with massive condition on the map for team 1, each player in team 1 is defeated and each player in team 2 win and if their is no units with massive condition on the map for team 2, each player in team 2 is defeated and each player in team 1 win.
How should I do this guys? Anyone as an idea and can help me out?
I think you want to use Variables for each special unit. For example team have 3 points at beginning of map and when 1 special unit dies modify variable by -1 and when team (=players in player group) have 0 points they lose.
Thats my idea in short.
Ask any more specfic questions since I don't know how much you already know about triggers. I'm trying to help you out :)
@Terhonator: Go
Thank you for your time, yeah I am not really good with triggers but I already play around with them a little bit, I am not a complete newbie ;)
I try your idea, first I create 2 variables, one for each team (integer, value 0) and I create for both team a trigger to be equal to the number of players in the team to function in all 3 modes (1v1, 2v2, 3v3) the trigger looks like this for team 1 :
the 2nd trigger for team 1 looks like this :
That didnt work. I dont know which part is good, could you tell me where are the mistakes? (I also need to add events if players leaves the game but for now I want to finish this)
@TGCID281: Go
Okay... does each player only have and control 1 unit?
Make an Integer variable "Player's Team," with an array size of the # of players possible in the game. Make another Integer variable "Team # Of Units," with an array size of the number of teams in the game.
When the game starts set Player's Team[a] = The team number that player "a" belongs to, for each player in the game. Set Team # Of Units[b] = The number of players in each team. Add all players in team 1 to Player Group Team 1 Add all players in team 2 to Player Group Team 2
Event: Unit dies Conditions: Whatever Actions: Modify Variable: Team # Of Units[Player's Team[Owner of Triggering Unit]] -1
If Then Else-If If Team # Of Units[1] = 0 Action: Set Victory for players in Player Group Team 2 and Defeat for players in Player Group Team 1
Else If Team # Of Units[2] = 0 Action: Set Victory for players in Player Group Team 1 and Defeat for players in Player Group Team 2
This should give you a good idea.
I'm trying to make this simplier.
Special units variable = 0
When special unit spawns for player + 1
When special unit dies -1
When team have 0 points they lose.
Make variables for both teams.
You don't need to think how many players are playing as long you only count amount of living special units by variable.
Depending on number of players you just add specific players for player group. Such as player 1 and 2 are team1 and so on.
Any time you can check "special unit" variable and if it is 0 then players in team lose the game.
I made test map for this thing:
http://www.sc2mapster.com/forums/development/triggers/32598-2v2-example-map/#p1
I follow what you say Terhonator and I finally succeed to make it work. I think all is done correctly. Thx terhonator for your explanation and your test map it helped me a lot.
Thank you Monictor to also try to help me (to specify each player can control more than 1 unit).
This thread is solved? :)
Yeah thank you again ;)