Announcement

Collapse
No announcement yet.

Variable help...and not how to do it!

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

    Variable help...and not how to do it!

    I was messing around with my current and first game with a rpg maker and finally figured out how to use variables in certain events. For instance, My game starts out about 5 steps away from a town gate. Opon nearing the town gate there is a short cut scene. Well everytime i would do this, and try to leave the city, it would play again. So i added a increase internal variable to my event and now it works! Im so proud of myself. lol.

    But when doing this, does the new variable stay throughout the game, or can I reuse it. So now that ive increased my main characters internal variable by one (the first variable) does it stay at two?
    Life is like a fat free box of chocolates...you never know what kind of crap your gonna get!

    #2
    Re: Variable help...and not how to do it!

    Yep. The variable will stay the same...until you change it again.
    Last edited by hitogoroshi; 06-03-2007, 04:56 PM.

    Comment


      #3
      Re: Variable help...and not how to do it!

      Thx for the fast response. But another thing off the top of my head. What are "shared" variables for and could someone give an example? Because i think ive got the hang of internal variables.
      Life is like a fat free box of chocolates...you never know what kind of crap your gonna get!

      Comment


        #4
        Re: Variable help...and not how to do it!

        Shared are exactly the same as internal - it's more of an organization thing. Like, say you want a variable to cover how many places the character has visited a la WoW or Elder Scrolls. You would need one variable to cover how places - shared variable. And then one for each location - internal, for the location. Like this:

        Autostart on visit
        Val Control Branch (internal #1 of location)
        If Internal #1 = 1 then
        Shared #1 + 1
        Internal #1 =2
        If Internal #1 = 2 then
        (blank)

        See, you COULD switch the shared and internal in the above example, like this:

        Autostart on visit
        Val Control Branch (shared variable #1)
        If shared #1 = 1 then
        location internal #1 + 1
        shared #1 =2
        If shared #1 = 2 then
        (blank)

        But then you'd need a new shared for each one, AND you'd have to remember which locations shared to use. It's a lot easier the first way.
        Oh, and I'm gonna put this in my stickied thread. Thanks for asking!

        Comment


          #5
          Re: Variable help...and not how to do it!

          ok then thanks! And no problem asking...being a little, uhhhh, challenged has its benefits lol. But from my point of view internal would be the way to go for events. They look easier.....and sound easier.
          Life is like a fat free box of chocolates...you never know what kind of crap your gonna get!

          Comment


            #6
            Re: Variable help...and not how to do it!

            Yeah, you usually use internal unless the variable is being tracked for multiple characters or places.

            Comment

            Working...
            X