Saving a game

BlitzPlus Forums/BlitzPlus Programming/Saving a game

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.

Saving a game:

- Open file for writing
- Write some kind of header. A short one word text string like "MYSAVEFORMAT"
- Save how many characters you have in your party.
- Then for each character:
* Save stats
* Save equipment
* Save location
- Save what quests that is finished
- Save what quests that is currently active
- Close file


When loading a savegame:

- Open file for reading
- Read in the headerfile and check if it is valid.
- Assuming the header was correct:
- Read number of party members
- For each party member:
* Read stats
* Read equipment
* Read location
- Read list of finished quests
- Read list of active quests
- Close file

With the info you provided us with, there really is no other answer. Check the manual on how to open,read,write and close files, then use that to store everything that is important. It's as "simple" as that.

EDIT:
The relevant parts of the manual is these:
http://blitzmax.com/bpdocs/command_list_2d_cat.php?show=File
http://blitzmax.com/bpdocs/command_list_2d_cat.php?show=File/Stream

You want to use WriteFile( "mysavefile.dat" ) together with WriteInt, WriteString and/or any other Write* command in there for creating the savegames.

Then use ReadFile( "mysavefile.dat" ) together with the Read* functions to load it back in again. Make sure to read in the same order you write the data.