Checking for Save Files

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
splendidland
Red Slime
Posts: 42
Joined: Tue Feb 19, 2013 11:06 am
Contact:

Checking for Save Files

Post by splendidland »

Good evening!

I'm currently working on an intro cutscene, I've made it so if you press any key as it plays out, you can skip straight to the title screen, however i'd like it to be unskippable if the player doesn't currently have any saves, to ensure that it must be watched the first time you open the game. what would be the simplest "if" command to see if any saves are stored?
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7658
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Add this script to .hss file:

Code: Select all

script, check if any saves exist, begin
  variable(slot)
  for(slot, 1, 32) do(
    if(save slot used(slot)) then(exit returning(true))
  )
  exit returning(false)
end
Then in your intro cutscene script, you can do something like this:

Code: Select all

if(check if any saves exist) then(skipping happens here)
splendidland
Red Slime
Posts: 42
Joined: Tue Feb 19, 2013 11:06 am
Contact:

Post by splendidland »

thank you very much, everything works perfectly!
Post Reply