Self Switches in RPG Maker: A Primer
An exploration of self switches in the popular Game Development software
Hello and thanks for tuning in!
In this brief tutorial we’re going to be covering the self switch. For the uninitiated, each event in RPG Maker (or RM) can be assigned up to four internal checks that can be either marked as ON or OFF. There are a vast number of use cases for these, and it is important to understand the functionality, limitations, and implementation.
Limitations
First, the limitations. As previously mentioned, self switches are uniquely assigned to each event. Because of this, they exist in a bubble within that event, and will not be able to interact or respond to other event self switches. Further still, these you cannot call or affect any event’s self switch externally; it must be done within the event itself.
You might be asking, “Why are these limitations?” In the former case of responding or interacting to other event’s self switches, this means that often times we’ll need to use both self and global switches or other various checks. In the latter case, if there was for example, a light switch that turned off all the different light events, there would be no way to tell all the events “set your self switch A to ON”. You would need to use a global switch, thereby using one of your 5000 switch slots.
Functionality
So we can’t call self switches from external events, nor can our events react to other event’s self switches. What’s the purpose? Why use them?
As of RPG Maker MV, there are a set total of 5000 switches that can be named and assigned out of the gate. That’s a substantial number, until you consider how often they will be used. Almost every time you need to make an alteration or something needs to be triggered, you will use a switch. Here are a few examples:
- The player starts a quest, ends a quest, or a development within a quest occurs.
- The player opens something or unlocks something (each chest, locked door)
- You only allow the player to speak to an NPC once
And so on and so forth. These will add up quickly, especially when you consider branching dialogues, single-open chests, quests, and even small innocuous things like turning on lights, snuffing out one particular torch, breaking pots, or opening and closing a door.
Implementation
Self switches serve to reduce the number of named, global switches that you use, simplifying things in the process. Here are some places where these types of checks truly shine:
- The player gets introduced the first time they interact with an NPC
- A door opening/closing
- A single use chest, staying open or empty after getting the treasure
These are just a few examples of the ways we can utilize self switches. In order to know best when to use this switch type, you need to ask yourself a couple questions:
- Does this event’s switch need to be referenced somewhere else?
- Is this event self contained? (think, treasure chest)
This will get you in the ball park of whether or not you need to use global or self switches. In the next section, we’re going to look at a situation, dissect it, and learn how to create the self switch event.
Use Case
Imagine you are the game developer, and happen upon this scenario:
The player enters the town of Andovia for the first time and meets Will, the town’s blacksmith walking on his way to the shop. The player interacts with the blacksmith who greets him and says, “Welcome to Andovia! I’m Will the blacksmith, stop on by the shop sometime and I’ll be happy to serve you.” Upon interacting with Will once again, he now says, “I’ve got to get going, nice to meet you!” every time the player interacts with him.
How do we proceed in this instance? Simply using one self switch, triggered after interacting with Will for the first time. In RPG Maker, we’ll need to use two separate event “pages”. One that has our event’s “welcome” text and the trigger for the self switch, and the second page that has a condition for “Self Switch A” being on, and the “gotta get going” text.
Here’s what our first page looks like in the editor and in game:
That looks like it works wonderfully, but we are still able to to talk to Will and get the same message repeated endlessly, despite turning on Self Switch A. How do we fix this? By adding a second page to our event, setting a self switch condition, and filling it with our text.
Here’s what our second page looks like in the editor and in game:
And there we have it! An NPC who welcomes us only once, but then tells us he has to go from then on out. There are plenty of ways to extend this and we’ll look at NPCs in future tutorials.
For now, I hope you have an understanding of the importance of Self Switches and are prepared enough to be able to try using them in your own projects. Next up we’ll tackle global switches!
See you soon, and happy Game Making!