OK so here's the down low. I've gone through several tutorials on Variables (even Celiana's Beginners guide to variables) but I still don't understand how to use them can someone help me please.
Variable Help
RPG Maker VXAce SupportWhat exactly are you having trouble with? 🙂
Not really, no. What are you having a problem understanding exactly? Anything I write here will probably be very similar to the tutorials you have read, so you need to be more specific and tell us exactly which concepts are screwing you up.
Also, please use informative titles for your threads. We know you need help, that's why you posted here, and a title in the form of "HELP PLZ!!!" doesn't serve any purpose as it does not describe the content of the thread.
Also, please use informative titles for your threads. We know you need help, that's why you posted here, and a title in the form of "HELP PLZ!!!" doesn't serve any purpose as it does not describe the content of the thread.
Well any of it really if that's too vague then what things is it useful for in say a game like Legend of Zelda?
Also can someone change the title so it says help with variables please.
Also can someone change the title so it says help with variables please.
Uhh, it depends on what you want to do. Variables are just containers for data (can be an integer or string).
So if you want to know how many items a person has, you can use a variable to store that amount etc.
Legend of Zelda is too broad of a term, that answers nothing. What part of zelda are you trying to emulate? Break down the game, what are its features? How does x and y work (e.g. tools) etc.
MY SUGGESTION, is don't make a zelda game just yet and learn your tools.
So if you want to know how many items a person has, you can use a variable to store that amount etc.
Legend of Zelda is too broad of a term, that answers nothing. What part of zelda are you trying to emulate? Break down the game, what are its features? How does x and y work (e.g. tools) etc.
MY SUGGESTION, is don't make a zelda game just yet and learn your tools.
ok then
What Archeia_Nessiah said is the simplest explanation.
Say you want a Fishing Mechanic in your game... you would use Variables to determine the odds of catching a fish, or a certain type of fish. See below:

Basically, we have a variable called Fishing. We set the variable to receive a number between 0 and 2. We then have an command to "Change Item" depending on the number (either 0, 1 or 2) that the variable received.
That's basically it. So if you set this up as a common event... you have fishing!! You can add text, dependencies (For example, to fish in my game you need a fishing rod), and other nifty things too. You could set up another variable that provides a small chance of loosing your Rod, or catching a boot!
That's a really basic example... and it really doesn't do justice to what Variables can be used for. But it's a start. A lot of the most complex systems in RM (short of scripts) are achieved with variables.
That may sound simple... but they are remarkably useful.
Say you want a Fishing Mechanic in your game... you would use Variables to determine the odds of catching a fish, or a certain type of fish. See below:

Basically, we have a variable called Fishing. We set the variable to receive a number between 0 and 2. We then have an command to "Change Item" depending on the number (either 0, 1 or 2) that the variable received.
That's basically it. So if you set this up as a common event... you have fishing!! You can add text, dependencies (For example, to fish in my game you need a fishing rod), and other nifty things too. You could set up another variable that provides a small chance of loosing your Rod, or catching a boot!
That's a really basic example... and it really doesn't do justice to what Variables can be used for. But it's a start. A lot of the most complex systems in RM (short of scripts) are achieved with variables.
have you read my variable tutorial? you might find it useful. http://finalbossblues.com/rmvx-ace-switches-and-variables-p2/
Great explanation dude. Another thing fairly useful is that variables can be used to control a lot of switches at once! I like using that because I'm too lazy to do them all individually :3
Thank you! And yes... there are many crazy things that can be done with variables. Strings of variables, set to be multiplied and divided by other variables! Plus, variables can receive damn near anything you'd want them to! X's, Y's, Map IDs, nearly anything associated with your party or enemies... play time, save count, actor IDs. It really is remarkable. Variables, once understood, are arguably one of the most powerful tools at any RM users' disposal. And once you've wrapped your head around them, you'll be buzzin' with the possibilities. I had a few late nights, laying awake in bed, going through what I could pull off. Only your imagination is the limit (within reason, of course.).
Edit: @Frieza
That is still one of my favorite tutorials... and it was one of the first I read. You are a tutorial Wiz!!
@Frieza
I'll give it a look.
@Levi W
Thanks dude will give it a try.
I'll give it a look.
@Levi W
Thanks dude will give it a try.
You know, this has proven to be amazingly true. After taking a two-month hiatus from RPGM in general, I've recently jumped back in. I never could figure out variables, not completely. That tutorial by Frieza was very good, and I got the basics of how to use them for keeping track of something simple (i.e. the chicken game in the tutorial), but what ELSE could they do? I just couldn't wrap my head around it.
Then one night last week, I was trying to figure them out, and was literally just STARING at the "Control Variables" window in the Event commands... and suddenly BAM! I got it! Holy crap! I CAN SEE THE LIGHT :lol:
Which then led to a question. I was thinking that one could use variables to check the party's levels, and base things on it (i.e., having boss levels reflect the party's levels). What I couldn't figure out was how to check multiple variables, and/or add several variables together. In your post, you mentioned "Strings of variables, set to be multiplied and divided by other variables!" as one of the many amazingly wonderful things variables could do. So... how exactly would you do that? Could you make an event (or a conditional branch) be dependent on more than one variable? Or add/multiply/etc. several variables, and have the result of that operation itself be another variable, and have the event be conditional on THAT new variable? Or... something. As you can see, I'm still a little hazy on this particular aspect. 😀 Any help is appreciated!
First, for variables... see below:

This is a really simple example.
First Three Lines - I manually define the data for each Variable (just for the sake of this tut).
Next Line - I multiply v[0001] by v[0002].
Next Line - I set v[0003] to receive the data from v[0001]
Then, I have an event set with "Display Text" to check the number of v[0003]

It'd be beneficial to set up a test map to see how vars interact. And using the \v[0000] command is display text commands (as above) will show you the result!

So, unless Test1 and Test2 both equal zero... Chicken won't greet you!

This is a really simple example.
First Three Lines - I manually define the data for each Variable (just for the sake of this tut).
Next Line - I multiply v[0001] by v[0002].
Next Line - I set v[0003] to receive the data from v[0001]
Then, I have an event set with "Display Text" to check the number of v[0003]

It'd be beneficial to set up a test map to see how vars interact. And using the \v[0000] command is display text commands (as above) will show you the result!
Sure... using a "Conditional Branch Tree" within an event.

So, unless Test1 and Test2 both equal zero... Chicken won't greet you!
As awesomely useful as this is, it's hijacking someone else's support question. So, I'm going to go ahead and close this thread. Saito S, please feel free to make your own support thread for variables!
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
Original thread: https://forums.rpgmakerweb.com/threads/variable-help.2979/