Not working; bug: XML.NodeCount

0 favourites
  • 3 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • I would like to count the number of text elements using XML.NodeCount but nothing I try is working. The action slightly below it saying Set LastParam3 to "I got here" never fires.

    EDIT: I changed the loop to start at 0 and changed loopindex to loopindex + 1 and that at least fires "I got here".

    See highlighted action:

    <img src="" border="0" />

    Example Data:

    <?xml version="1.0" encoding="UTF-8"?>
                      <element>I'm so glad to be out of that place..</element>                             
                      <element>I'm Minsc.</element>
                      <element>I love my hamster, Boo!</element>
                          <element>days! :D</element>

    What I've tried:

    1. Wrapping the expression with int( )
    2. Adding 0 to the end of the expression
    3. Ensuring ".../element[1]" instead of beginning with element 0 in XPath strings
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You seem to be missing a "/" in your highlighted action.

    Set linesOfText to XML.NodeCount("//" & NPCs.dialogueTag & "[b][u]/[/u][/b]normal/blocks/element[" & NPCs.dialogueBlockCurIndex & "]/text")
  • 'doh, thanks. Will try it later. Also noticed that I need to manage the size of the array..

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