[r111] Functions and Uids

0 favourites
  • 4 posts
From the Asset Store
UID TO ANYTHING
$18 USD
20% off
Act on your instances, get/set their properties and variables only thanks to their UID. No more picking trouble! Plugin
  • Hi

    I think I found a bug with functions and uid from created objets. I'm on r111.

    Steps :

    • I create an object with System.createObject
    • I put the UId of this object in a paramater and I call the function
    • Pick the object with UID = param(0) doesn't work !

    I tried with a "repeat for each" and "object.uid = param(0)" and it's also KO.

    I don't understand why, so I think it's a bug... Maybe I missed something ?

    Here's the capx with a very simple example :

    dl.dropbox.com/u/15473488/bug_function_uid.capx

  • What is happening is that you are calling a pick on the object before C2 has hit a top level event. Where as before R110 the function would have run inside the scope of the object creation and been considered a sub-event, a bug fix (as I just found out myself) in R110 means the functions need to repick the object they are working with.

    <img src="http://dl.dropbox.com/u/5426011/fixed/Creation_picking.GIF" border="0">

    (from a post by r0j0hound)

    Where as previously this would have been running like another action in line 2, it's now more or less running as a new event like it was on line 5.

    To get around this you have to hit a top level event first. In this case you do something like:

    <img src="http://i.imgur.com/39I50.png" border="0">

  • In this way, it works. But it's not a "normal" behavior I guess.

    In my project, it's not a easy case like the example I posted here !

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This is currently by design due to the way objects are created. I know it's a little unintuitive, but it really has to be that objects only really exist at the next top level event, otherwise some projects with certain events can end up crashing. Closing as won't fix.

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