Object Indexing in Expressions Not Working

0 favourites
  • 3 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • Problem Description

    According to the manual, using an object's IID in parenthesis in an expression should specify that particular instance (i.e. Sprite(2).X to refer to the Sprite with IID 2), but these expressions seem to always be accessing the 0th index, regardless of the number specified.

    Attach a Capx

    https://www.dropbox.com/s/p6fevqb3h2jpz ... nsBug.capx

    Description of Capx

    This capx begins with one instance of Sprite at (400,400) and creates a second instance at (200,200), then it records each of their x positions using Sprite(0).X and Sprite(1).X into the two labels on screen.

    Steps to Reproduce Bug

    • Run the capx.

    Observed Result

    Both labels describe the Sprite's X value at 400.

    Expected Result

    The label for the first sprite should read 400, but the label for the second should read 200.

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (YES)
    • Internet Explorer: (YES)

    Operating System and Service Pack

    Windows 7 Service Pack 1

    Construct 2 Version ID

    Beta Release r167

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Closing as not a bug: newly created instances do not really exist until the end of the next top-level event (or trigger). Add 'wait 0 seconds' between the 'set text' actions and it works.

  • Oh, goodness, thank you! As much as I hate to post a bug in my own ignorance, I'm sure glad not to have to wait for the next update to use that function! Sorry about that.

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