Spawn object on start

0 favourites
  • 6 posts
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • Hello,

    I've got problem with spawning object on start of layout on option menu, that you can check there: 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:

    <img src="http://i.imgur.com/Xnm9Rcw.png" border="0" />

    <img src="http://i.imgur.com/hvuPgLv.png" border="0" />

  • 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.

  • 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.

  • 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

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • LittleStain

    Thanks! I haven't saw that there was "Pick by" event ;3

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)