Spawn object on start

Get help using Construct 2

Post » Sun Oct 27, 2013 6:01 pm

Hello,

I've got problem with spawning object on start of layout on option menu, that you can check there: http://serwer1380436.home.pl/Tower%20Defence/

What I mean:
I can check checkbox true/false and save settings to global variables but when i go back to player menu and come back to settings checkbox aren't checked, or both of them are checked when one of them is checked.

What i've got wrong?

There are screen of events:


B
10
S
3
G
1
Posts: 14
Reputation: 1,220

Post » Sun Oct 27, 2013 6:37 pm

Leave that "else: destroy checkbox_true" away. Since you don't spawn one nor even pick one in the event, this will randomly destroy a instance of this. Meaning if you have one option enabled and the other disabled, you will see both as disabled.

If problems stay, try pick checkbox by UID instead of comparing values, maybe comparing works weird for picking instances out of the blue.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Sun Oct 27, 2013 6:58 pm

Did some testing on your system. If you select Share then both are selected when you come back in. If you do not select share then both are not selected when you come back in.

I think it is because you have been specific with your conditions, checkbox_false.UID = 51, but not your actions where you just spawn on checkbox_false. Rather include another condition to pick checkbox_false by UID, this will then only spawn or destroy on the picked checkbox.

Run it in debugger mode, I am guessing that they global variables are all operating fine, it has to do with putting the ticks in the right boxes at the startup.
B
13
S
4
Posts: 67
Reputation: 1,270

Post » Sun Oct 27, 2013 8:44 pm

@mindafaQ
I leave "else: destroy checkbox_true" away and still got problem. I think it's because it check checkbox_false.UID number end even if condition is right it spawning checkbox_true on all checkbox_false.

I don't know what condition I have to put to spawn checkbox_true on right checkbox_false.UID

@AngelEyes
Yes all global variables are operating fine. I got onlu problem on start of layout in settings page with spawning checkbox_true
B
10
S
3
G
1
Posts: 14
Reputation: 1,220

Post » Sun Oct 27, 2013 8:55 pm

You are not picking a checkbox in your event, you are only checking if a checkbox exists on your layout with that uid.

you should add a system pick checkbox to get the right one.

a system for each checkbox would also work, just put both uid compares as subevents.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Oct 27, 2013 9:12 pm

@LittleStain
Thanks! I haven't saw that there was "Pick by" event ;3
B
10
S
3
G
1
Posts: 14
Reputation: 1,220


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 5 guests