Yes, this question has been asked a lot on the forums, and I want to get rid of these questions by creating a simple, multi-part guide that will teach you all about the basics and advanced mechanics of an infection-styled game. If you want to learn more, look in Community Made Guides. I’ve also created guides for making a King of the Hill styled game and a Gun Game styled game so you can look at those if you want too.
If you’re wondering, an infection game is where at the start of the game, one player gets “infected” with a “virus”, and when they knock players out or tag players, the virus is spread and there are now two infected players. When there are no longer any surviving players, the game ends.
In this tutorial, we’ll do these things:
- Have a random player become infected at the start of the game.
- Show players if they are infected or not.
- Have players become infected when they are knocked out (or tagged).
- Have late joiners be infected as punishment for joining late.
- Show the remaining about of non-infected players in a game overlay.
- Show the number of seconds the non-infected players have survived.
- End the game when all players are infected and display the last player standing in the match.
This will be pretty easy. Click the cog on the bottom left of your screen, and click map options. Then, click teams, and set the team mode to cooperative.
What this will do is set every single player on Team 1!
Next, let’s place down a lifecycle device, a relay device, and a team switcher device. What we’re going to try to do is switch only one random player to a different team at the start of the game, and this device combination does exactly that!
The lifecycle detects when the game starts, and sends a pulse to the relay, which chooses a random player, and sends a pulse to the team switcher which will send the random player onto a new team.
For the lifecycle, you don’t need to change any options:
Make sure the relay sends a pulse on behalf of a random player instead of all players. Sending all players to a different team would ruin the point of the game.
Since all players are on Team 1 by default, switching one singular player to Team 2 will isolate them on their own team.
Here are the wires:
Lifecycle (Event Occurs) → Relay (Relay Trigger).
Relay (Relay Trigger) → Team Switcher (Switch to configured team).
Optional: Tell Infecteds and Survivors their roles.
Place down a popup device, and wire the relay to the popup like this:
Relay (Relay trigger) → Popup (Open Popup)
I went with a pretty… basic design for my popup:
My popup, the icon image is “items/ Evil Eye”, and the text is fairly simple.
To tell survivors their role, do the same thing, except place down a relay that relays to Team 1 at the start of the game:
Alright, you probably also want to wire the lifecycle to a wire repeater with a delay of 0.1 seconds, and then wire the wire repeater to the popup, just so… AUO doesn’t screw you over. You might want to do this for the first popup too!
My second popup.
Now one random player will be selected to be the infected at the start of the game!
Wondering how you can make players turn to the infected side when knocked out/tagged? No worries! I’m here to tell you that!
First, place a lifecycle. Set it like this:
Wire that to your team switcher, so that when the player is knocked out, they will go to team 2, the infected team! You can wire your lifecycle to your infected popup as well, so as to tell them they are infected!
For tagging, it would be the same concept. The wire, instead, would be:
Player Tagged → Switch player to configured team
Player tagged → Open Popup(To show that they are infected)
Note: You should make it so that there is NO respawn immunity, or that ruins the game! They will know who is infected!
Wow, I’m really editing this guide! Well, add another lifecycle! Make it like this:
Wire that to the team switcher. Also wire it to your popup! Get the concept? Good.
Place a counter. That lovely device. Place a property. Make it like this(The Counter):
You might be unable to see this, but the scope is player
Place a repeater:
Place a lifecycle and a relay, with no changes in their settings. Wires:
Lifecycle → Relay: Event Occurs → Trigger Relay
Relay → Repeater: Relay Trigger → Start Repeater
Repeater → Counter: Runs Task → Increment Counter
The Counter will update the property, ‘Time’. Map Options:
With that, now we need to make it stop. Wire your Knocked Out Lifecycle to the Repeater. Make it stop the repeater.
The hardest part of this guide is probably this. Let’s start.
Use this, then make it decrement by ONE at the start of the game. That should work. I haven’t tested yet. I will be back to conclude if it works or not.
@getrithekd here. Make a game overlay that receives on “Update Overlay”. It should be type text. You know the num players property from the section before? Make it broadcast on “Update Overlay”. Make a block in the overlay. Put this in:
Tada! You’re done!
Well done reading this! I hope you can finish creating your infection map!