Object not responding after creation.

Discussion and feedback on Construct 2

Post » Fri Nov 28, 2014 8:21 pm

I know there's an issue with objects not being recognised immediately after they've been created if on the same event-level (the bane of my C2 life), but this appears to be something else.

I need several listboxes. I'm creating 2 and giving them a variable 'Number' to identify them. I then try to identify each and add an item. The first isn't recognised and doesn't respond, but the second does. They're both one sub-level below the creation and on the same level. Is this a C2 thing that I don't know about, or am I doing something very silly? I've attached the code below, have stripped it of everything except the basics. Listbox0 here doesn't respond (if I put a sound in that section it doesn't trigger for example).
You do not have the required permissions to view the files attached to this post.
B
25
S
5
G
3
Posts: 446
Reputation: 5,633

Post » Fri Nov 28, 2014 11:32 pm

Have you tried a 'wait 0' after the Create object? Or maybe use an 'on created' event to do the init.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Sat Nov 29, 2014 1:05 am

That might work I guess, though looking at that code, it makes no sense. If one listbox works, the other should, or neither. In the end I ripped this part out and rewrote it differently, so I've got it to work another way now anyway.

Thanks.
B
25
S
5
G
3
Posts: 446
Reputation: 5,633

Post » Sat Nov 29, 2014 2:37 am

I think C2 will reference only the last List that was created - it has no way of referencing the first one. Try adding a pre-condition Pick All and then put the list box number checks as sub-events (the Pick All can still be a sub-event of the main one you have in your image).
A big fan of JavaScript.
B
74
S
20
G
71
Posts: 2,229
Reputation: 44,890

Post » Sat Nov 29, 2014 4:13 am

Ah yes, I wasn't aware of that. After creating 2, it'll only have one selected, so to speak? So a pickall should fix it... well I've changed it now, but good to know :)
B
25
S
5
G
3
Posts: 446
Reputation: 5,633


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 27 guests