Problems with xml

Discussion and feedback on Construct 2

Post » Sat Jul 02, 2016 12:41 am

I am creating a rpg item system, and i am cofigure the attributes with xml, but now i have a problem, if i call the item with id=1 in the script, it works, but if i call other id's, do not work, what this happening? Look some images below who i had printed (sorry for my english :) )

(open the image in a new tab to see it better)
Image
Image
Image
B
8
S
3
G
1
Posts: 9
Reputation: 1,191

Post » Sat Jul 02, 2016 3:06 pm

Hi, the first thing I notice is that your XML is not valid.

You should have only one root element and you have three (Sword, armor, potion). It should look like:
Code: Select all
<items>
  <swords></swords>
  <potions></potions>
  <armor></armor>
</items>


Also these are valid ways of closing an element:
Code: Select all
<item />
<item></item>

but this isn't:
Code: Select all
<item/></item>
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,630

Post » Sat Jul 02, 2016 4:19 pm

oh, thanks, i didnt pay attention to it, thanks again.
B
8
S
3
G
1
Posts: 9
Reputation: 1,191


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 5 guests