I wanted to make a game where there the host picks how many rounds there are. Players can
earn points for winning each round. Say there are 10 rounds, the game will end after the 10th
round. I can do all that, but I was wondering how to calculate which player has the most points?
I need to know how in order to detect which player actually wins at the end of the 10 rounds.
Here are the (simplified versions) of my triggers which calculate player's "score" and run the "Game
Over" trigger when the round limit is reached.
I just need help creating the Game Over trigger. Each player will have his/her own points
saved into an integer array called "score". How to detect which player has the most points
in order to "victory" that person and "defeat" the others?
earn points for winning each round. Say there are 10 rounds, the game will end after the 10th
round. I can do all that, but I was wondering how to calculate which player has the most points?
I need to know how in order to detect which player actually wins at the end of the 10 rounds.
Here are the (simplified versions) of my triggers which calculate player's "score" and run the "Game
Over" trigger when the round limit is reached.
-
Add Score
-
Events
- Unit - A unit Dies
-
Conditions
- (Race of (Triggering unit)) Equal to Undead
-
Actions
- Set Score[(Player number of (Owner of (Triggering unit)))] = (Score[(Player number of (Owner of (Triggering unit)))] + 1)
-
Events
-
Round End
-
Events
- Time - RoundOver expires
- Conditions
-
Actions
- Set CurrentRound = (CurrentRound + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- CurrentRound Equal to NumberOfRounds
-
Then - Actions
- Trigger - Run Game Over <gen> (checking conditions)
- Else - Actions
-
If - Conditions
-
Events
saved into an integer array called "score". How to detect which player has the most points
in order to "victory" that person and "defeat" the others?