GLOBAL SAVE FILE

RPG Maker VX Ace

Save switches and variables across all save files

  • theLEECH
  • 08/28/2013 07:53 AM
  • 8091 views
Does what it says on the box.

Feature
Switches and Variables that stay between save files

Instructions:
Copy and paste the script below ▼ Materials and above ▼ Main Process.
Configure the script where it says CONFIGURATION.

Overwrites:
# DataManager:
## self.load_game(index)
## self.save_game(index)
## self.setup_new_game

Posts

Pages: 1
You should consider using alias to "hook" those functions instead of overwriting them.

e.g.
#alias the original function
class <<self; alias load_game_lglobalsave load_game; end
#override the function
def self.load_game
  #call the original function
  load_game_lglobalsave
  #do custom stuff
  LGlobalSave.load if LGlobalSave::LOAD_ON_LOAD
end


The advantage is that if another script also hooks the same functions, it may be possible for the two scripts to co-exist.

Otherwise looks good, I can see a few uses for this script like saving options, achievements etc.
author=coelocanth
You should consider using alias to "hook" those functions instead of overwriting them.

e.g.
#alias the original function
class <<self; alias load_game_lglobalsave load_game; end
#override the function
def self.load_game
  #call the original function
  load_game_lglobalsave
  #do custom stuff
  LGlobalSave.load if LGlobalSave::LOAD_ON_LOAD
end


The advantage is that if another script also hooks the same functions, it may be possible for the two scripts to co-exist.

Otherwise looks good, I can see a few uses for this script like saving options, achievements etc.


Thank you. Its the first script i've written and i'm not very familiar with Ruby.
Ill try aliasing them.
Is it possible to have one file activate a switch, which then in another file it opens a door that was locked before? If so, can I get an explanation on how, I really want to use this if I can.
Pages: 1