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

[Eventing Question] How to save in the middle of an event?

  • 4
    Posts
    6
    Years
    • Seen Apr 28, 2022
    In a later part of the game's story, it'll transfer the player to another map, then save, then restart. But when I resume, it repeats the save prompt.
    [PokeCommunity.com] How to save in the middle of an event?

    Here's pbfakeglitch:
    Code:
    def pbfakeglitch
      oldscene=$scene
      $scene=nil
      pbMessage(_INTL("The script is taking too long. The game will restart."))
      return if !$Trainer
      if safeExists?(RTP.getSaveFileName("Game.rxdata"))
        File.open(RTP.getSaveFileName("Game.rxdata"),  'rb') { |r|
          File.open(RTP.getSaveFileName("Game.rxdata.bak"), 'wb') { |w|
            while s = r.read(4096)
              w.write s
            end
          }
        }
      end
      if pbSave
        pbMessage(_INTL("\\se[]The game was saved.\\me[GUI save game] The previous save file has been backed up.\\wtnp[30]"))
      else
        pbMessage(_INTL("\\se[]Save failed.\\wtnp[30]"))
      end
      $scene=oldscene
      a = Thread.new { system('Game') }
      exit
    end
     
    One solution is below

    I'd just take out 'conditional branch' and do pure 'script' pbfakeglitch, then transfer player before that event. Since it seems like you're gonna transfer the player either way.

    The 'script' event is on page 3 of 'event commands', very last one.

    @>Fade Screen To Black
    @>Transferplayer:New_Map
    @>Script:pbfakeglitch

    or if you need to 'check' a variable, then separate pbfakeglitch script. One to check for variable, another to save. then place Transferplayer in between. etc.

    ~Reason why original logic it's not currently working as intended~
    The saving happens before the transferring the player. Thus when the player's load, it'll be before they transfer to new map.

    Within the script, variables aren't returning besides `if !$Trainer` for the conditional branch to depend on, you'd need to return true or false or some kind of check.
    If you were to put '$game_variables[1] == 0' in the script section of 'conditional branch' instead of 'pbfakeglitch', then it would have something to determine from.
    Or if you were to determine said 'dependence variable' within 'pbfakeglitch' then use those variables to determine the 'conditional branches
     
    Last edited:
    Did that, but it does the same thing. I'm on the new map, but the event is repeated
     
    Back
    Top