playMaker

Author Topic: Change a FSM online (remotely) by XML or JSON?  (Read 2194 times)

JOY

  • Junior Playmaker
  • **
  • Posts: 51
  • From JOY Entertainment
    • JOY Entertainment
Change a FSM online (remotely) by XML or JSON?
« 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

elusiven

  • Full Member
  • ***
  • Posts: 233
  • Debt we all must pay...
Re: Change a FSM online (remotely) by XML or JSON?
« Reply #1 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
« Last Edit: December 01, 2016, 05:00:21 AM by elusiven »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Change a FSM online (remotely) by XML or JSON?
« Reply #2 on: December 02, 2016, 03:13:39 AM »
Hi,

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

Bye,

 Jean

JOY

  • Junior Playmaker
  • **
  • Posts: 51
  • From JOY Entertainment
    • JOY Entertainment
Re: Change a FSM online (remotely) by XML or JSON?
« Reply #3 on: December 02, 2016, 05:13:40 AM »
Hi @jeanfabre,

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

Thanks,
Anh

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Change a FSM online (remotely) by XML or JSON?
« Reply #4 on: December 14, 2016, 02:01:16 AM »
Hi,

 yes, updated the page for the json package.

 Bye,

 Jean