• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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.

Set a variable whenever the game is loaded

Rayd12smitty

Shadow Maker
645
Posts
12
Years
  • Seen Feb 21, 2016
I want to set a global variable to 1 whenever the game is loaded/new game is started. I have tried adding

$game_variables[100]=1

to multiple places in PokemonLoad but I keep getting syntax errors and such. Is there an easy way to do this? I only want it set when the game is loaded/started, and can be changed like normal, but is always at 1 when the game starts. This doesn't have to do with events. I am making a script that needs to have a variable set to 1 when the game is loaded
 
32
Posts
11
Years
  • Seen Jul 26, 2015
I hope that i understood you right.
if you want to do this when the game loads, go to the script "PokemonLoad" and add it behind line 427, for example, change this:
$game_variables = Marshal.load(f)
to this:
$game_variables = Marshal.load(f)
$game_variables[X] = Y;
while X is the variable id and Y is the number.

for a new game, go to the map "Intro" and just add this in event "Intro" somewhere.

sry for my english, and good luck in your game :)
 

Rayd12smitty

Shadow Maker
645
Posts
12
Years
  • Seen Feb 21, 2016
Thank you! I figured out for new game to just use Intro but I couldn't get Load. Thanks!!!
 
Back
Top