How To Create A Voting System in Gimkit Creative

NOTICE: Updated

Now that I am a normal gimkit forums user, I replaced all my text depictions with actual screenshots.

Introduction

Have you ever wanted to have, for example, a voting system to choose the next map or choose a play for something? In my case, it will be for my recreation of fleeing the facility on gimkit. There is a pretty cool way of doing this in gimkit creative and it may use some things may not have even known were possible!

Memory Usage Notice

This voting system may take up a bit of memory because it uses trigger block and block coding to work, but it will be worth it.

Get started

To get started, you can place down 2 text boxes and 1 button. I will also use a sign for style.
please build them in a structure like the following:
image

I will also be including a currently winning sign for debug purposes to make sure it has the right number.

All my voting options and the winning sign look like this:
image

Adding functionality

To add functionality, begin by placing counters like this above every voting option make sure to hide them!!!
image
Make sure to wire up the buttons to the counters and make them increment their value when the button is pressed.

Next, we will create 3+ new properties,

  • property 1: highestName
    • stores the name of the winning vote
  • property 2: highestValue
    • number property that holds how many votes the winning vote has.
  • property 3-4: voting option name
    • this will be the property that holds the number of votes for each option. in my example, I will need 2 properties.

now wire up the properties to pulse the wire when the property changes
image

make sure these properties are wired so that when their value changes, send a wire pulse to the text boxes that show the number of votes, then add this code on the wire pulse to the text boxes (I will detail how to do this later)
image
REPLACE highestValue with the corresponding property value name

Now that you have all these properties, make sure to make it so that both the counters for each option set their value to their matching property.

Block Code

What is block code (for those who don’t know)

Block code is a scratch-like block coding system built to allow coding in gimkit. I was pleased with this addition because it gave gimkit the functionality it needed for proper game development.

How to write block code

Some devices, such as the trigger have a tab on the left side that is labeled “blocks”
Please click this tab, it will bring you to a UI where you can write code that runs when the requirement is met.

Writing our block code

We will first create a new trigger with block code that runs on wire pulse. We will then hook up or properties for each vote to the trigger and make it trigger when the property changes.

Now we begin scripting, insert this code into the trigger:


REMEMBER this will be different for everyone based on their vote options, so change this code to match

Conclusion

In this post you learned,

  • how to block code
  • how to use triggers
  • how to use properties

Thank you for reading this guide, I spent an hour writing this lol

[EDIT] Thanks! I was not expecting to get many interactions but rather downvote bombed like on stack overflow. I really love the engine and the community behind it

22 Likes

nice guide! seems complicated

3 Likes

Cool guide, it was well written.

2 Likes

WOW! Nice guide, and welcome to the forum! Be sure to credit the other voting guides, tho!

3 Likes

Welcome, welcome, and welcome to the forum, @M1dnight!

2 Likes

Nice guide! Welcome to the forums! I suggest you explain what each part of the formatted text with “facility” and “airport” mean, though.

3 Likes

Welcome to the community, @M1dnight! It’s always nice to see a new user who’s first post is a guide!

5 Likes

Thanks! We don’t want a flame war. anyways! Great guide for the lists!

4 Likes

Autocorrect seems to like making me say weird stuff, so not really my fault.

It’s probably because I had a project on that, so it’s ingrained in my autocorrect.

6 Likes

Glad to see a new programmer here on the forums! Nice job with the first guide. How long have you done things with Gimkit?

3 Likes

Welcome to the forum, @M1dnight! This is an amazing guide.

2 Likes

Hey, @M1dnight, you might want to change your location in your profile to something more, “appropriate”.

7 Likes

Nice first guide and welcome to the forum, @M1dnight! Once you gain more TLs, you’ll be able to make a new guide to add pictures.

2 Likes

Wow! Great advanced guide for your first post! Also welcome to the forums, @M1dnight!

2 Likes

Nice guide! You’ve been here since the start, it would be unfair to compare you to a newbie… This is still a nice guide!

3 Likes

To be fair, I’ve been here since may, but I really only started paying attention to the forum like a month ago

3 Likes

I originally began making gimkit maps in late spring of this year but quit since I didn’t know about block coding or anything. I had a pretty good understanding of wires and devices and only recently began to tinker with block code and properties.

4 Likes

i dont think i can do this… i just started

4 Likes

You’ll get there. Maybe even you will make stuff like that in the future!

3 Likes

@GimAI /gimai_rate post

1 Like