How do I use xml to make a twine-like game? Could someone make me an example?

0 favourites
  • 4 posts
From the Asset Store
Unlock platyers earning coins, and save it with Localstorage
  • I still use construct 2 and I'm having a hard time learning how to use xml.

    I'm trying to learn how to make a twine-like, visual novel/dialogue and wanted to be able to change the game language, then I found out that xml would be the way.

    But I still can't understand how to use it. I watched some tutorials, but none of them is specifically for what I want, and they give me just too much loose information that makes me overwhelmed. I don't understand what do I do after,"load XML from AJAX.lastdata" How do I set a text object to a specific text on the xml file?

    I asked ChatGpt to make me a simple story in xml for maybe you guys make some capx template on how I could do this, he made me this:

    <?xml version="1.0" encoding="UTF-8"?> <game> <scene id="intro"> <text>Welcome to our story! What would you like to do?</text> <options> <option text="Explore the forest" target="forest" /> <option text="Visit the village" target="village" /> </options> </scene> <scene id="forest"> <text>You venture into the dense forest. It's quiet... too quiet. Suddenly, you hear a rustling in the bushes.</text> <options> <option text="Investigate the noise" target="wolf_encounter" /> <option text="Run back to safety" target="intro" /> </options> </scene> <scene id="village"> <text>The village is bustling with activity. You see a market and a tavern.</text> <options> <option text="Visit the market" target="market" /> <option text="Enter the tavern" target="tavern" /> </options> </scene>

    I don't understand completely for what is the "scene id" , but I have some idea. I just don't know how to apply it in the game. Should I make it a variable? or what?

    I have so many doubts.

  • The xml text was much more organized when I sent it. I could try to write again if you guys need it. but is basicly the image below:

  • Check out this post, there are working download links in comments:

    construct.net/en/forum/construct-2/how-do-i-18/zelda-dialogue-system-capx-117812

    I suggest using JSON though, it's easier to learn and understand. There are several JSON addons for Construct 2.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thank you so much! is just what I needed.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)