playMaker

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

DennisJensen

  • Full Member
  • ***
  • Posts: 104
    • View Profile
Set Properties in XML file [SOLVED]
« on: March 23, 2017, 09:29:00 AM »
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, 01:46:41 AM by DennisJensen »
Game Designer, CEO, Artist
http://2ndStudio.com

DennisJensen

  • Full Member
  • ***
  • Posts: 104
    • View Profile
Re: Set Properties in XML file
« Reply #1 on: March 23, 2017, 03: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: 15205
  • Official Playmaker Support
    • View Profile
Re: Set Properties in XML file
« Reply #2 on: March 23, 2017, 11:25:16 PM »
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
    • View Profile
Re: Set Properties in XML file
« Reply #3 on: March 24, 2017, 01:46:19 AM »
Okay, thank you.
Game Designer, CEO, Artist
http://2ndStudio.com