[r111] Functions and Uids

Bugs will be moved here once resolved.

Post » Sat Dec 01, 2012 8:17 pm

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 :
http://dl.dropbox.com/u/15473488/bug_function_uid.capxSylvain2012-12-01 22:50:24
B
40
S
9
G
5
Posts: 127
Reputation: 6,609

Post » Sun Dec 02, 2012 6:40 am

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.


(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:


boolean2012-12-02 06:47:43
B
24
S
4
G
1
Posts: 244
Reputation: 3,462

Post » Sun Dec 02, 2012 9:28 am

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 !
B
40
S
9
G
5
Posts: 127
Reputation: 6,609

Post » Mon Dec 03, 2012 6:09 pm

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.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 0 guests