This is the last thing I need before my game can go live (excited!)
I have a defeat condition set up for if a player looses their Hero unit, but I need a victory condition for when there is only 1 player left in the game. Ridiculously simple I know but I cant seem to work it....
Also, if anyone knows a way to give a defeated player observer privileges though would be great but its the above Im most concerned with atm =D
If you define the last person in the game as the last person with their Hero, then you will need to create a trigger along the lines of:
Trigger: Unit Dies
Condition: Type of Triggering Unit = Hero (or whaterver thing makes that unit distinct)
Count of (Units of Type Hero) = 1
Action: End game in victory for Player (Owner of (Units in region (Entire Map) matching condition (Hero)))
This is assuming you are not tracking player Heros in a unit group. If you are, then change the condition to be simply Count of Living units in (Unit group with Heros in it) = 1
The simplest thing you can do is create a player group variable for all of the players. Add each player to the group when the map starts. Then, whenever a player loses (or leaves the game,) remove them from the group. If the number of players left in the group = 1, end the game in victory for that player.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
This is the last thing I need before my game can go live (excited!)
I have a defeat condition set up for if a player looses their Hero unit, but I need a victory condition for when there is only 1 player left in the game. Ridiculously simple I know but I cant seem to work it....
Also, if anyone knows a way to give a defeated player observer privileges though would be great but its the above Im most concerned with atm =D
Ta!
If you define the last person in the game as the last person with their Hero, then you will need to create a trigger along the lines of:
Trigger: Unit Dies
Condition: Type of Triggering Unit = Hero (or whaterver thing makes that unit distinct) Count of (Units of Type Hero) = 1
Action: End game in victory for Player (Owner of (Units in region (Entire Map) matching condition (Hero)))
This is assuming you are not tracking player Heros in a unit group. If you are, then change the condition to be simply Count of Living units in (Unit group with Heros in it) = 1
The simplest thing you can do is create a player group variable for all of the players. Add each player to the group when the map starts. Then, whenever a player loses (or leaves the game,) remove them from the group. If the number of players left in the group = 1, end the game in victory for that player.