Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: DennisJensen on March 23, 2017, 12:29:00 PM

Title: Set Properties in XML file [SOLVED]
Post by: DennisJensen on March 23, 2017, 12:29:00 PM
Hi,

I'm struggling a bit with XML. I would like to load some data about the player, and that works fine. I then through scripts add XP for example and a player level, in the end I would like to save the data again to XML file, so I use Xml Set Node Properties which seems to work since it doesn't give me a error and the debug mode shows the right values, but when I then exits play mode the data is reset. Do I need to run a action after I set the properties? I don't use a Proxy xml.

Title: Re: Set Properties in XML file
Post by: DennisJensen on March 23, 2017, 06:33:10 PM
Okay I spend the evening trying to solve this problem and I found a solutions through some of the tutorials. So from what I could figure out you need to save your XML file as a playerprefs string and then you pull that next time you use your xml file.

I guess the reason is that Unity is only able to save player prefs? Would be nice if somebody could confirm that, it seems like a long work around.

Cheers
/Dennis
Title: Re: Set Properties in XML file
Post by: jeanfabre on March 24, 2017, 02:25:16 AM
Hi,

 yes, playerPref is the only place where Unity can store data on the device at runtime easily and as a built in solution.

 Bye,

 Jean
Title: Re: Set Properties in XML file
Post by: DennisJensen on March 24, 2017, 04:46:19 AM
Okay, thank you.