How do I push a dynamically created objects UID into array?

Get help using Construct 2

Post » Tue Jan 13, 2015 7:38 am

If I add System>Create Object into my Layout Start event, then add On Created for that object pushing the ObjectName.UID to the array, it doesn't appear to work. I know all the objects get created, but I don't think Create Object calls On Created for the object it creates. Is there a better way to achieve that?

Thanks folks!
B
6
S
1
Posts: 17
Reputation: 436

Post » Tue Jan 13, 2015 8:43 am

If I am not mistaken, when you create an object with System>Create Object, the picking for the current event/action block is set to the newly created object. Therefore you should be able to do whatever you want with the new object right after it's been created, in the same block.

Though it doesn't really solve your problem :-?
Image
Game Producer & Independent Developer - http://raphaelgervaise.com
B
24
S
9
Posts: 237
Reputation: 2,232

Post » Tue Jan 13, 2015 1:50 pm

With Push and by Index (remove Set size (0,1,1) for the index option).
You do not have the required permissions to view the files attached to this post.
ImageImageImage
B
71
S
22
G
249
Posts: 3,763
Reputation: 138,577

Post » Wed Jan 14, 2015 3:56 am

Thanks, guys! Turns out that my ArrayName.Count just wasn't producing the right number since it was in the Start Layout event along with the creation of all the elements that went into the array. All sorted now and all elements do show up.

Very respectfully,
Tyler
B
6
S
1
Posts: 17
Reputation: 436


Return to How do I....?

Who is online

Users browsing this forum: worm1, Yahoo [Bot] and 21 guests