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="https://dl.dropbox.com/u/7439411/errorImages/errXML123.jpg" border="0" />

    Example Data:

    <?xml version="1.0" encoding="UTF-8"?>
    <root>
       <TalkToImoen>
          <normal>
             <blocks>
                <element>
                   <portrait>Imoen</portrait>
                   <text>
                      <element>I'm so glad to be out of that place..</element>                             
                   </text>
                </element>
             </blocks>
          </normal>
       </TalkToImoen>
       <TalkToMinsc>
          <normal>
             <blocks>
                <element>
                   <portrait>Minsc</portrait>
                   <text>
                      <element>I'm Minsc.</element>
                      <element>I love my hamster, Boo!</element>
                          <element>I</element>
                          <element>can</element>
                          <element>talk</element>
                          <element>for</element>
                          <element>days! :D</element>
                   </text>
                </element>
             </blocks>
          </normal>
       </TalkToMinsc>
    </root>
    
    

    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
  • 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")
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • '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)