Say I want X to equal (Y+ 1). How do I do this?
How to set a variable based on another variable
RPG Maker MV SupportThere are at least two ways that you can do this!
Eventing:
In a Control Variables event, set the variable X equal to Y. Then you can add another Control Variables event command that adds + 1 to the Y variable.
Coding:
In the Control Variables event command, set the Single variable to X. Then, under Script, use this code:
In this example, you would replace ID with the variable ID number for Y (i.e. 2).
Eventing:
In a Control Variables event, set the variable X equal to Y. Then you can add another Control Variables event command that adds + 1 to the Y variable.
Coding:
In the Control Variables event command, set the Single variable to X. Then, under Script, use this code:
JavaScript:
$gameVariables.value(ID) + 1
Yes, like said above
normal eventing solution should be 2 command like this:
If you wanna go advanced, it should be like this:
Where the script is basically write down your own formula.
normal eventing solution should be 2 command like this:
If you wanna go advanced, it should be like this:
Where the script is basically write down your own formula.
Thank you! This was very helpful.
Original thread: https://forums.rpgmakerweb.com/threads/how-to-set-a-variable-based-on-another-variable.139688/