A Player Selector

This guide was originally for voting, so it also has a vote counting system in it.

This guide uses Iterative Player ID’s to iterate through the entire server for the player. This uses some concepts from my previous guide on this as well. This method, however, lets you have a faster voting experience, and will help you have a better voting experience in total. I also revised it to allow for ties. I suggest that you don’t try to do this all in one sitting, but rather over a few days.

Note: I fixed a bug in the Iterative Player ID. You should review that.

Warning! This guide requires you to have a basic understanding of blocks, like setting stuff, and incrementing by 1 (setting the property to itself plus one).

If you aren’t comfortable with blocks, read this guide (o7 to mysz):

Concept
As I stated previously, this uses Iterative Player ID’s to function. If you don’t know what those are, use this guide.

This will also use a new way to count votes.

Guide

The Voting Menu

Make a relay that broadcasts on “G Start Meeting” when receiving on the channel that starts the voting process. Make a button overlay on the top right that shows itself when receiving on “G Start Meeting”. It should hide itself when receiving on “Guilty”. If the button is clicked, it should broadcast on “Update Popup”. Now make a popup. It should open on “Open Voting Menu”. Also set both scopes to player. The first call to action should display “Guilty”, and it should broadcast on “Guilty”. The 2nd call to action should display “Next Player”, and it should not broadcast on anything. There should be a block in the popup that receives on “Update Popup” that has this:

You can change the text to your needs.

Now, make a trigger. Add a wire from the popup to the trigger. It should be “secondary call to action clicked” to “trigger”. Add a block in the trigger. Make a player-scoped true/false property called “In Queue”, with a default of false. Make the trigger’s block set “In Queue” to true, and add a block that broadcasts on “Check If Go Time”. Make another trigger that receives on “Check If Go Time”.

Property Time! Make a global True/False property named “Is Somebody Using”, with a default of false. Set a player-scoped True/False property named “Receiving for New Player” with a default of false. Make a player-scoped number “P Current Player ID”, with a default of 0. Make a global-scoped number property named “Num Players Left”. This should be the amount of people left. I’ll show how to do that later. Make a global true/false property named “Has Found”, with a default of False. Make a player-scoped text property called “P Current Player Name”, with no default. Make a global scoped text property called “G Store Name”. We’re now ready for the next part.

In the blocks for the trigger that receives on “Check If Go Time”, put these blocks in:


Now, it is time for the system to get the next player’s name.

Finding the Next Player's Name

Make a trigger that receives on “Start Search”. Put this in the blocks:

image

The Show Player ID was there just for debugging purposes. It is NOT necessary.

Make a relay that receives on “Start Check Player ID”. It should broadcast on “Check Player ID”. The audience should be everyone. Make a trigger that receives on “Check Player ID”. Put this in the blocks:

Now make a relay receiving on “Start Player Found”. Make a relay receiving on “Start Player Found”. The audience should be everyone, and it should broadcast on “Player Found”. Make a trigger that receives on “Player Found”. In the blocks, it should set “Has Found” to true, and then broadcast on “Check If Go Time”.

The Name-Finder is complete!

Voting For Guilty

So far, we have made a system for multiple people to act on other people. This is actually reusable for all sorts of purposes, like messages, business deals, and more!

Now, we have to customize this template for voting. Make a trigger. Make a wire from the popup to the trigger. The settings should be this:

In the blocks for the trigger, put this (properties will be discussed later):

image

If you want to show who voted for who, add these blocks:

More Property Time!

Make a “Num Votes In” global number property, with a default of 0. Make a global number property named “Player ID Voted For”, with no default.

Now make a trigger that triggers on “Vote In”. In the blocks, put this:

Make a relay that receives on “Start Guilty Search” and broadcasts on “Guilty Search”. The audience should be everyone. Make another relay that receives on “Start End Vote”. It should broadcast on “End Vote”

This is the start of the new method. Also, make a property named “Votes” that is player-scoped and the default is 0. Make a trigger that receives on “Guilty Search”. Put these blocks in:
image
I used an item granter for mine, because it was left over from my old counting system. Both should be the same, except there will only be one item granter with a bunch of blocks.

The Vote Counter

This will now check the votes and teleport the voted player to the execution chamber. If there is a tie, no one will die. That rhymes!

Property Time!

Make a global scoped number property named “Num Votes”. The default should be 0. Make another global scoped number property named “Guilty ID”. The default doesn’t matter. Make a global scoped True/False property named “Tie”. The default should be False. Make a global scoped number property named “Num Votes Counted”. The default should be 0.

Make a trigger receive on “End Vote”. Put these blocks in:

We are on the home stretch (hopefully!).

Make a relay receiving on “Start Execute” and broadcast on “Execute”. The audience should be everyone. Make a trigger receive on “Execute”. Put this in the blocks:

image
Also, inside the 2nd if statment, make it broadcast on “Start Reset Player ID”.

