Save/Load tutorials

Save/Load tutorials

I'm looking for a tutorial on saving and loading on the 360 (I'm using XNA 2.0). I noticed a few different tutorials available that include this functionality, but I was wondering which was the best to look into just for save and load functionality.

In my game, I'm simply looking for a load function that will load saved game data file upon player request at a start of a game, and a save function for saving game data upon player request at any point in the game.

they do not work,sorry. The demo they gave is a pore excuse of an sample. On the windows version they use gamepad not keyboard even if its a windows version of the sample.

The person that coded that sample did an horrbile approach.

Ive used their sample to load/save on the xbox and it doesnt work. they need to fix how saving and loading works on the xbox because its a joke. All i get is access errors from their samples. When i tried to use their sample, i got field erriors because their code isnt organized. i exept more from microsoft developers than the save/load documentation sample. I wasted 4 hours trying to figure out the load/save from the microsoft xna 3.0 document sample and got no where from it.

Ill show you what i mean.

This like: (This might look very simple but when ur trying to do this in ur own project, it gives head-aches)

this.device = null;

this is how its placed (they call "device" to null but device is way below the call)

// Reset the device

this.device = null;

stateobj = (Object)"GetDevice for Player One";

Guide.BeginShowStorageDeviceSelector(

PlayerIndex.One, this.GetDevice, stateobj);

}

}

// If a save is pending, save as soon as the

// storage device is chosen

if ((GameSaveRequested) && (result.IsCompleted))

{

device = Guide.EndShowStorageDeviceSelector(result);

if (device.IsConnected)

{

DoSaveGame(device);

DoLoadGame(device);

DoCreate(device);

DoOpen(device);

DoCopy(device);

DoEnumerate(device);

DoRename(device);

DoDelete(device);

DoOpenFile();

}

// Reset the request flag

GameSaveRequested = false;

}

base.Update(gameTime);

}

StorageDevice device;

void GetDevice(IAsyncResult result)

{

device = Guide.EndShowStorageDeviceSelector(result);

if (device.IsConnected)

{

DoSaveGame(device);

DoLoadGame(device);

DoCreate(device);

DoOpen(device);

DoCopy(device);

DoEnumerate(device);

DoRename(device);

DoDelete(device);

DoOpenFile();

}

}

2. They dont use "StorageContainer.TitleLocation" but in the help documentation they say to use "StorageContainer.TitleLocation". In this sample they use "cabinate.path"