Xml request from tablet directory

Get help using Construct 2

Post » Thu Dec 12, 2013 2:37 pm

Hello all !

I'm currently working on a series of customizable mini games for a museum and I'm having trouble to make sure that I can call a XML file from a tablet folder.

Ajax is used to get files from a web server but I wanted to know if it can be used to get it from the tab and if is it even possible to get a tablet folder adress ?

If not, are there any alternatives (JSON or whatever)?
B
8
S
3
G
2
Posts: 35
Reputation: 2,175

Post » Fri Dec 13, 2013 12:15 am

* Bump *
B
8
S
3
G
2
Posts: 35
Reputation: 2,175

Post » Fri Dec 13, 2013 1:15 am

Can you put it in with the project files?
Otherwise, nope.
Image ImageImage
B
170
S
50
G
179
Posts: 8,378
Reputation: 113,425

Post » Fri Dec 13, 2013 11:57 am

Well the first game I made for them used ajax to get a XML file from a server so it wont be very useful to see how it's made.
Also I dont have the right to put the code online for everyone to see as it became their property at the end of my intership ... Sorry !

However I can offer a quick peek of the XML import in the game :
https://drive.google.com/file/d/0B-727M6ikDE_dmVLazNicFBCOVU/edit?usp=sharing

If you want to see what the game can look like please take a look at the "Archeo Pair Match" project on my blog.

Basically the game graphical assets and some object positions are imported from the XML. Next step is to get them from the Android tablet and not from a server.

Any ideas ?Shapter2013-12-13 12:00:11
B
8
S
3
G
2
Posts: 35
Reputation: 2,175

Post » Fri Dec 13, 2013 1:19 pm

If the XML file is a project file, the AJAX object's 'Request project file' action should work fine. How are you exporting/publishing?
Scirra Founder
B
399
S
236
G
89
Posts: 24,519
Reputation: 195,351

Post » Fri Dec 13, 2013 1:19 pm

Why would I need it?

In the editor look under Projects, to the right, right-click on Files, click Import files.

Add the Ajax object, for your action use "Request project file"

Edit:
Ninja'd by Ashleynewt2013-12-13 13:20:32
Image ImageImage
B
170
S
50
G
179
Posts: 8,378
Reputation: 113,425

Post » Sat Dec 14, 2013 12:58 pm

Thanks for your answers but I realise my explaination wasn't very clear ...

@ Ashley : I'm exporting with cocoonJS on Android.
@ Newt : I can't put the file directly in the project as the game customization would be handled by non tech savvy people :(

In fact i want the people from the museum (not programmers) to be able to modifiy the game graphic assets without opening C2 or making an APK.
They would be able to modify XML files and put them in a folder on the tab in order to change the game logo, backgrounds and call different game assets that are linked to their current exposition (the assets would be on the tab as well).

To sum up, I'm making some kind of customizable matching game engine for them, so they can adapt the games to whatever ancient civilization they are exposing.
It wouldn't be a problem if they had rock solid wifi in the whole building as I have built a prototype that requests XML and assets from a web server but they asked me if it could be done directly from the tab and I'm not sure that it's possible.

Is it ?Shapter2013-12-14 12:59:02
B
8
S
3
G
2
Posts: 35
Reputation: 2,175

Post » Sat Dec 14, 2013 1:28 pm

Why is it they can figure out how to replace an xml file, but not an image?

Edit:
The only other thing I could think of is embedding the images as base64 encoded urls into the xml.
That would require a separate app.

Edit2:
Xml wont work on Android.
Json will however.newt2013-12-14 13:53:28
Image ImageImage
B
170
S
50
G
179
Posts: 8,378
Reputation: 113,425

Post » Sat Dec 14, 2013 3:21 pm

I need them to use an XML / JSON file because it contains the adresses of the images and potentially their xy positions.

Are you implying that there is a simplier way to import images in the game without opening C2 ? Base 64 can be an option, I'll look into it !

As for Xml on android it worked when we tested the game last september, was there any new android update that screwed this up ?Shapter2013-12-14 15:38:03
B
8
S
3
G
2
Posts: 35
Reputation: 2,175

Post » Sat Dec 14, 2013 4:15 pm

As I understood it xml wouldn't work on it, however that may just be for non local files.
Image ImageImage
B
170
S
50
G
179
Posts: 8,378
Reputation: 113,425

Next

Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, dop2000, Lordshiva1948 and 6 guests