How do you reset the layout?

This forum is currently in read-only mode.
  • Hey there,

    For an experiment, I'm trying to make a Mario game. However, when I got to the dying mechanism, I tried to make the layout restart/reset. Apparently that isn't possible, so I decided to create a different layout it would jump to, after which it would jump to the next layout.

    However, the layout is not reset. Isn't there any way to reset the layout? So strange.

  • Create System > Go to layout action and type LayoutNumber as a parameter for a layout number to go to. This should restart the current layout.

    Yes, "restart layout" action would be great. How come it's not implemented yet?

  • Create System > Go to layout action and type LayoutNumber as a parameter for a layout number to go to. This should restart the current layout.

    Yes, "restart layout" action would be great. How come it's not implemented yet?

    Not sure. Seems like a really obvious feature to me ;o

    I actually tried that, but that didn't completely reset the layout

    For example, it left the scrolling untouched instead of it resetting to the upperleft part of the layout.

    Also, it didn't reset the included event sheets. For example, when the character dies, I disable the control event group. When I "reset" (read: go to) this layout again, the platform behaviour does work, but the tweaked control events I made don't because the event group is still disabled. Even though I set it to be enabled on the start of the layout (or rather, I set it to not be disabled).

    Very strange.

    EDIT: Of course these things are easily fixed by making some events that enable the groups and scroll to the right position, but that's not the point.

  • It's because everything is "global" in Construct. I think the thing to do is just have a Start of Layout where you set everything the way you want it for now. Maybe you used MMF before, which doesn't remember things as often. The Event Sheets act independently of the layouts, I'm pretty sure.

    A nice feature would be "reset values" for sprites, at least, so you could group together a bunch of sprites in a family and then "Start of Layout --> Reset Values" and it would set all the values to their initial ones.

  • It's because everything is "global" in Construct. I think the thing to do is just have a Start of Layout where you set everything the way you want it for now. Maybe you used MMF before, which doesn't remember things as often. The Event Sheets act independently of the layouts, I'm pretty sure.

    A nice feature would be "reset values" for sprites, at least, so you could group together a bunch of sprites in a family and then "Start of Layout --> Reset Values" and it would set all the values to their initial ones.

    Exactly. It'd be cool if we'd have a nice little spreadsheet for all our global and private variables and being able to group variables together, so we could just "Start of Layout --> Reset 'Extra Attrs' Group'

    So, say, all the buffs and stuff would be gone if you'd start on a new layout without having to manually set everything back to a certain value.

  • you can just destroy the character and make a new instance of the character object and all the variables will be at their default values.

    to reset global variables you can load all the values into a hash table using a loop and when you reset just load in the hash table values back into the global variables.

    Though it would be nice to have an action to reset global variables.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I just saved the layout at start of frame (after some generic set-up stuff), then reload the frame. This seems to function perfectly as a reset.

  • Not just values, but event group status as well. I guess the whole global thing is quite interesting, but it requires a different way of thinking the events out. Unlike in MMF

    I just thought that, since the player event sheet is included in the layout, it would include it with the way I set it up in the event editor. And I thought, in combination with going to a layout it would basically reset everything, because everything would be included again.

    It's rather confusing though. I'm used to everything restarting like in MMF. From a different perspective it makes sense to me though. It reminds me of the time when I was experimenting with game development with C++, having to set the variables and all myself, of course programming a reset function for that.

    I was actually thinking of that save/load function yesterday. Might try that out, it should work fine, I think

  • would you mind doing a step by step on how you did the reset using "save"?

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