Load local XML file =(

0 favourites
  • 3 posts
From the Asset Store
Ludo Local Multiplayer board game can be played by 2 to 4 players
  • ok, I've gone over all the posts I can find on here, tried to do all the steps that are listed, and for the life of me, I can't get Construct to read the XML file I'm trying to use.

    I've drilled down to the simplest possible test I can do and I'm still missing something simple. My expectation is that I would see "found it" on the screen when it runs... but instead, the text still says "text" meaning no change.

    Can someone please school me on whatever I'm missing?

    I've imported grindmobs.xml to the project

    ------

    my capx is this simple:

    1. System (on start of layout) -> AJAX (request grindmobs.xml (tag "grindmobs")

    2. AJAX (on "grindmobs" completed) -> XML (Load XML document from string "AJAX.LastData")

    3. XML (For each node "bestiary") -> Text (Set text to "found it"

    ------

    And here is the XML file:

    <?xml version="1.0"?>

    <bestiary>

        

         <enemy>

              <name>Goblin</name>

              <hp>50</hp>

         </enemy>

         

         <enemy>

              <name>Big Goblin</name>

              <hp>75</hp>

         </enemy>

    </bestiary>

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • At this point I've tried multiple other XML files, including the one used in the example, where I learned how to make it work by pasting the XML in as a string.

    I've moved on to work on other things, but before I can finish this one, I'll have to solve the problem of reading this from files.

  • I finally figured it out - I was right, something simple. Notice that in my AJAX -> on "grindmobs" completed statement I had quotes around AJAX.LastData. Removing those quotes seems to have fixed my problem.

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