I'm going bald because of this Global Variable

This forum is currently in read-only mode.
From the Asset Store
Globals 2.0
$3.99 USD
Globals 2.0 stores and group variables. You can also load and save data (variables) from/to JSON files.
  • I have 4 layouts, and a global variable named exactly "Layout Jump". The layouts are:



    *Power down


    When the "Power down" layout goes to the "Ending" layout, the global variable begins here and sets itself to '2' at Start of "Ending" layout. After the "Ending" layout finishes, the game restarts to the "Beginning" layout.

    Now, I'm trying to do two things:

    1. Make the "Power down" layout recognize that the Global variable value (using "Set Value") is '2' and then go back to the "Beginning" layout. My GV code in the "Power down" layout is:

    Is global variable 'Layout Jump' equal to 2 -----> Go to Layout "Beginning"

    ... but it's ignoring this command.

    2. Make the "Beginning" layout recognize that the Global variable value is '2' also, thus causing the program to skip the "Middle" layout and go straight to the "Power down" layout.

    In a nuthsell, I only want the "Middle" and "Ending" layouts to play once and then never play again.

    I've got several Global variables working perfectly right now, but this one has me pulling my hair out... please help me before I go completely bald!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok, here are a few things to try.

    Use debug all and watch the global variable to make sure it is being set when you want it to, and that it is holding over on the restart.

    Set up an event isolated from the global variable to test that your level changing events are working.

    On keyhit 1 - go to layout 'etc'.

  • Thanks, Steven.

    No dice though. Another Global variable that was running perfectly until I duplicated a layout is now broken also. It works fine in all the original layouts, but in the duplicated layouts it's dead and that's with every single part of the code and all objects copied and made global from the original layouts, too. Very, very strange.

    Maybe it's all just .62 issues? My next project will be in the latest version of Construct, so hopefully if it's a bug it was solved some time ago.

  • Is there any chance of having a look at a cap to try and help solve this one MrMiller?

  • Hey Steven,

    I actually just bypassed the original issue by sticking with layout duplications. Not perfect, but presentable.

  • This sort of thing seems to crop up a lot when you duplicate layouts. I'm going to hazard a guess that there's an obscure bug there.

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