Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Detecting if Save File Exists in Conditional Branch

Culex

Member

So I'm trying to escape the traditional RPG Maker XP title screen layout. Now here's my problem. How can you detect if a save file (any save file) exists within a conditional branch? I thought about setting a variable to Save Count, but then I realized that's for the amount of times you've saved the current game. I figured scripting was involved, so I tried this:

Code:
if FileTest.exist?("Save#{i+1}.rxdata")

...within the scripting function available for the conditional branch command, but the error is that the i is not defined. So, I tried doing this within a script patch before the branch (remember that bit within Scene_Title?):

Code:
for i in 0..3
      if FileTest.exist?("Save#{i+1}.rxdata")
        @continue_enabled = true
      end
    end

...I tried basing the conditional branch on whether or not @continue_enabled was true, but that didn't work either.

Again, my question is, how can you detect if a save file exists within a conditional branch? Thank you for your time.

Off-topic: I figured since my problem was within an Edit Event page and not the Scripting Database, that it would be okay to post this topic under RMXP General Support. If I'm wrong and it's not in the right place, well, you know what to do.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top