Variables are like boxes into which data can be put.
Numbers/values, text, switches, etc. can be stored and used at various points in the game.
Putting data into variables is called "assignment".
Example: If you assign the value "1000" to the variable "money", the variable "money" always has the meaning of the value "1000" in the game. The variables themselves are boxes, so the values inside can be added or subtracted. If we add another value "500" to this variable "money", "money" has the meaning of the value "1500". On the other hand, when the variable "money" is assigned the value "500," the content of the variable is overwritten and "money" becomes the meaning of the value "500".
By utilizing variables, a variety of expressions are possible in the game.
The initial value of all variables is 0.
Bakin provides the following types of variables.
The following describes the values/strings/local values/arrays/cross-save shared and event switches.
It is basically the most common variable used to store numeric values.
These variables can be referenced from anywhere within a single game.
<Example of Use>
This is accomplished by recording the number of times the villagers are asked in a value variable.
This is accomplished by recording the number of times things are examined in a value variable.
The current time and play time at the start are stored in value variables, and the difference is calculated at the end of the session.
* Although a similar event can be created with a local variable, using this value variable makes it possible to refer to the value managed by the variable from other events.
It is basically variables that are used to store text.
These variables can be referenced from anywhere within a single game.
<Example of Use>
This is accomplished by putting the correct answer and the password to be entered into string variables, respectively, and comparing them.
The name of the pet given by entering text is recorded in a string variable and displayed as conversational text.
This is accomplished by recording the terrain resource name in a string variable with the command script "Obtain Terrain Information" and comparing the string variable to which "field" is assigned. Use the ability to call common events from seed and seedling items.
These variables work the same way as values, but they can be referenced from "only in the event in which this variable is specified".
By keeping variables that need to be used only within a single event as local variables, the list of variables can be prevented from growing.
<Example of Use>
These can be realized with value variables, but can be handled with local value variables.
These variables can manage multiple variables at once.
Array variables allow multiple variables to be managed together in a single variable.
These variables can be referenced from anywhere within a single game.
Think of an array as a row of smaller boxes inside a larger box. The name of the large box is the name of the array variable. When referring to the contents of a small box in an array variable, the value "pointer" is used to specify which box to refer to. Example: In the array variable "price of weapon", "pointer = 1" contains "price of sword" and "pointer = 2" contains "price of bow".
<Example of Use>
Record the items that need to be bought in a pointer to an array variable.
The name of product A is recorded at pointer 0, the remaining number of product A at pointer 1, the name of product B at pointer 2, and so on.
To put a string into an array variable, use the command script "Assign to String Variable". However, if you want to display the contents of an array variable with a message, you must first assign it to a string variable and then display that string variable.
These variables have the widest influence across saves and can be referenced from anywhere in the game.
<Example of Use>
Event switches that can be manipulated by command scripts are also a type of variable.
<Example of Use>
After speaking with the key cast members, turn on event switches. Prepare the NPCs' reactions when the event switches are turned on as events.