Announcement

Collapse
No announcement yet.

The Community Variables Tutorial

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    The Community Variables Tutorial

    Darn you Hito, I didnt see your variables topic *rolls eyes* Delete this now
    This will answer any questions one may have about variables, if anyone would like to add a section or change any topic or add a Q&A, please submit it in a post here, or if you have an additional question about variables, please ask and we'll answer and place it in the Q&A section at the end of the tutorial.

    This tutorial is completely community ran, so if you feel you would like to add/change anything, feel free to do it!


    Table of Contents
    1.What Are Variables?
    2.How Do They Work?
    3.Internal Variables
    4.External Variables
    5.Using Variables To Track Game Progress
    6.Using Variables To Track Money
    7.Using Variables To Trigger Events
    8.Using Variables To Track Passing of Time
    9.Q&A

    Section 1: What Are Variables?
    Variables are numeric strings that stores a value to something that the creator chooses, think of them as a box that holds numbers inside.

    Section 2: How Do They Work?
    When a creator decides to create a variable, there is always a reason for it, and there are millions of things to use a variable for. The most common types being explained later on in the tutorial.
    When stored, a variable stays in memory as a numeric string which can be recalled at any time the creator needs it. All variables have a default value of 0. It is also best to keep track of variables in a notebook so you don't forget them.

    Section 3: Internal Variables
    Internal variables are assigned to specific people, towns, or dungeons, and are used to more easily keep track of what each variable does. Internal and External variables behave the same way, and they are not restricted to being used by the named area/person(For example, you could use a "Misty Town" variable for something in "Water Town". Of course this makes no sense, it's just used as an example .)

    Section 4: External Variables
    External variables are global, which means they can be used for any number of global events, such as controlling money flow(as explained in Section 6), keeping track of how many enemies one has killed, and any other global cause, and again Internal and External variables behave the same way.

    Section 5: Using Variables To Track Game Progress
    Most often used with External Variables, assign a variable to "Game Progress" in your notebook, lets say for example you used Variable 01, when you start the game it'll default to 0, when the player completes the first section of the game, change the variable to "1", and so on.
    This is best used when you want people to say new things depending on what section of the game you're in, also, you can use this to unlock more towns/dungeons/secrets, or anything, it is a very useful variable to have because of the vast amount of uses it has.

    Section 6: Using Variables To Track Money
    Since RPGM3 doesn't have a money condition in its scripts, its pretty much up to the user to track it. Why would this be useful? Let's say you wanted custom stores, or you have to buy skills or magic or anything else other then items from someone, this would have to be done.
    The only thing with this is that you have to have all your battles event based, and if you include random battles, you CAN NOT under any circumstances allow the player to win money from these random encounters OR obtain money from "treasure" events.
    First thing is to assign a "money" variable, we'll use Variable 01. Now when you script you have to make sure that whenever the player recieves any money, you also have to increase that variable by the same amount of money recieved, for example, you fight a battle and you win, if the enemy gives you 30 gold, you also have to increase the variable by 30, this way both the variable and money stays the same.
    When creating a custom store, when you go to buy something from it, let's say for 30 gold, you'll have to put a val-cond branch before the purchase.

    EX:
    Code:
    Val-Condition -> If Variable 01 >= 30G
    Lose Gold -> 30
    Variable 01 -30
    [item] -> +1
    Section 7: Using Variables To Trigger Events
    This is probably the most common use of variables. Let's say Jack has to talk to "Billy" before getting an item from "Maria". How would you accomplish this? Using a variable! When creating the message for "Billy", add this script(good to use Billy's internal variable for this):

    Code:
    "Hi my name is Billy, go talk to Maria to recieve the item you seek"
    Billy Internal Variable 01 +1
    Then when you talk to Maria have the following script:

    Code:
    Val Branch Internal Variable:Billy 01
    = "0"
    "Go talk to Billy"
    = "1"
    "Heres your item"
    Chapter 8: Using Variables To Track Passing of Time
    Here's another good variable use, tracking the number of days that has passed. Its simple, whenever you sleep, add +1 to the variable you select as the "Day" variable.
    The downside to this is that you cannot use pre-made Inns, you'll have to make your own custom script Inns.
    With this variable you can use it to make certain events happen on certain days, you can also make the days reset after a certain amount(such as 30 for a month, 7 for a week) and have events repeat depending on what day of the month/week it is.

    Chapter 9: Q&A
    Last edited by JPS; 01-05-2008, 10:21 PM.

    Here I come Pav, like the Kool-Aid man barging into a funeral! Oh yeah!

    #2
    Re: The Official Variables Tutorial

    I'll throw this stuff into my topic.
    May as well keep it open for discussion. *shrug*

    Comment


      #3
      Re: The Official Variables Tutorial

      Sorry, Ive been thinking about making this for a while, just never got around to it til tonight, now I see its too late

      Here I come Pav, like the Kool-Aid man barging into a funeral! Oh yeah!

      Comment


        #4
        Re: The Community Variables Tutorial

        "Variables are numeric strings that stores a value to something that the creator chooses."

        I always felt that if someone didn't understand variables, that it would be unlikely they would understand this explanation.

        In layman's terms: A variable is a box that holds numbers inside.
        stodi no na ka cenba

        Comment


          #5
          Re: The Community Variables Tutorial

          I was trying to find a laymans example but I couldnt find the words, that fits perfectly thanks

          Here I come Pav, like the Kool-Aid man barging into a funeral! Oh yeah!

          Comment


            #6
            Re: The Community Variables Tutorial

            What's a box?


            Seriously though, this is helpful info. I understand perfectly what variables are, but it's still nice to have all the info compiled like this. My math skills suck.

            Comment


              #7
              Re: The Community Variables Tutorial

              I cant believe theres people out there that cant comprehend a laymans example of a variable...its mind boggling.

              and the most frustrating thing is there is no simpler way of explaining such an easy thing

              Here I come Pav, like the Kool-Aid man barging into a funeral! Oh yeah!

              Comment


                #8
                Re: The Community Variables Tutorial

                Well, it took me quite awhile to catch on. But I managed on my own. I can understand people being confused. After all, I bet most of the posts for help in the rpg maker workshop are about flags and variables.

                Comment


                  #9
                  Re: The Community Variables Tutorial

                  Is there a good, detailed explanation fo the diff tween shared and internal variables?
                  Shalom,
                  Brian

                  Comment


                    #10
                    Re: The Community Variables Tutorial

                    There is none.

                    Comment


                      #11
                      Re: The Community Variables Tutorial

                      Yeah, no difference at all, one can be used just like the other.

                      Here I come Pav, like the Kool-Aid man barging into a funeral! Oh yeah!

                      Comment


                        #12
                        Re: The Community Variables Tutorial

                        Variables are hard to understnad because they are over analyzed. It is hard to explain something to someone when they have it set in there head that it is unbelievably hard/challenging.
                        "Dans le veritable amour c'est l'ame, qui enveloppe le corps"

                        Comment


                          #13
                          Re: The Community Variables Tutorial

                          In my attempts to explain variables to the uninitiated, I like to use layman's terms such as "raccoon fecal matter."

                          Comment

                          Working...
                          X