Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: JOY on December 01, 2016, 04:41:07 AM

Title: Change a FSM online (remotely) by XML or JSON?
Post by: JOY on December 01, 2016, 04:41:07 AM
Hi,

I'm new with PlayMaker and would like to achieve this:
I have a FSM to define the rules to generate the maps in my game. It works correctly but I'd like to update it online/remotely (without submit new builds to App Store). I think about XML/JSON online import but don't know how to do it.
Could you please guide me?

Thanks,
Anh
Title: Re: Change a FSM online (remotely) by XML or JSON?
Post by: elusiven on December 01, 2016, 04:48:43 AM
Well... To download XML content all you have to do is something like this

This is my version to do something I need to do so it might be slightly different.

public IEnumerator DownloadAndSaveXML(int difficulty) {

      string urlXML = "url/elsapp/Difficulty_" + difficulty + ".xml";

      WWW www = new WWW (urlXML);
      yield return www;

      if (www.error != null) {
         Debug.Log ("Error Downloading XML");
      } else if (www.isDone) {
         
         Do something with www.text (this is the content from xml)
                       You can put it in a string or perhaps create an xml file, put it there and save it in persistence datapath.

      }
   }

I'm using code to do this rather than Playmaker, not sure why it just seem quicker for me to write this. But to use Playmaker to do this I think it's pretty much similar to the WWW action. and then www.text is the content
Title: Re: Change a FSM online (remotely) by XML or JSON?
Post by: jeanfabre on December 02, 2016, 03:13:39 AM
Hi,

 you can also give a it a try with xmlMaker ( on the Ecosystem)

Bye,

 Jean
Title: Re: Change a FSM online (remotely) by XML or JSON?
Post by: JOY on December 02, 2016, 05:13:40 AM
Hi @jeanfabre,

Did you mean this one? https://hutonggames.fogbugz.com/default.asp?W1133

Thanks,
Anh
Title: Re: Change a FSM online (remotely) by XML or JSON?
Post by: jeanfabre on December 14, 2016, 02:01:16 AM
Hi,

 yes, updated the page for the json package.

 Bye,

 Jean