xml tutorial

Discussion and feedback on Construct 2

Post » Wed Aug 29, 2012 10:17 pm

many thanks for the help. i still can't get it to load.

where to store the external xml file? in the project folder it does not work for me. does it need to be on a http: adress? can it also be https, like dropbox?

and what happens if i dont enter a tag?
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Post » Fri Sep 07, 2012 5:09 am

This thread was very useful! Loading a level from an xml file was a piece of cake.
All my level system will be stored as xml files :)

Every day learning how to do different things in Construct 2. Awesome work Scirra :)GamerGon2012-09-07 05:24:28
B
29
S
6
G
5
Posts: 148
Reputation: 5,084

Post » Mon Jan 28, 2013 11:42 am

Hello, i have the same problem like xeed, i am not able to load from file. Could you help me ?

@xeed, have you solve your problem ?
Webmaster of the French community from Construct Classic and Construct 2
B
80
S
13
G
8
Posts: 27
Reputation: 7,710

Post » Mon Jan 28, 2013 2:41 pm

@squale
Did you import your xml file to your project? Right click on the project explorers "Files" folder and choose import files.vee412013-01-28 14:42:48
B
24
S
8
G
7
Posts: 756
Reputation: 7,202

Post » Mon Jan 28, 2013 8:39 pm

Yes I have imported the xml file
Webmaster of the French community from Construct Classic and Construct 2
B
80
S
13
G
8
Posts: 27
Reputation: 7,710

Post » Thu Jan 31, 2013 2:59 am

So many thanks you guys!!
B
9
S
4
Posts: 14
Reputation: 1,436

Post » Tue Feb 12, 2013 1:01 pm

guys, scheme with AJAX doesn`t work and i can`t figure out why.
B
7
S
2
Posts: 49
Reputation: 982

Post » Tue Mar 05, 2013 3:56 am

If it can help anyone, we found one possible cause for external XML not being found in the project folder. On my PC it turned out that the XML file that I would import in the project tree was not the one that I saved in the project folder, but appeared to be a copy of it created in some folder located here:

AppData\Local\Temp\c2-2RFORI\

So when I changed that XML in that directory and tested again, it updated in the game and worked just fine.
Joy!!!
B
4
S
2
G
2
Posts: 108
Reputation: 1,366

Post » Wed Aug 07, 2013 11:35 am

Hi I've got my xml through some PHP on my server to solve domain issues and AJAX has loaded it to my game.

now to breaking in to useful stuff

my tree

1              event
2               sub event

1              event
2               sub event

1              event
2               sub event

So am I right in thinking the sub events in C2 should mimic the xml?
1 = the root     = event
2 = the string   = sub event

in blackhornet's tutorial I can see three sub events and three branches.
If I use the same xml as him and ignore the Catalog level, will I be on the right track?

Apologies if I've used the wrong terminology and if blackhornet isn't a he. I've edited the post after going and looking at the blackhornet tutorial again, but I need more help :) I'm not getting data where I expect it to bedroidsculptor2013-08-07 14:17:28
B
8
S
2
G
1
Posts: 12
Reputation: 1,069

Post » Wed Aug 07, 2013 5:47 pm

I'm having Xeed's problem. I've imported the file. My capx to start looks exactly like what was posted earlier from the documentation. My very next line is a super simple test XML -> for every node "/nodename" Text -> "confirmed"

Nothing happens. It's like the file is not being loaded at all. I have no idea what I've missed.

BTW, this works if instead of trying to load it through ajax, I just paste the xml in as a string.
B
14
Posts: 20
Reputation: 945

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 1 guest