0 Favourites

Help! Events not occurring in the order listed. [Fixed]

  • In this project, I would like to have a verbose loading message on the top opaque layer. Once all the events and actions are complete, I would like to make the top layer invisible, revealing a procedural generated map. The problem is, it seem that the arrays that are used somehow take precedence over everything else in the event sheet. The end result is a black screen that lasts for up to 4 seconds before the level pops into view (even longer in my main project, as there are more complex events happening in the array). Even though I have the groups disabled, and updated text being set between each activated group, none of that actually occurs, as if it were skipped. Here is a screenshot and capx file:

    [attachment=0:iqdan6ne][/attachment:iqdan6ne]

    [attachment=1:iqdan6ne][/attachment:iqdan6ne]

  • All of the "Trigger once" events are on the same level, and are effectively happening at the same time. Try putting it inside each of the groups with the "set text" in them

    So the first "Trigger once" will activate MapForegroundConfig, and INSIDE THAT GROUP, a Trigger Once will set the text.

  • All the generation logic is done in a single tick, and no display update is ever done, so the only text you'll see is the last one.

  • All the generation logic is done in a single tick, and no display update is ever done, so the only text you'll see is the last one.

    Would gating the groups with a local variable split them up? Something like:

    local var load = 0

    If Load = 0 then "set group x" activated and add +1 to Load

  • Welcome to asynchronous JavaScript. I had to learn this the hard way too.

    You can combat this using flags, like local or instance variables called: "isLoaded".

  • Would gating the groups with a local variable split them up? Something like:

    local var load = 0

    If Load = 0 then "set group x" activated and add +1 to Load

    I believe it would work yes, but you'll also need to add a long "else" chain so only one load step is ever done per tick, allowing the rendering engine to redraw the canvas at least once between load steps.

  • I interpreted some great advice and it looks like I got the loading screen set up. In doing so, my miner has gone wonky on me and doesn't behave as it did in the previous capx.

    To minimize the bloat on the screen, I turned some of the groups into basic functions. The problem seems to be with the loops for the Miner array and MapForeground array. In debug mode for instance, all of the Miner arrays should be destroyed, but somehow the repeat loop recreates them. Anyone have any thoughts? Also, the mined area compared to the original capx are vastly different. Here's the updated capx:

    [attachment=0:ffyuiexm][/attachment:ffyuiexm]

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • After a little bit more tweaking, I got the loading screen to work! To iron out the last few issues, I had to nest the miner events and use a trigger once for each of the function calls. I've attached the working capx for anyone interested in procedural generation in Construct 2.

    [attachment=0:13zud146][/attachment:13zud146]

    Thank you Magistross, 7Soul and Lolpaca for the help!

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