x


Trouble with save file

I'm having a bit of trouble with saving and loading, I'm using XML files to save the game and i want my game to pull name of the character from the XML file to label the character slots, the trouble is i don't know how to go about doing that in C#. can anyone help?

more ▼

asked Apr 24 '12 at 12:37 AM

Sinperhezine gravatar image

Sinperhezine
13 4 6 13

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

I you just want to save a name, you could also use PlayerPrefs :

http://unity3d.com/support/documentation/ScriptReference/PlayerPrefs.html

To save using XML files, you could use System.Xml.Serialization.XmlSerializer.

For example, create a class representing the player character et serialize an instance into a xml file. When you want to load, deserialize it to get the instance back.

http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx

The main problem of using xml file is that it is really easy for players to cheat, because it easy to edit a savefile written in xml.

more ▼

answered Apr 24 '12 at 08:06 AM

dnjata gravatar image

dnjata
241 3 4 7

this is what i was originally going to do but i was having trouble with making multiple save stat, although t i think i have figured that out.

May 03 '12 at 06:40 PM Sinperhezine
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x4175
x298
x256
x2

asked: Apr 24 '12 at 12:37 AM

Seen: 645 times

Last Updated: May 03 '12 at 06:40 PM