Jump to content


Photo

How can you tell if a savegame exists?


  • Please log in to reply
4 replies to this topic

#1 gardian20

gardian20

    GMC Member

  • GMC Member
  • 99 posts
  • Version:GM:Studio

Posted 03 March 2012 - 10:29 PM

Hey everyone,

I was wondering what should be put in an if statement to tell if a savegame exists or not.

Thanks for any help
~gardian20
  • 0

#2 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 16814 posts
  • Version:GM:Studio

Posted 03 March 2012 - 10:33 PM

You need to use the "file_exists" command and just...

if file_exists("gamesave.sav") do something...

CanŽt remember what the actual GM save file is called right now, but just play a game and press f5, then look in the directory of the game gm81/gmk and youŽll find it!
  • 1

#3 gardian20

gardian20

    GMC Member

  • GMC Member
  • 99 posts
  • Version:GM:Studio

Posted 03 March 2012 - 10:55 PM

You need to use the "file_exists" command and just...

if file_exists("gamesave.sav") do something...

CanŽt remember what the actual GM save file is called right now, but just play a game and press f5, then look in the directory of the game gm81/gmk and youŽll find it!

oh, i have been using the name without .sav on the end with game_load(thing) and game_save(thing)
  • 0

#4 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 16814 posts
  • Version:GM:Studio

Posted 03 March 2012 - 11:04 PM

The name has to be in quotes... either "name.sav" or 'name.sav' will, do, and as I said, just save a game and open your game folder to see exactly what the file that was saved is called!
  • 0

#5 gardian20

gardian20

    GMC Member

  • GMC Member
  • 99 posts
  • Version:GM:Studio

Posted 04 March 2012 - 02:19 PM

The name has to be in quotes... either "name.sav" or 'name.sav' will, do, and as I said, just save a game and open your game folder to see exactly what the file that was saved is called!

gotcha, thanks alot, IT WORKS!
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users