Read a changing xml file

Get help using Construct 2

Post » Sat May 05, 2012 4:20 am

Just wondering if there is a way to read an XML file that is being continually updated by another application.

I'd like to use Max/MSP to keep re-writing an XML file with data that I can read into a Construct 2 game which would have to keep re-reading the data to register the changes.

Any ideas?
B
5
G
2
Posts: 40
Reputation: 930

Post » Mon May 07, 2012 8:01 pm

Manual - http://www.scirra.com/manual/139/xml
For dynamic (JSON-)loading there are also some custom plugins.. (I personally prefer JSON if possible because the format conatains less characters to load..)
B
14
S
6
G
5
Posts: 173
Reputation: 4,742

Post » Wed May 09, 2012 12:11 am

Thanks Joe -- do you know if there would be any issues dynamically updating the xml or json to a Construct 2 game in my DropBox, and then having it dynamically loaded?

Or is there any other better way to write to simple data lists that can be read from a Construct 2 game?

If it was just on a single computer, no problem, but online I don't know how this works
B
5
G
2
Posts: 40
Reputation: 930

Post » Wed May 09, 2012 12:14 am

You might want to consider webstorage ? (check the how do I FAQ for example of uses)
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Wed May 09, 2012 3:57 pm

@birdlantern
I suppose that's not possible with a dropbox file. I do that with php on a webserver.. it's not very complicated but you have to have little knowledge about ajax and
have a webspace with php.. ;)
I haven't used the webstorage plugin so I can say nothing about that.. afaik this plug stores locally.. Joe72012-05-09 16:02:29
B
14
S
6
G
5
Posts: 173
Reputation: 4,742

Post » Wed May 09, 2012 11:56 pm

@joe7

thanks, that's exactly the answer I'm looking for. Sounds like it's beyond my skills at this point, but maybe someone will come up with a plugin in the future

cheers!
B
5
G
2
Posts: 40
Reputation: 930

Post » Wed May 09, 2012 11:59 pm

@kyatric

thanks for that, webstorage looks interesting for other purposes, but doesn't look like I can use it to write data into or out of Construct for use by another application, if I understand correctly?

But good to know that a framework for save games is there!
B
5
G
2
Posts: 40
Reputation: 930

Post » Thu Jan 17, 2013 3:11 am

System -> Ajax -> request (example.xml)

Ajax -> on ajax completed -> XML load (ajax.lastdata)
             text set text to ajax.lastdatacesjavi2013-01-17 03:14:39
B
2
Posts: 1
Reputation: 402


Return to How do I....?

Who is online

Users browsing this forum: austinblackbelt and 13 guests