Announcement

Collapse
No announcement yet.

variable help

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

    variable help

    I'm understanding the variable concept better, but does using a variable for one event in a town effect other towns in the game if I use the same variable in that place(ex. variable 01 included a val-condition branch with 2 options, 0=start 1=get item 2=don't get item). If I go to a different town or dungeon later in the game and set up a new event and use variable 01 again, will the same event that used 01 earlier happen again at this point? If it does, do I need to change 01 to 02 and base a different val-branch around that so this new event occurs? Basically, should I "event end" the 01 event so that it doesn't happen in the same place it already happened or anywhere else in the game? Is this what shared and internal variables deal with? What happens at one place stays there and never repeats or does using shared variables repeat the event every time you talk to the same person where you started the event. Which one do I use to stop events from repeating when I speak to the same person the event started with?

    #2
    Re: another variable question

    hmmm....

    whenever you set a variable with an event, that variable stays unti you change it.

    for example, i have a variable in the town of Pleiades reserved that represents whether or not you own house in that town. Now, at any time, I can reference that variable in the town of Orion, to check if I own a house in Pleiades. I never reference that particular variable, which is not shared, but a variable stored in the town itself. Given there are at least sixteen different variables you can use for each town/character/field/dungeon, there's no reason to use that specific variable anymore, because it will have negative effects on the events I use to check home ownership.

    when you choose a variable for an event, unless it's necessary for the event's success, you should never reuse the variable.

    referencing variables doesn't trigger events. only checks the value, add/subtracts/modifies it.
    One hoopy frood who always has his towel.

    Comment


      #3
      Re: another variable question

      No, you wouldn't have to go to Shared Variable two, but instead remember (write it down somewhere is a good idea) where you left off on Shared Variable 1. Let's say your event ends after Shared Variable 1=2. In your next event, start it with Shared Variable 1=3 and go on from there. I hope this helped.
      Last edited by Linkman712; 07-25-2007, 07:41 PM.
      Currently working on: The Lost Realm
      (For more info plz PM me)

      Comment


        #4
        variable help

        If you're frusrated about not knowing how to use variables in the game, don't worry. Once you learn a little about how to use them they will really help you out. Start with a simple event that doesn't use a lot of variables and practice from there. It took a couple weeks to figure out how to use variables in a simple event but once I figured it out, I experimented more and it does make scripting events easier. I'll explain the first event I completed using variables. Try something like this to get a basic understanding on how to use them.


        1. Create a town or building
        2. inside, pick a spot and create a character event. Move to the last screen where you can set up event codes for your character.
        3. In the event code list, you don't have to but just do it to make things easier, use a display message for the character. Have it say something like help me find my(whatever they lost). Create what they lost in the item editor and make sure to make it a treasure item and not a normal item.
        4. Next, after the display message in the event editor list, open the menu in there again and choose control, then select VA branch.
        5. A small menu will open giving you some options to choose from. Pick option 2 for now. You'll see some numbers now that look like this 123...0. You can change the 0's to anything. Right now though, leave the top at 0. On the one beneath it, change the 0 to a 1.
        6. Now when you look at the event editor you'll see 2 options that say "start" and "end" in yellow and another in blue.
        7.Select end in the top yellow branch and then use display message again if you want. This is what is going to happen while the variable is 0.
        8. In the bottom blue branch, choose end and write another message, but this time write something like thank you for helping me find my(whatever it was). In the next event code line, choose party control and select lose treasure item. This makes you lose the treasure item you found for them. You can write a message like thanks again in the next event code line if you want. Everything that happens in step 8 above will only happen if the variable has been raised to 1. To raise the variable from 0 to 1, here are 2 ways, the first is better in my game.
        1. set up a treasure event in the same room as the NPC that wants help. Place the treasure item in the chest, leave all the other options in the treasure event screen alone for now. Place the treasure event somewhere in the room, like the back wall. Now, you can open the chest in playtest and get the item. Unfortunately, when you speak to the person who lost it, they'll just repeat the last thing they said because their variable is still at 0. To make the event 1 occurr where they take the item, you need to set up another event. In the same room, choose standard event and set the display on the first screen to invisible. In the next screen, go to the event code section and select property control. On this list, select increase shared variable, then enter 1. Also, be sure to select the with treasure item. Now, place this event near the chest, maybe an inch or so in front of the chest.
        Now go to playtest, but first make sure to set your character in the building where everything will happen. Now, in playtest mode talk to the NPC who wants help. You just did variable 0. If you keep talking to them, they'll keep repeating the last thing they said. Anyway, go to the chest you placed the item in. Before reaching the chest, you'll notice that you pass through a question mark and nothing happens. Nothing happens because that event can't happen until you have the treasure you need which is in the chest. Open the chest to get the treasure. Open the character menu with the square button and look at the status menu. Go to the far right on that menu and you'll see the treasure in your inventory. Now walk back to the NPC. You'll pass through the question mark again but this time your character will pause for less than a second if you set the command to "touch" in that event. What happened is that the invisible event just occurred and the variable changed to 1 because you had the item you needed to activate the invisible event. Now talk to the NPC and everything that you wanted to happen in variable 1 section(blue section) in the NPC's branch will happen.
        Also, the question mark circles you see in playtest mode will always appear there. Invisible events or not, all your events are marked with these and will trigger when they are supposed to. When you start your game from the main RPG maker 3 title screen, all the event question mark signs will be gone. So like in the event that just happened, you'll talk to the character, get the treasure, and your character will pause for a sec while walking back. It's not a glitch, it's just an event. If it frustrates you, you can edit that event by entering a display message in that event like, "I should take this back to(whoever), then when you activate that event, the character will still pause for a sec, but will say something instead so it doesn't look like the game glitches. Put invisible events like this one very close, but not too close to the treasure chest event so that when you obtain the item, just turn around and your character will say something.
        2. Do everything the same as above, but instead of displaying a treasure chest, make it invisible. When you walk over where the event is, you'll get whatever message you put for finding the item and it will look like you just found it lying on the ground. However, this only works with the standard event option. Don't create a treasure event for this. Also, if you do this, you can make the display a treasure chest and you'll get the item and the variable, you just won't see the chest open. So to make raising the variable shorter, just create a standard event. To make it a little better, create a treasure event and then set the event where the variable raises closeby so it activates shortly after you get whatever you need. I hope that helps a little. I still need some help with internal variables though.

        Comment


          #5
          Re: variable help

          Um... this came up on the forums four times...
          Last edited by Linkman712; 07-25-2007, 07:55 PM.
          Currently working on: The Lost Realm
          (For more info plz PM me)

          Comment


            #6
            Re: variable help

            Linkman712, you must find Waldo every time.
            My kind of life’s no better off
            If I’ve got the map or if I’m lost.

            Comment


              #7
              Re: variable help

              I don't know how, I just started using this site. Is there anyway of deleting threads if something like this happens by accident?

              Comment


                #8
                Re: variable help

                I'm not sure... I've seen something like this a few times, but it's never come up four times.
                Currently working on: The Lost Realm
                (For more info plz PM me)

                Comment


                  #9
                  Re: variable help

                  I'll fix it, but seriously, don't click the submit button fifty times!

                  Comment


                    #10
                    Re: variable help

                    Also animefan1980, please break up what your typing into paragraphs. It makes it easier for everyone to read.
                    Last edited by Arcturus; 07-25-2007, 08:50 PM.
                    Warning: Make sure brain is active before putting keyboard into gear.

                    Duct tape is like the Force. It has a Light side and a Dark side, and it holds the universe together.

                    Comment


                      #11
                      Re: variable help

                      Yeah.

                      Like how I always type a few sentences and then hit enter (return) twice so that I'm sure it will a space between my ideas/points/whatevers so that people can concentrate on one idea, then another.

                      It also makes it easier for people to quote your posts in replies and respond to different parts.
                      A God from the Machine - Menander

                      Comment

                      Working...
                      X