Reset Another Layout

Get help using Construct 2

Post » Wed Jun 06, 2012 8:41 am

Ok, I have 2 layouts, the game and the menu, and I would like one of the buttons on the menu to reset the games layout before switching to it, I need to reset everything except the players highscore, stored in a global variable. Is there any way to do this? Please help.
Thanks in advance.
B
5
Posts: 10
Reputation: 445

Post » Wed Jun 06, 2012 11:17 am

A layout will always be reset when you leave it.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,390

Post » Wed Jun 06, 2012 12:03 pm

So what you want to do is selectively reset the global variables? I'm doing that in a game by using System Set Value to manually reset the ones I want to reset, and not the ones I don't, as opposed to using the "reset global variables" function. That works fine. But I only have about 8 global variables to reset. If you have a large number of global variables to reset, and only a couple that you don't want to reset, you could use local variables to store the values you want to save, do the "reset global variables," then reset the ones you want to preserve from the local variables.jimand2012-06-06 12:14:17
B
16
S
4
G
1
Posts: 40
Reputation: 2,705

Post » Thu Jun 07, 2012 3:29 am

Ok, thanks it works! I set up when the play button is pressed it sets a global variable, then when the next layout starts and that variable is set, it resets the layout then resets all the global variable including the menus one.
B
5
Posts: 10
Reputation: 445

Post » Fri Oct 19, 2012 6:24 am

Hello,
I have many layouts of game levels. Then I need to pass a instance variables of player, who can take a gun and lose the gun, to another layout. How can I do this?
Thanks in advance.Suvd2012-10-19 06:31:15
B
11
S
3
G
4
Posts: 22
Reputation: 2,789

Post » Fri Feb 01, 2013 2:51 am

Hi!

Can you explain how did you managed to reset to a particular layout?

Thank you. :)
B
9
Posts: 44
Reputation: 570

Post » Tue Jun 11, 2013 8:50 am

Hi,

are there any working sample that demonstrate resetting a Layout being triggered by a button found on another layout ?   

say button in Layout 2 will reset Layout 1 ?

Thank you.

Vins
B
5
S
1
Posts: 20
Reputation: 545


Return to How do I....?

Who is online

Users browsing this forum: Draconinho, peturfoto and 13 guests