When using an ini file to store data, what can i do to load and modifying it (without changing the contents of the ini file), but only save to the ini file when the player actually chooses to save?
And now do i keep track of key events in an RPG or adventure type game, like wether or not a chest has been opened or a gate has been unlocked?
n/a
Pete Nattress Cheesy Bits img src/uploads/sccheesegif
Registered 23/09/2002
Points 4811
24th November, 2003 at 15:27:29 -
you could create a temp INI file which you modify as the game runs, then when "save" is clicked you copy the contents of the temp one into the actual one.
as for keeping track of many chests and stuff, you'll have to call each chest something unique (like chest1, chest2 etc.), then in the ini file, have it so if a chest's value = 0, then it's closed. If it equals 1, then it's open.
Then when a player opens a chest, set its value to 1 in the ini file, and reward the player with the contents of the chest. This way, he can only open the chest once... (provided you check if the chest is opened or closed when it's loaded)
So about this whole tempary ini file thing: whenever i load a frame like the stauts screen or a battle screen or something, then that means i have to load the temp ini file all over again?!?! Wont that be really slow if i have lots of data to keep track of? I mean, i'll probably have like 50 treasure chest objects in all, and 14 stats for my character (theres only one playable character). Or is this the way that everyone does it?
And another thing, whats a good way to keep track of modifications of your characters stats due to armor, weapons, accessories etc...?
n/a
Pete Nattress Cheesy Bits img src/uploads/sccheesegif
64 bits of data is hardly a lot. that's only about 200 bytes at max
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G