• 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!
  • 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.

Essentials Update Assistant

  • 77
    Posts
    4
    Years
    • They/Them, One/One
    • Seen Apr 24, 2023
    The Update Assistant is a script that helps update player's games when they get a new version of the game and prevents players with newer versions of the game from playing old versions and possibly breaking their saves. The instructions are in the script itself, along with settings you can use. If you've got any questions, feel free to ask.

    Code:
    ################################################################################
    # _   _          _      _           _          _    _            _  
    #| | | |_ __  __| |__ _| |_ ___    /_\   _____(_)__| |_ __ _ _ _| |_
    #| |_| | '_ \/ _` / _` |  _/ -_)  / _ \ (_-<_-< (_-<  _/ _` | ' \  _|
    # \___/| .__/\__,_\__,_|\__\___| /_/ \_\/__/__/_/__/\__\__,_|_||_\__|
    #      |_|  
    # _                       _            _                                   
    #| |__ _  _   __ _ __ ___| |_ _ _ __ _(_)_ _  ___ _ _ __ ___ _____ _ _ _  _
    #| '_ \ || | / _` / _/ -_)  _| '_/ _` | | ' \/ -_) '_/ _` \ V / -_) '_| || |
    #|_.__/\_, | \__,_\__\___|\__|_| \__,_|_|_||_\___|_| \__,_|\_/\___|_|  \_, |
    #      |__/                                                            |__/
    #
    # "Update Assistant by acetraineravery"
    ################################################################################
    # To use, put "pbNewGameVersion" near the end of your intro/new game sequence
    # and "pbCheckUpdater" after
    #
    #        if !$game_map.events   # Map wasn't set up
    #          $game_map = nil
    #          $scene = nil
    #          pbMessage(_INTL("The map is corrupt. The game cannot continue."))
    #          return
    #        end
    #
    # in PScreen_Load.
    ################################################################################
    CURRENT_GAME_VERSION = 1.0 # The version of your game. Do NOT use a number below
                             # your last version's update number.
    
    UPDATE = true            # True by default. If false, there will be no update
                             # sequence. This is used if you don't need the player's
                             # info to be changed in a specific version.
                            
    USE_COMMON_EVENT = true  # True by default. If true, it uses a common event to
                             # update. If false, it will use ruby code instead.
                             # The code section can be edited in
                             # "INSERT SCRIPT STUFF HERE"
    
    UPDATE_COMMON_EVENT = 10 # If USE_COMMON_EVENT is true, this is the id of the
                             # common event being used for updating. 10 by default.
    
    UPDATE_VARIABLE = 90     # The variable used for updates. Do not change outside
                             # of this script.
    ################################################################################
    
    def pbNewGameVersion
      if $game_variables[UPDATE_VARIABLE] == 0
        $game_variables[UPDATE_VARIABLE] = CURRENT_GAME_VERSION
      end
    end
     
    def pbCheckUpdater
      if $game_variables[UPDATE_VARIABLE] > CURRENT_GAME_VERSION
        Kernel.pbMessage("Your save file comes from an incompatible version of the game.")
        Kernel.pbMessage("Please update to the latest version of the game!")
        scene=PokemonLoad_Scene.new
        screen=PokemonLoadScreen.new(scene)
        screen.pbStartLoadScreen
      else
        if $game_variables[UPDATE_VARIABLE] != CURRENT_GAME_VERSION
          if UPDATE == true
            if USE_COMMON_EVENT == true
              pbCommonEvent(UPDATE_COMMON_EVENT)
            else
              # INSERT SCRIPT STUFF HERE #
              Kernel.pbMessage("Game was updated!")
            end
          end
          $game_variables[UPDATE_VARIABLE] = CURRENT_GAME_VERSION
          pbSave
        end
      end
    end
    
    PluginManager.register({
      :name => "Update Assistant",
      :version => "1.0",
      :credits => "acetraineravery",
      :link => "https://reliccastle.com/resources/515/"
    })
     
    Back
    Top