Friday, 6 March 2015

Load & Save XML Data

As the game is going to include editable character stats i decided it would be a nice feature to be able to save those stats so that the user could come back to the game and have their character saved from the last session.

I decided the easiest was to do this would be to store the data inside an XML file.

This data was then read in through script, and stored as the variables within the player attributes.

I also decided that the data was also to be loaded seperatly when in the shop menu, as the player attributes script doesn't exist there. Therefore in the shop menu the data is loaded stored as a placeholder variable, and then when the user leaves the shop it is saved, and can be loaded with the updated stats when the game starts
 

No comments:

Post a Comment