is Restarting a Layout same as Go To Layout?

0 favourites
  • 4 posts
From the Asset Store
Go kart
$7 USD
*************** Go kart game sprite ****************
  • Hi I'm wondering if the System Action "Restart Layout" is any different from using the System Action "Go to Layout" of the same one you are currently running?

    I have a turn-based game where I send the player to a gameplay action layout.

    But sometimes there are two turns that need to happen so I occasionally have to run the gameplay action layout 2 times (with different data).

    After my first run of the gameplay action layout, it needs to happen again but load different data in the On Start of Layout.

    At the End of Layout (on the first run) I just flip a boolean that says I've already run this layout once. Then I check it in On Start of Layout.

    Is this the best approach? And does Restart Layout work the same way as Goto Layout?

  • Go to same layout and Restart Layout should work the same indeed and execute "On start of layout".

    Checking in "On start of layout" for the value of a boolean and loading different data as a result sounds like a good way to handle two "loadings" of the same layout depending on some context.

    Make sure to use two sub-events to your "On start of layout" event. One checking if your boolean is true or false (accordingly to your setup), the other one being a "Else" special system condition.

    You also have to pay attention on your "restart", if some global variables value need to be reset or not, you might want to do this manually before the restart.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • "Restart layout" is the same as "Go to current layout", but it also resets all groups to their initial activation state.

  • but it also resets all groups to their initial activation state.

    aha! this is super helpful. Thanks!

    also thanks Kyatric!

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