M
Mythi.T
Guest
Hello I have some questions about ini files
in my code I have this:
Do I need to have the "file exists" if statement? will it work? Can I remove it and add something else? what would bet hat something else? if you can solve/answer these questions that would help bunches.
also must I do this "file exists" if statement saving, not just loading?
SITUATION (so I don't have to explain to the questioners later)
Loading is automatic when the game starts
Saving is automatic upon level end
I Know how to read/write inside ini files, I just don't know how if there will e an error because I never made a ini file prior
Thanks
in my code I have this:
Code:
if !file_exists("aiSide.ini"){
needsaves_side = 1
}
else needsaves_side = 0
if needsaves_side = 0{
ini_open("aiSide.ini");
global.testOneGen = ini_read_real("testOne", "gen", 0)
global.testOneGrade = ini_read_string("testOne", "grade", "unsure...")
global.testOneHigh = ini_read_real("testOne", "high", 0)
ini_close()
}
also must I do this "file exists" if statement saving, not just loading?
SITUATION (so I don't have to explain to the questioners later)
Loading is automatic when the game starts
Saving is automatic upon level end
I Know how to read/write inside ini files, I just don't know how if there will e an error because I never made a ini file prior
Thanks