Announcement

Collapse
No announcement yet.

Hmm...Think I May Need Some Help Using Variables...

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

    Hmm...Think I May Need Some Help Using Variables...

    Variables were introduced in #2, right? I've only used #1 before, so I don't really know how to use them. I just remember how I used switches in #1, was pretty easy.

    Variables seem quite similar to switches, but they seem different too.

    Like I tried to test out making an object that says one thing to you, and then another message when a "variable" is triggered, which I tried to have triggered when the first message was given out. I fiddled around with it in a few different ways, but couldn't get it to work.

    Looks like it has something to do with values being met or equaled...not sure though. And then you have the shared and internal variables. Hrm.

    I feel like I'm missing a small bit of understanding that would make sense of all of it. There anything out there that could help me, or could someone give me a little friendly help? Heh.

    Thanks for any help provided.

    #2
    Re: Hmm...Think I May Need Some Help Using Variables...

    i don't fully get 'em so i never messed with them in any way. sorry i can't help ya.
    the legends have returned...whenever i can finish these, lol.

    Comment


      #3
      Re: Hmm...Think I May Need Some Help Using Variables...

      I am very confused as well. We really could use some guide to explain variables in RPGM3 in normal to understand words.

      Comment


        #4
        Re: Hmm...Think I May Need Some Help Using Variables...

        i need ones for just variables in general. i'm totally lost.
        the legends have returned...whenever i can finish these, lol.

        Comment


          #5
          Re: Hmm...Think I May Need Some Help Using Variables...

          I don't have RPGM3 yet, but this might clarify what a variable is.

          A Switch stores whether something is on or off.

          A Variable stores a value, like 0, 10, 50, 99, 999, or any other number.

          So if you wanted something to happen only if the player had already defeated a boss, you would use a Switch, because it requires a yes/no answer.

          But if you wanted something to happen only if the player had at least 5 of a certain item, you would use a Variable condition telling an event to happen only if the player had a number greater or equal to 5 of that item.

          So while a Switch can either be turned on or off and that's it, the value stored in a Variable can be changed. You can set it to a constant number, or you can add or subtract from the number currently. You could set a certain Variable equal to 0 when the player enters a room, and then make it so that when you talk to an NPC it adds +1 to that Variable. In this way you could track how many different NPCs the player has talked to in the room, and make it so that some storyline event happens only if you talk to a certain NPC aftet the player has talked to 10 others.


          In program languages like Java, C++ or Ruby, you are also able to store "strings" (letters, words and sentences) in a variable, but I don't know if this function is in RPGM3 and I don't want to confuse anyone.
          Last edited by TheHonorableRyu; 09-22-2005, 06:55 PM.

          Comment


            #6
            Re: Hmm...Think I May Need Some Help Using Variables...

            huh. i can't see any possible use for them in any of my games. least not right now. thanks a lot for the info.
            the legends have returned...whenever i can finish these, lol.

            Comment


              #7
              Re: Hmm...Think I May Need Some Help Using Variables...

              I believe with variables you can do something like the following:

              Have event battles, like an arena battle, then after every battle it adds +1 to one of the variables as to keep track on how many battles were fought. So then maybe the player can either get rewarded later for fighting a number of battles, or face harder battles after beating a certain number of them.

              Also maybe for a quest, say they need activate a item, like some sort of magic stone, and each time they activate a madic stone it adds +1 to a variable, and after you activate a certain number of stones you get a prize or a door opens up somewhere taking you to were you need/want to go.

              It just makes some situations easier as opposed to using multiple switches.

              Comment


                #8
                Re: Hmm...Think I May Need Some Help Using Variables...

                If you can use flage (switches) you can use variables.

                A flag is a variable with a fixed value of either 0 or 1.

                0 is off and 1 is on.

                Instead of tunring on your flag (or flipping your switch) just set your variable equal to one. Variables all begin with a value of zero, so it is just like a bank of switches all set to off.

                As you get good at this limited use, you will find many more.

                If anyone has specific questions, just ask.

                Peace.
                Last edited by Rodak; 09-22-2005, 07:17 PM.

                MOO!




                Comment


                  #9
                  Re: Hmm...Think I May Need Some Help Using Variables...

                  So...
                  using a flag is just like a switch.
                  So if you are fighting in the arena for the first time and win the match,
                  you have Flag1 with a value of 1 (yes is 1 right)
                  Then lets say you go to a counter asking for your winning price, system check FLAG1 is on, give 100 gold to the winner.

                  2nd battle, Flag2 value 1, give 200gold to the winner.

                  ( I understand you would have to use another flag to make the game know you already received the prize...to stop the game from giving you too much money)

                  That is if your using a flag.

                  Can you rewrite the thing if a variable was used?
                  Nothing like a comparaison to understand easily.
                  Last edited by Paladin_Jag; 09-22-2005, 08:19 PM.

                  Comment


                    #10
                    Re: Hmm...Think I May Need Some Help Using Variables...

                    Yeah, a translation of that process into using the variables of this game could be helpful.
                    Since in my test I did, like, set the needed variable to like 1 to try to activate it...but well, nothing worked.
                    If I could just replicate the switch stuff I've done before but with these variables, I'd be off to a good start.

                    Comment


                      #11
                      Re: Hmm...Think I May Need Some Help Using Variables...

                      Well, the example I posted was off the top of my head, I'll take a look at it when I get home since I can't remember the specifics and give a better explanation then if someone else has yet to do it.

                      Comment


                        #12
                        Re: Hmm...Think I May Need Some Help Using Variables...

                        Thx Pandacon I would really appreciate it.

                        Comment


                          #13
                          Re: Hmm...Think I May Need Some Help Using Variables...

                          Well, it's pretty easy.

                          First you create an event, then do the dialog thing, you might want them to ask if they want to fight. Then you give them a event battle. After that I put in a Battle Result Branch, and under the Win section I put the "Increase Internal Var." which I set to +1 for Variable 1 in Town 01. And under the lose section I left it blank so they wouldn't collect the +1 Variable.

                          So now each time they win a battle the Variable should go up one point. I haven't found a way to display the variables qty.

                          But now, with this variable you can set an event with the condition of Value >= variable, I set it for five, so then the event would give my character 100 gold once I activated it with 5 or more in that variable, and then I created a second mode and made an event in the first mode that would activate the second mode so the player couldnt keep grabbing the 100 gold. Easy as pie.

                          You could probably do all this with items instead of variables, but since they made the game so you have a limited number of items in your bag, variables is a good way to do it.

                          Hope that made sense.

                          Comment


                            #14
                            Re: Hmm...Think I May Need Some Help Using Variables...

                            little bit. think i'm starting to get it.
                            the legends have returned...whenever i can finish these, lol.

                            Comment


                              #15
                              Re: Hmm...Think I May Need Some Help Using Variables...

                              I never understood how people have trouble with variables. Either way, here's how I taught myself how variables work;

                              Variables are, in layman's terms, containers with a set number of things inside of them.

                              For example, you have a bag full of 12 apples. The bag is the variable and the apples are the number stored inside. You use variables to alter event conditions. For example, say you wanted to get past farmer brown but he won't let you pass without 4 apples. Giving him 4 apples, you know have 8 and you want to buy the shiny new longsword which costs 9 apples. Unfortunately, because you don't have 9 apples, the event doesn't trigger (in layman's terms, the shopkeeper says "NO DEAL"), and you have to find 1 more apple before you can continue on.

                              I'm glad they did away with switches/flags. I like being able to just reference a page (er, mode) at any point.

                              Comment

                              Working...
                              X