Game Development Community

Persistent player data across levels

by Joe Williams · in Torque Game Builder · 11/22/2008 (11:42 pm) · 3 replies

I'm sure this has been discussed before, but I can't find it using the forums search.

I need to have player data save, load, and persist across levels. For instance, if a player gets $300 in a level, they'll have that $300 when they go into the town level, or when they go into the next combat area. I thought I could do this by creating a player class with the necessary variables and member functions, but I'm not sure how to even start doing that. Anyone have any suggestions?

#1
11/23/2008 (4:27 am)
Try using a global object that only reinitializes when a "New Game" is selected. There is actually a persistent data file in the project folder. From your game directory go to game/managed/persistent.cs. This object holds persistent data from the level builder so you won't want to use this. Just set up an object like this and save objects and values to it. If you make a save game utility, you can simply save your persistent set.
#2
11/24/2008 (8:38 am)
Sweet. Thanks!
#3
11/26/2008 (3:10 pm)
A very good suggestion by Greg :)