Hello there.
I have a problem with a file that I created to save some information I have to save even between classical save.
How can I check if an information is in the file or not ?
That's the part of my script that load informations.
As I'm still creating the game, it's sure that I will add some other variables in the file. But when I add that, I cant load any game save cause that cant find new variables.
I need to check if a variable exist in file and if not I could recreate this one as if I was starting a new game.
I dont know if it's clear enough, sorry if isnt. Was hard to try to explain that in english.
I have a problem with a file that I created to save some information I have to save even between classical save.
How can I check if an information is in the file or not ?
That's the part of my script that load informations.
Code:
if File.exists?("Saveinfos.rvinfo")
file2 = File.open("Saveinfos.rvinfo","rb")
$mesinfos = Marshal.load(file2)
$messucces = Marshal.load(file2)
$succes_test = Marshal.load(file2)
file2.close
end
As I'm still creating the game, it's sure that I will add some other variables in the file. But when I add that, I cant load any game save cause that cant find new variables.
I need to check if a variable exist in file and if not I could recreate this one as if I was starting a new game.
I dont know if it's clear enough, sorry if isnt. Was hard to try to explain that in english.