mattkw80
Well-known member
I am writing a Pokemon style RPG game in Visual Basic.
There are hundreds of variables, that represent the character's stats, and as well, things that have been "unlocked" during game play, world events, etc.
Does anyone know a really simple way of "freezing" all the variables in place so that I could then read that state, and load it again. (Basically, a SAVE game and Load Game method) without having to type out every single variable there is.
Right now what I do have working, put is a pain to maintain is a system that dump all the variable values to a textfile, and then my load method reads them all back.
ie:
This does work - but it sucks to have to update everytime I add new variables to the game, and as well, new versions of the game cannot properly load old version of save files.
Anybody know a clever way of handling this problem?
There are hundreds of variables, that represent the character's stats, and as well, things that have been "unlocked" during game play, world events, etc.
Does anyone know a really simple way of "freezing" all the variables in place so that I could then read that state, and load it again. (Basically, a SAVE game and Load Game method) without having to type out every single variable there is.
Right now what I do have working, put is a pain to maintain is a system that dump all the variable values to a textfile, and then my load method reads them all back.
ie:
VB.NET:
'SAVE GAME
objWriter.WriteLine(cash)
objWriter.WriteLine(health)
objWriter.WriteLine(magic)
objWriter.WriteLine(ammo)
objWriter.WriteLine(level2unlocked)
'LOAD GAME
cash = objReader.ReadLine()
health = objReader.ReadLine()
magic = objReader.ReadLine()
ammo = objReader.ReadLine()
level2unlocked = objReader.ReadLine()
Anybody know a clever way of handling this problem?
Last edited by a moderator: