Warning:
This guide isn’t finished yet. Sorry! Also, here’s the finished build:
It says “Mysz’s Team Counter System” because I’m pretty sure this is the first guide about this. This guide is for advanced gims with block code, property, and good overall GKC experience.
Introduction:
Hello! Today I’m going to be showing you how to count how many players are on every team, show how many players there are on a player’s team, and end the game when only one team is remaining. This has been a very frequently asked question on the Gimkit Forums, and I was very surprised to learn that there has been no guide that answers the question of how to do these things.
Also, this guide is for counting 4 teams. You can just add more properties and counters and relays for 5 or 6 or 7 teams.
Without further ado, let’s start this guide!
What You’ll Need For the Build:
Lifecycle x2
Repeater x1
Relay x5
Game Overlay x1
Property x11
Wire Repeater x1
Counter x4
Trigger x7
End Game x1
End of Game Widget x1
Step 1- Counting the Teams:
We will start our guide by first placing down a lifecycle. Then place down a repeater. Set the repeater’s settings to this:
Ignore the repeater for now, because it isn’t useful.
Place down 4 relays, one for each team. Wire the lifecycle to all the relays like this:
Event Occurs → Trigger Relay (x4)
The relays should relay on behalf of Teams 1, 2, 3, and 4.
Place down 4 counters that are invisible in-game and have global scope.
Now, wire the relays to the counters like this:
Relay Trigger → Increment Counter (x4)
As you know, we have now counted the players on 4 teams. Now, we want to decrement a counter when a player is knocked out on a certain team.
Place down a lifecycle, and set the event to “Player Knocked out”.
Place down a trigger that is not visible in-game and has no collision.
Wire the lifecycle to the trigger like this:
Event occurs → Trigger
Now, let’s create block code for the trigger! Create a block that says “When triggered…” and place these blocks down:
Let’s explain the image. When a player is knocked out, the trigger broadcasts a message on a channel. This channel starts with the string “Ded” and then the knocked-out player’s team number. For example, if a player on team 3 was knocked out, the trigger would broadcast a message on the channel “Ded3”. This is a use of concatenation.
Now, for counter one, make it so that it decrements when receiving the channel “Ded1”.
For counter two, make it so that it decrements when receiving the channel “Ded2”.
Repeat this process until you get to counter 4.
You have now counted the non-spectator players on each team. Now let’s get into the properties.
Create 4 properties. One called “Team1”, another called “Team2”, another called “Team3”, and another called “Team4”.
These properties should be numerical and look like this:
Now make it so that the counters update the respective properties, like this:
Since our properties now store the number of players on each team, we can now have a game overlay that shows the players how many people are on their team.
Place down a game overlay. It’s settings are very simple:
Also, set the player scopes to “team”.
Anyways, we are going to create block code for it now.
Create this block:
Now, before we talk about that, I want to get into how this is a very bad idea. What you should do instead is create a team-scoped property and just set the text to that, but whatever. You’re following this now.
This just retrieves the team number, then puts the correct amount of players on the player’s team after it sees what the team number is.
Also, the repeater is important now, because it constantly updates the game overlay. This is why we have it (we also have it for other reasons, don’t worry).
And that’s it! That’s the end of step 1. We have now counted the players on each team and showed them to the players on that team.
Step 2: Concatenation and Elimination
In this step, we’ll talk about concatenation, and how it ties into counting these teams.
First, create four properties. They should be text properties. Name them team1, team2, team3, and team4.
Now, for the text value, simply set it as the name. Like this:
[image deleted because stuff]
Now, place down a property called “AliveTeams”. The scope should be set to “global”, and should be a text-input property. Like this:
Now, place down 2 triggers.
Step 3: Ending the Game
Exit Poll:
Please complete this poll before exiting:
- 0/10 or
- 1/10 or
- 2/10 or
- 3/10 or
- 4/10 or
- 5/10 or
- 6/10 or
- 7/10 or
- 8/10 or
- 9/10 or
- 10/10 or
- 11/10 or /
Conclusion:
So yeah, that was how to count teams. If you enjoyed this guide, please vote on the exit poll or leave a like before leaving!
Thanks, and happy gimkitting!
-@mysz