Picking created objects

Get help using Construct 2

Post » Sat Mar 09, 2013 5:59 am

Do you mean 'Trigger once while true'? You may as well leave it as 'On start of layout'. Seems clearer.
ImageImageImage
B
67
S
19
G
122
Posts: 3,207
Reputation: 73,401

Post » Sat Mar 09, 2013 6:19 am

Followup - Here is how I ended up deciding to do it, I felt it was the clearest way and doesn't break the logical flow of the code like having another "on layout start" would.



On created might work well for other purposes, but did not for me in this case because the "Volume" instance variable I was checking against has not been set yet upon creation.

I might have two on layout start groups like I mentioned earlier, if the project had a greater amount of situations similar to this. First one to create all the objects, second one to modify them.

I did notice another oddity though, the on created events ran even when I had them after the creation event on the sheet. Guess they retroactively apply to everything was created during the tick!
Mistakes were made.
B
37
S
17
G
67
Posts: 1,041
Reputation: 38,211

Post » Sat Mar 09, 2013 6:28 am

I understand why you think several 'on start of layout' events seems messy, but in the end I had several anyway, just to split up the amount of stuff I need to do at start-up.

This situation with needing to set variables for objects on a new top-level event has caused me lots of headaches, but there's always a solution.
B
25
S
5
G
3
Posts: 446
Reputation: 5,633

Previous

Return to How do I....?

Who is online

Users browsing this forum: luckyrawatlucky, mindragon73 and 26 guests