87
Before this, the best way to compare multiple player's scores was to repeatedly subtract 1 from every player's score until all but one reached 0. There are some obvious problems with this:
1) Depending on how many points the players have, this can take quite a while
2) All the players scores will be changed after you check for a winner, meaning you can't do an in-game status check.
This method aims to fix those problems, by keeping the comparison of scores completely within scoreboards. This fixes both problems by being able to testfor and display a winner with just the push of a button.
That's pretty much what it does in a nutshell, if you want to see it in action, the video above explains it pretty well.
Text Explanation:
This works using a system that can compare two teams scores within command blocks.
An objective that will keep track of which team is in the lead, rather than what each team's total score is. Whenever one teams gets a point, it adds 1 point to that team's score, and removes 1 from the other's. Whatever team has a positive score on this objective at the end of the game is the winner between the two.
In the system in the video, it compares teams 1 and 2 together, and also compares 3 and 4. It then takes the leader from each of these two groups, and compares their scores.
So if the scores are as follows:
Player 1 = 5
Player 2 = 3
Player 3 = 8
Player 4 = 4
It will compare the two small groups and find their leader, which in this example will come out to be players 1 and 3. It will then compare players 1 and 3 scores, and will output that player 3 is the winner.
1) Depending on how many points the players have, this can take quite a while
2) All the players scores will be changed after you check for a winner, meaning you can't do an in-game status check.
This method aims to fix those problems, by keeping the comparison of scores completely within scoreboards. This fixes both problems by being able to testfor and display a winner with just the push of a button.
That's pretty much what it does in a nutshell, if you want to see it in action, the video above explains it pretty well.
Text Explanation:
This works using a system that can compare two teams scores within command blocks.
An objective that will keep track of which team is in the lead, rather than what each team's total score is. Whenever one teams gets a point, it adds 1 point to that team's score, and removes 1 from the other's. Whatever team has a positive score on this objective at the end of the game is the winner between the two.
In the system in the video, it compares teams 1 and 2 together, and also compares 3 and 4. It then takes the leader from each of these two groups, and compares their scores.
So if the scores are as follows:
Player 1 = 5
Player 2 = 3
Player 3 = 8
Player 4 = 4
It will compare the two small groups and find their leader, which in this example will come out to be players 1 and 3. It will then compare players 1 and 3 scores, and will output that player 3 is the winner.
Progress | 100% complete |
Tags |
tools/tracking
2425798
2
comparing-multiple-scores---the-new-way-minigame-win-detection
Create an account or sign in to comment.