• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Global Variables...?

Jay-Kunn

Lawfully Evil
  • 19
    Posts
    13
    Years
    Be warned, this will be the first of MANY questions I will ask.

    But, what is the point of the Global Variables? Like... what are their functions?

    1 = won, 2 = lost, 3 = run, 4 = caught.

    Say if I wanted to fight a Mewtwo, much like the Wiki's example. What would the variables mean for the Mewtwo.

    Please don't try to bash me, also. I'm merely asking a question, albeit a (possibly) simple one.
     
    I believe Global Variables are like common events. They are active through the entire game so you don't have to do it yourself for every event. For example, you enter a battle, you lose and black out, then a Global Variable which already exists in the game scripts is switched ON. This Global Variable will take you to the pokemon center where you last healed your Pokemon, the Pokemon are healed, the Global Variable is switched OFF.

    Another example,
    You enter a gym where there are 5 trainers and the gym leader. You battle 2 of those trainers. You then battle the gym leader and defeat him/her. A Global Variable is switched ON when you get your badge. This variable will "deactivate" the 3 remaining trainers in the gym that you didn't battle so they don't battle you anymore.

    I hope this helps you.

    Also, you can visit this page on the Essentials wiki for more information on these events. https://pokemonessentials.wikia.com/wiki/Events
     
    I believe Global Variables are like common events. They are active through the entire game so you don't have to do it yourself for every event. For example, you enter a battle, you lose and black out, then a Global Variable which already exists in the game scripts is switched ON. This Global Variable will take you to the pokemon center where you last healed your Pokemon, the Pokemon are healed, the Global Variable is switched OFF.

    Another example,
    You enter a gym where there are 5 trainers and the gym leader. You battle 2 of those trainers. You then battle the gym leader and defeat him/her. A Global Variable is switched ON when you get your badge. This variable will "deactivate" the 3 remaining trainers in the gym that you didn't battle so they don't battle you anymore.

    I hope this helps you.

    Also, you can visit this page on the Essentials wiki for more information on these events. https://pokemonessentials.wikia.com/wiki/Events

    Thank you very much.

    However, I still need to know about Mewtwo's example.
     
    I believe Global Variables are like common events. They are active through the entire game so you don't have to do it yourself for every event. For example, you enter a battle, you lose and black out, then a Global Variable which already exists in the game scripts is switched ON. This Global Variable will take you to the pokemon center where you last healed your Pokemon, the Pokemon are healed, the Global Variable is switched OFF.

    Another example,
    You enter a gym where there are 5 trainers and the gym leader. You battle 2 of those trainers. You then battle the gym leader and defeat him/her. A Global Variable is switched ON when you get your badge. This variable will "deactivate" the 3 remaining trainers in the gym that you didn't battle so they don't battle you anymore.

    I hope this helps you.

    Also, you can visit this page on the Essentials wiki for more information on these events. https://pokemonessentials.wikia.com/wiki/Events

    Although, can't you just do that switches? You could create a switch and add another page on the trainers. Then when you defeat the gym leader this switch turns on and the trainer's switch to their second page which doesn't have a battle event in it.
     
    The point of 1=won etc. is for re-battles and fleeing and things like that...

    For example, if you battle Mewtwo Level 100, but you only have Level 40's, you're going to get smashed... So, the variable you use, will be set to either 1-4, so... You could use another page with say condition $game_variable[x]=2 and therefore, Mewtwo can still be in the exact same position, but say something like:

    "I beat you once, for a re-battle you've got to find me"

    Then you could make Mewtwo a roamer.

    I'll give an example of all of them... They will require condition branches.

    $game_variables[x]=1, He can say a message after beating him saying:
    "That was a great battle, I would like to join your team."

    $game_variables[x]=3, He could say something like:
    "Why did you run from me?!"
    "Now you will have to find me."
    Then make him a roamer.

    $game_variables[x]=4, You would most probably just use a selfswitch"A"==true here

    Hope this helps

    EDIT: Yes, you would probably use switches to do what has been said, I wouldn't use variables unless you need a few decisions to be made.
     
    Back
    Top