Resetting Player IDs and Getting Num Players Left

So, there are 2 ways of killing that I know of: tagging and knocking out. You can get both by tag zone or a life cycle.

Using wires, have the lifecycle or tag zone trigger a trigger, when someone dies. The trigger should set “Num Players” to 0. After that, it should broadcast on “Start Reset Player ID”. Make a relay that broadcasts to all other players on “Reset Player ID”. Have a trigger that is triggered with a 1.5s delay when receiving on a “Reset Player ID”. It should increment “Num Players” by 1, and set BOTH “Player ID” AND “Num Players Left” TO “Num Players”. Sorry with the caps, having 3 properties in 1 sentence seemed like it should have some clarity.

In hindsight, the “Num Players Left” property could have been replaced with “Num Players”, but it doesn’t matter at this point, unless you are running low on properties…

Resetting All Properties

Make a relay receive on “Defaults”. It should broadcast to everyone on “G Defaults”. Make a trigger receive on “G Defaults”. In the blocks, it should return “Tie” to false, “Num Votes” to 0, and “P Current Player ID” to 0. Also, set “P Current Player Name” to “Start Scrolling”. If there is any issue with running multiple voting rounds, then I probably forgot to return a property to the default.

Explanation (Please look inside because it'll help fix any mistakes that might have been made)

This voting system is split into 2 parts: comparing player-scoped properties and using player ids. Technically, the using player ids part is a sequel to this guide. You’ll notice a bunch of similarities:

How to Make Admin Options (Punishing People) See Post 17

Its just the same thing, but this guide is retrofitted to allow multiple players use it at once.

Lets define the problem: We want infinitely expandable voting that can be scrolled through at any pace. It doesn’t have to be infinitely expandable, per se. We only need a system that can adapt to the number of players and can be scrolled through at your own pace. So we first need something that can show you all the players and has buttons to click.

The farming GUI in farmchain has that, but it isn’t in GKC. The next best thing is a popup. We can have the 2 buttons be “Yes” or “Next”. But how does the computer (I’ll say computer a lot, and I mean the map) know who’s next? It doesn’t! So that’s why we need player IDs! This will allow the computer to know who to show next. So to use the player IDs, we need the “Next” call to action to trigger a device system that finds the next player’s name. For that, we need a property to store the current player’s ID. Now, we use scope stream to set the name and then we send a channel broadcast to show that the name has been found. After that, it’s just a matter of setting the text.

That is the system for the admin options (and this) guide. From here on, this is voting territory.

What will happen with this system is that one player’s actions will change another player’s popup. Now we don’t want that, do we? So we have an idea for making people “wait” in line. If you’re first and someone exits the name-finder room, then you get to go in and mark yourself as finding a name. But if the person comes out, and you haven’t marked yourself as in the line, then you can’t go in. That’s what this block does:

So now, we are done with the player id name part. Now we can move on to the comparing player-scoped properties.

So now, lets discuss how to find the largest thing in a list. We look at the first thing and use that as a benchmark. If the next thing is bigger, then we use that as the benchmark and say that there isn’t currently a tie. If its the same, then we say that its currently a tie. Now, we have to know how many things we’re comparing and if we’re done. So we increase something and see if its equal to the number of objects of the list. If it is, then we trigger something that acts based on the tie and which one is the biggest. That’s exactly what we’ve done in the guide.

And now we’re done! All we have to do is reset everything back to the defaults and adjust the player IDs whenever someone dies!

And that’s it! After 1 month of bug-fixing, the full bug fixed-guide is out! Here is a poll:

Difficulty
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
0 voters
54 Likes

Oops. Posted too early.

19 Likes

Two voting guides… crazy.

17 Likes

Well, I did stumble across a much improved version with Player ID’s.

20 Likes

Bump because almost finished. Start it now if you want to finish it when I finish the guide.

19 Likes

Why is it :black_large_square:?

16 Likes

Nice Guide @getrithekd.

19 Likes

Just look at it… :skull:

18 Likes

Fine, I suggest you make this :purple_square: or :red_square:, though.

15 Likes

I still have to incorporate a whole bucketload of stuff to make it work.

19 Likes

Why?

17 Likes

Nevermind, I just don’t really like the black difficulty. The only words I can express it as is, “Purple, but harder.” There’s no defining feature of the black difficulty.

19 Likes

@getrithekd I hope this will work for me. Also, pictures would REALLY help.

16 Likes

I hope it does too! I know that pictures would help, but I haven’t done it yet since I want to get the full guide out.

17 Likes

Okay. But thanks for making this!

14 Likes

Also, I agree with @mysz. You shouldn’t make it Black difficulty. Maybe Purple

13 Likes

I don’t like purple since it looks kind of like blue, and purple is barely used.

14 Likes

I think purple looks cool.

14 Likes

In fact, purple is the opposite color of green, which is also why it’s epic.

14 Likes

Maybe… I’ll put up a poll on the guide.

14 Likes