If you use info variables (variables that have their name end with _i) then you can easily use game_save to store your database. All you need to do is give SV_INFO as the mode:
Code:
game_save("database",0,SV_INFO);



To save your level, you give SV_ALL-SV_INFO as the mode:
Code:
game_save("mylevel",0,SV_ALL-SV_INFO);



You then load your info save file back right when you start the game. Because game_load only changes things that were actually saved in the file you're loading, you can easily save and load your info (database) file at any time.
I assume your database has an undefined size, so you could define an array that has a length of a few thousand values like so:

Code:
var mydatabase_i[65535];



If you happen to use up all 65'535 values in that array, then you can always increase the amount of items in it.


Why spend so much time writing into custom file formats when you can just use what lite-C already gives you?

Last edited by TehV; 01/09/14 14:23.