Saving Types

BlitzPlus Forums/BlitzPlus Programming/Saving Types

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hi

What I suggest is that when you load a saved game, you delete all the level's current info and then recreate the level using the saved info. That way, you eliminate 'update' errors and could then see if all the data is actually being saved correctly.

Example Code:
Delete Each Door
LevelFile=ReadFile("Level.dat")
No_Of_Doors = ReadInt(LevelFile)
;Doors in the level is the first thing saved in the datafile
For N=1 to No_Of_Doors
doors.Door = New Door
doors\open = ReadInt(LevelFile)
.
. (Other Data)
.
Next
CloseFile(LevelFile)

Another cause of your problem might be to do with what your saving - Be careful if you're saving loads of variable length strings as they could be overwriting the data which concerns the doors' open/closed status.

Hope this helps!

Ryan

P.S. How do you insert code into a forum post with the black background and green text format?