How do I implement multiple chunks of dialogue with xml.

Get help using Construct 2

Post » Fri Dec 18, 2015 9:28 pm

I have recently been trying to understand how to use xml to create dialogue systems.

Ive tested some example .capx files and I thought I understood. I then tried to implement it so it could choose from multiple sets of dialogue. To do this, I followed the same template in the xml as the first one, then changed the tag. However, as soon as I change it and try to load the second set of dialogue, it doesn't work.

I switched around the order in the xml file and then the second one (now first) worked but the original didnt.

What am I doing wrong? Thanks in advanced. (Nothing too complex please, im a total noob ;) )
B
10
S
2
Posts: 12
Reputation: 622

Post » Mon Dec 21, 2015 10:47 am

Assuming all the texts are in a single XML I will do something like this...

Code: Select all
<dialogues>
<conversation id="1">
This is the first text   
</conversation>
<conversation id="2">
This is the second text   
</conversation>
</dialogues>


You start with a ForEach node loop /dialogues/conversation

Then inside the loop you can look for the id, XML.StringValue(@id)="1" and retrieve the conversation text with XML.StringValue("conversation/text()")
B
6
S
2
Posts: 15
Reputation: 589


Return to How do I....?

Who is online

Users browsing this forum: plinkie, rayolf and 6 guests