Home > Tutorials > RPG Maker VX > Jack'd Variables
This is about variables, the hardest part of Event-making, but I'm going to make it simple. Let's just jump right into this. Hit F6, then click on a square on your map (it should look like a grid right now). I'd advise putting a completely different color of tile from the current flooring, so that you can find it when you test your game. Anyways, back to the inaction.
The event menu pops up. Click on the Insert/Show text command and enter EXACTLY what you see here:
Variable A: \v
Variable B: \v
Variable C: \v
pretty simple, right? The \v[x] displays, in the text, whatever value the variable currently is. It's a handy way to show you the current value of the variable.
To make this easy, we're just going to use variables 1 to 3. Open up your Event menu again, and go to "Control Variables".
Yes, I know. I still think that and I was voted Best Event-er for 2011. The math doesn't work as well as it should (multiplication functions, anyway), and you moght eventually look into getting it fixed, but you're probably not going to run into that unless you try something crazy, like I always do.
Click the " ... " beside "Variable 00001" and it'll open up a list of the variables. Again, AAAAAHHHH!!!
Stupidly, it does NOT show their values, only their names (if you even gave them one). See why I made you make that text box? You're welcome. See, Variables are exactly that; they "vary" based on what number they are at. Thus, they always start at 0 (unless you've given them a number). So, if you want to reset a variable, the line would typically read:
"Control variables; (whatever the name is) 00001 = = 0
To get that, set your variable to "variable 00001" with the little " ..." button, click the circle beside "set" and put 0 beside where it says "constant". The "set" function is a bit risky sometimes; it changes the variable to whatever you put in the "constant" box. I should note that the first = does not change, but the second one does, depending on the function.
So far you should have your text box, then the value reset I just showed you. Repeat this for variables 2 and 3 and name then ... you get the picture. ABC, 123. You'll end up with 3 lines that say "control variables..." after the text.
Now let's have some fun. Put another "control variables" thing -above- your text box. Do the same thing as above, but instead of "constants", fill in where it says "random" and change the pair of 0 to whatever numbers you like. Do this for variables A1-C3. Your event should read:
control variables: random...."
Text: (blah blah blah)
control variables: = = 0
now go to that event tile and click on it. The \v have turned into numbers! WOW! Do it again. Holy ----! The numbers are different! Again, WOW~! So, here's what it does: it generates 3 random values, one for each variable, shows you what they are via the "call variable" function you've hidden in the text, and then resets them to 0. You can confirm this by copy/pasting your text after the reset function. Okay, let's make 3 new lines. "change level- actor 1- increase-variable A".
A New Text box that says:
\n 's level has increased by \v \| \^.
then go to the last page of the event commands list and click "open menu screen". We're almost done. Very top of the list, "control variables- variable 004 set - actor 1's - level" then a text box underneath it that says:
\n 's level is currently \v
Then put the same box at the very bottom, followed by your "reset variables" thing again, but put it for variable 004. Use the text boxes to tell you what the number are at if you get lost, then click "apply" , then "okay". Play around with it a bit. Now re-order them so they read roughly like this:
control variables: random for 1-3
show text (the variables 1-3)
control variables; set variable 4 to actor 1's level
text to show variable 4
actor's level increase by one of your top 3 variables
text about the actor's level
your variable reset for all 3 numbers, but leave 4
text that shows all 4 numbers, the top 3 should all be 0
....and see what happens.
Sat, 09 Jul 2011 23:31:37 -0400