This week’s Smile Game Builder Tutorial #55: Beam Me Up, Scotty! is uploaded. Enter passcodes to teleport to different maps via a teleporter or warp gate event. It’s a bit like the Teleport Mirrors in Might & Magic World of Xeen. Perfect for adding variety to your game!
There is no extended version of this tutorial, but check my social media – Twitter, Pinterest and Facebook – or this blog for updates.
A Switch is a function that allows you to trigger certain events when the switch is activated. Those familiar with RPG Maker in particular will already know about switches and the same applies in Smile Game Builder.
In Smile Game Builder, there are five types of switches:
In this article, I’ll go through each one in turn, with examples as necessary. This is a basic outline of each type’s function within SGB, but in future parts I’ll expand them with more details.
A Local Switch is unique to each event. That means that they can only be used in that event and values can’t be transferred to other events.
Some of the more common uses of local switches are for chests and other searchables. They’re also used in certain “stationary” events, such as moving NPCs left or right if you give them specified items.
You’d use local switches when you know you’re only going to use them in single events and nowhere else.
There’s only one Local Switch and, honestly, that’s all you need.
Whenever you want to use switches across events, you’d use a Global Switch.
One example might be if you wanted to trigger something from one map and activate it on another map. A global switch is particularly useful for this, since it can be used anywhere in your game and, therefore, can be turned ON or OFF at any time as well.
SGB has a total of 999 switches, which may seem a lot, but it still mounts up if you use them excessively. It’s better to use a combination of the switches in this list, depending on what you intend to do.
A Variable Switch is for using variables to trigger other events based on their values.
I’ve used variable switches for sequencing event triggers in intros or cut scenes, notably in Tutorial #21.
Another example is for checking Player Direction or Camera Mode. Their values are stored in a variable, which can then act as a switch depending on the direction the player is facing or whether the camera is in normal view or first-person view.
Things like Held Money or Inventory (in the Event Sheet Conditions) can also be classed as variable switches, since their values are stored.
Conditional Switches are specifically for when you use conditions in Event Sheet Conditions, such as toggling switches (Event Switch/Switch) or checking if an ally is in the party (Ally/Party).
If any of the specific conditions are true, then the event triggers as a switch so that the events in the Event Details will activate.
Conditional switches can also be used in Event Panels. In Event Switches/Condition Checks, Check Variable Box and Check Switch Box are conditional switches because they do something based on certain conditions. (A lot more will be added in the future.)
With Conditional Switches, if you have more than one in the Event Sheet Conditions, then all of them need to be met in order to run the event.
The final type of switch is the Trigger Switch. This is set in the Event Details and activates depending on which one you use.
The most common is When Main Hero Talks, where if the action key is pressed, then whatever you put in the Event Details will run to execute the event. It’s usually used for opening doors and chests, or talking with people – interacting with other events requiring some kind of action.
The two other Trigger Switches of note are Triggered Automatically (1 Time Only) and Automatically Start (Synchronize and Run Repeatedly), which work in similar ways, but with some major differences.
The former activates once when conditions to trigger the event are met and the latter runs repeatedly in the background when the conditions are met and will continue until those conditions become false.
In Tutorial #15, there’s a more detailed explanation of event triggers as a whole, which you can watch to see how each one works.
Notes About Switches
Switches can be used in the same way in Common Events as events placed on maps.
Event triggers (in Event Details) affect how events are run. With the exception of Triggered Automatically (Repeated) and Automatically Start (Synchronize and Run Repeatedly), the events will run through once until the end is reached or their conditions change.
Switches in general can be used in one of two ways:
Placed as Event Sheet Conditions, where the events will run depending on the trigger and the condition(s) being met, or
If used in the Event Details, conditions on other sheets (up to a maximum of 20 per event) will run. This will continue until all conditions are met or there are no other conditions.
Automatically Start (Synchronize and Run Repeatedly) takes priority over all of the other triggers, which also affects when and how switches are activated.
This concludes the first part of the multi-part series An Anatomy of Switches. In the next parts, I’ll go through each one in more detail and how they can be used effectively for all kinds of things. I’ll also reference their use in my tutorials as that arises.
Note that these are not the “official” categorization of switches. They’re my own, which I’ve deemed easier to reference and which I’ll be using in future parts.
Incidentally, at 17:28, after "In the next part", is someone else’s voice saying "Yes". It definitely wasn’t me and there were no other sounds or external noises. Did I capture an "anomalous voice" or EVP? What do you think?
In Smile Game Builder, you can store and reference various character stats via Advanced Variables.
Under Character Information, you can store:
Experience: A character’s Level and Experience.
HP and MP: Current and maximum HP and MP.
Stats:Attack, Defense, Accuracy, Evasion and Agility.
Each stat is stored in a separate variable per character. If you intend on using all of them with a full party, you’d need to reserve 44 variables. And then with each additional recruitable character, you need 11 further variables.
Using Stat Variables
There are many possible applications for Character Information. I’ve already visited several in my Smile Game Builder Tutorials series, but here are a few more.
Creating Stat Based Skills
What if you wanted to create stat-based skills, such as Lockpicking or Dodging?
You’d first need to store each stat in a variable (as in Fig. 11) and then create separate skills based on those stats.
I also covered this in Tutorial #29, which deals with using skills with chests.
So, for the first one, Lockpicking, it can be based on Accuracy.
To What? would be the Lockpicking skill itself, How? would be set to the variable assigned to Accuracy, and Do What? would simply be Assign.
The next step for this example would be to create another Variable Box where Lockpicking is divided by the Fixed Value 2 (or whatever number you want for the division). The end result is that Lockpicking is equal to half of the character’s Accuracy.
Using the defaults at Level 1, Sion’s Accuracy is 95. Halved, the Lockpicking skill would be 47 because fractions are rounded down.
For the Dodge skill, in this example I’ve based it on Agility and Evasion.
Assign the Dodge variable to Agility (in the same way as with the Lockpicking skill) and add another Variable Box to add Evasion to that.
Evasion is primarily based on armor. Light armor would probably decrease Evasion because it’s easier for weapons to penetrate through. Heavy armor would increase Evasion, as it offers much more protection than light armor.
Thus, Evasion can be a negative number. Cloth armor, for example, since it offers very little protection, might have -3 Evasion. And when this is added to the Dodge skill, it is, of course, subtracted from the total.
You can change the Evasion rates in Stat Modifications for each piece of armor (in the Items tab).
Checking Stats for Success or Failure
Once you’ve set up the variables and skills, the next course of action would be a chance of success or failure.
Smile Game Builder doesn’t have a direct method of comparing one variable with another because the Variable Box Check uses fixed numbers only. This means that we have to use a kind of workaround.
Starting with Lockpicking, decide on the percentage of success beforehand. In this case, there will be a 50% chance to successfully pick the lock.
So, Variable Box Check is then used to determine if the Lockpicking skill is greater than the percentage. The Yes branch would, of course, contain the routine for opening the chest successfully. And the No branch would be for its failure.
The events containing this information need to be running automatically synchronized and put on each map you want to reference them.
You can create other stat-based skills in a similar fashion. For instance, Strength could be based on half the character’s Current HP. Or Intelligence could be based somewhat on Maximum MP.
At the moment, you can only store the character stats defined in the Game Data. It’s not possible (yet) to similarly store monster stats, so these would need to be defined separately for each monster on the maps for an ABS or similar system. They would either be fixed values or random numbers and then scaled by multiplying them with character level.
For the next tutorial, I’ll look at variables for Camera Settings and how they can be used for various purposes.
In Part 1 of the Variables in Smile Game Builder series, I went through what variables are, the two types of variables (Basic and Advanced) and their roles in Smile Game Builder.
Although I already did a video tutorial on Advanced Variables in Tutorial #11, as a continuation of this series, this is simply a synopsis of all the things you can store in variables, as well as my own findings.
With each section, I’ll try to be as comprehensive as possible in future articles. And I’ll also add links directly to them here as and when they’re finished.
I’m only focusing on Variable Box in the To What? section for now, but will focus on Number Displayed in Variable Box much later. I’m also not going through all of them because these will be covered more in-depth in later parts.
There will also eventually be an index page for all of these articles for easier access to the parts that interest you.
The Fixed Value is exactly that! You can set variables to specific amounts. These can then be manipulated with the operators in Do What?, also with specific amounts.
With Random Number, you can generate a random number between a minimum and maximum value and store the result in a variable. This can then be used in conjunction with the Variable Box Check to randomize contents, rewards, conversation snippets, or even random events.
Unlike the random number operator in Variable Box, which adds a random number to a variable, this gives you the option to create a random number from a range of numbers.
Amount of Money
Exactly as it states, this stores the total Amount of Money you have. You need to set up an auto-run synchronize event trigger for each map you want to check it on.
The money amount itself (in the Increase/Decrease Money section) is a fixed value, so you can’t directly add or subtract anything to or from it through variables.
Instead, you can reference the amount of money you have in messages using \Variable[x], where x is the variable number for the stored money.
Be aware that, as a potential bug I recently found, if you increase or decrease the amount of money in the same event, the variable’s new value may not update to this new value in the message if it’s placed immediately after the increase/decrease. You’ll need to place your message first and then the increase/decrease event command for it to be in sync.
Held Item Number
Store the number of certain items carried in Held Item Number. This is notably useful for any of the Crafting systems I did on my YouTube Channel, where you need specific amounts of ingredients to be able to craft new items.
This allows you to store the values of characters’ stats in variables.
As you can see from Fig. 6, level and experience, current and maximum HP and MP, and so on, can be assigned to variables.
This is particularly useful for some kind of skills system. As an example, lockpicking would be based on Accuracy, dodging traps on Evasion and Agility, and so on. You can then use a comparative percentage variable to check if the stats are high enough.
I’ll go more in depth with math calculations in a future tutorial.
The Map X Size and Map Y Size can be referenced by variables. I have no practical use for this; however, one use could be for a fake windows error message, based on map size.
Map Environmental Effect
Each map can have its own environmental effect (in the Map Settings) – whether rain, snow, confetti, etc. – and using the advanced variables, you can store the Map Environmental Effect.
A Variable is simply somewhere to store numbers or values so that they can be referenced later. There are two types of variables in Smile Game Builder: Basic and Advanced.
I’m going to be as comprehensive as possible with this series. However, you can skim through the parts you already know and, as the series progresses, skip to the parts you’d like to know more about.
Basic Variables are used for simple operations to directly affect the targeted Variable No. with whatever number is set in its Value.
You can assign a fixed value to the variable with Put into variable box as-is. Another value can then be added to or subtracted from this value, or multiplied by or divided by it with another Variable Box referencing it. And this new value is placed into the variable.
Besides the usual math operators, you can also add a random number in variable box between 1 and whatever number is placed in Value up to a maximum 999,999. This does exactly as it states and adds the random number to the variable; it doesn’t create a random number (that’s in the Advanced Variables section).
The basic Variable Box is primarily used for setting up quick, simple variables and manipulating them with the operators.
ALL values are fixed and can’t be directly influenced by other variables. It can kind of be done, but I’ll cover that in a later tutorial.
In the Advanced Variable Box Op. section, you can do much more with variables (as you can see in Fig. 3 below).
These are values specific to various parts of the game and they can be stored and manipulated in the same way as basic variables. And we’ll go through each of them over the course of this tutorial.
This is where you set the variable you want to use. The maximum allowed variables in a single game is 999, although you can reuse other established variables on different maps if you’re not using them elsewhere on the same map.
Variable Box is used and referenced the same as in the Basic Variables. There is another option in the dropdown, Number Displayed in Variable Box, but we won’t worry about that for some time.
This section is for selecting the type of operator to use with the variable. In addition to the usual math operators, you (obviously) set the variable’s value with Assign.
There’s one other operator, Substitute Divided Remainder, which divides the variable’s value by the assigned number and uses the remainder as the value. I covered modulo operations already in a previous tutorial.
This is what you want to store in variables. As you can see in Fig. 3, there are quite a number of options. And, while this isn’t as comprehensive as it could be, it still contains a sufficient amount to achieve some advanced tasks.
You can use advanced variables to set "fixed" variables instead of the basic Variable Box. The two are the same and do the same thing.
Personally, I like using the basic Variable Box if my variables are simple values not reliant on anything except for fundamental calculations. And then I use the Advanced Variable Box for more complex operations. It may be just a matter of preference when setting up the basics for more advanced stuff later.
In Variables Part 2
I’ll continue the series in the next article and, over the course of the tutorial, will go through each one in turn. Included will be explanations on how and where they can be used, along with examples as necessary.
I covered Advanced Variables in my video series in Tutorial #11 (as well as some later videos), so aim to expand on that in this series, with additional video references as they crop up.
Although I won’t go into as much detail (except perhaps in a future article), I’ll utilize the event’s Conditions in conjunction with variables. And I’ll share some of the techniques I’ve learned in the process, such as how to properly set up a cut scene using only variables.