Variables In Smile Game Builder – Part 2: Starting With Advanced Variables
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.
PreambleAlthough 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 MoneyExactly 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.
Character InformationThis 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.
I did a video tutorial on conversations based on weather. But this can be used for other things as well.
In Part 3
In Part 3, I’ll go into randomization and what you can do with random numbers, including the skill-testing I mentioned before, with a follow-up video tutorial later.