playMaker

Author Topic: Set Properties in XML file [SOLVED]  (Read 1658 times)

DennisJensen

  • Full Member
  • ***
  • Posts: 104
Set Properties in XML file [SOLVED]
« 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.

« Last Edit: March 24, 2017, 04:46:41 AM by DennisJensen »
Game Designer, CEO, Artist
http://2ndStudio.com

DennisJensen

  • Full Member
  • ***
  • Posts: 104
Re: Set Properties in XML file
« Reply #1 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
Game Designer, CEO, Artist
http://2ndStudio.com

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Set Properties in XML file
« Reply #2 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

DennisJensen

  • Full Member
  • ***
  • Posts: 104
Re: Set Properties in XML file
« Reply #3 on: March 24, 2017, 04:46:19 AM »
Okay, thank you.
Game Designer, CEO, Artist
http://2ndStudio.com