Xml Plugin - A bit desesperate...

Discussion and feedback on Construct 2

Post » Wed Sep 24, 2014 2:27 am

Hello,

I am posting this because i have a problem with the Xml plugin. Basically i have been able to load this xml (if you look at the picture the green rectangle get executed):

<?xml version="1.0" encoding="UTF-8"?>
<triggerdefinition name="Trigger Zone A" description="Trigger for the trigger zone A in the level testing_zone-1-1.">
<conditions>
<condition name="require_global_unset_flags" parameters="test" />
</conditions>
<actions>
<action name="set_global_flags" parameters="test" />
<action name="show_dialog" parameters="1" />
</actions>
<elseactions>
<elseaction name="set_global_flags" parameters="test2" />
</elseactions>
</triggerdefinition>


However, when i run the red rectangle part of code in the image it doesn'T work. I can't select the nodes... it should work since i am doing the exact same things than other places. Basically, its an XML objet that is part of a specific object TriggerZone. So when the TriggerZone get created it create an XmlObject which load the trigger data so i can parse it anytime.

Anything wrong or any ideas what would be the problem ?

Thanks!
You do not have the required permissions to view the files attached to this post.
B
16
S
5
G
1
Posts: 190
Reputation: 2,489

Post » Wed Sep 24, 2014 2:44 am

Found it... Xml encodage problem.. it should be an UTF-8 (without BOM) Dunno what this ? just UTF-8 doesn't work.
B
16
S
5
G
1
Posts: 190
Reputation: 2,489

Post » Wed Sep 24, 2014 4:29 pm

Oh, BOM is a small tag that gets added to UTF-8 files, marking them as UTF-8. It's invisible in normal text editors, you can only see it if you open the file with a hex editor.

Must have been quite hard to catch that problem!

To fix it, open the file in notepad++ and go to encoding -> encode in UTF-8 without BOM, then save the file.
B
36
S
8
G
8
Posts: 532
Reputation: 6,903

Post » Fri Sep 26, 2014 2:05 am

Yeah thanks for the tips! That what i did. But as you said it was quite hard to catch. The problem come from the fact that the XML was produced from a C# program i did. While saving i forgot to specify the right encoding. But Construct 2 won't tell you it couldn't parse it throught so we have to be careful!
B
16
S
5
G
1
Posts: 190
Reputation: 2,489


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 21 guests