Game Development Reference
In-Depth Information
Figure 2-14. The Control Variables event dialog
Like Control Switches, Control Variables allows you to manipulate a single variable or a batch (group) of
variables at the same time. Unlike Control Switches, there are many more things you can do with a variable. This is
mostly owing to the fact that a variable can hold any number, while a switch can only hold an off or an on state. In
what may seem as a rather meta thing, you can have a variable be affected by the value of another variable. Final
Fantasy uses variables in such a way to great effect. For example, a certain character's weapon in Final Fantasy
IX causes greater damage the more dragons it has killed during the course of the game. While making a weapon
stronger based on such a variable requires scripting in RMVXA, you can create a skill that does much the same, and
it does not require scripting.
For this exercise, all we have to do is name the variable in question (I called it Tree), change the operation to
Add, and set the Operand to Constant with a value of 1. If you leave the operation on Set, it will make the value of the
variable 1. You want the variable to gain 1, not stay at 1, when the player interacts with a tree. To summarize, when the
player performs an action on the tree the first time, the variable “Tree” will be increased by 1.
Finally, we need to add a Control Self Switch event. Control Self Switch is a simple enough event command that
I won't use an image on it. All you can do with that command is select one of the four self-switches and set its state to
ON or OFF. Set self-switch A to ON, and there you have it.
In simpler terms, here's the solution. Figure 2-15 shows the necessary Priority and Trigger settings.
 
Search WWH ::




Custom Search