Pausing the Layout!

Get help using Construct 2

Post » Mon Dec 09, 2013 10:25 am

Is there any possible way to pause the whole layout and get back to it?!

Let me make myself clear here;
I've got a Time Global Variable in Layout 01 (The Game Level) and when I'm switching to Layout 02 (Main Menu) and then I'm trying to get back to layout 01 it's restarting the time variable and I want it to do a resume after pausing!

Thank you.
B
13
S
4
G
4
Posts: 42
Reputation: 3,962

Post » Mon Dec 09, 2013 11:00 am

Construct2 when going to a layout will always start it like it's never been played unless you tell it otherwise.

For some games it will be enough to have changed global variables for it to resume where left of, but for more complicated games the state of the layout should be saved and retrieved on resume.

If your only issue is the time variable, probably you have an event on start of layout that changes it, so you should add a condition to the on start of layout to not reset it if coming back from the main menu.
You could do this by adding a global variable called resume and set it to 1 when going to the main menu and on start of layout check if it's set to 1, or just check if the global variable time has changed and if so don't reset it.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Dec 09, 2013 2:11 pm

@LittleStain Thanks for your feedback,I tried every possible way with the Time Scale to pause and resume the layout but nothing! Anyway I'll give your method a shot.
B
13
S
4
G
4
Posts: 42
Reputation: 3,962

Post » Mon Dec 09, 2013 3:14 pm

Are you sure you didn't use the Event "Reset Global Variables" somewhere?

Because Global variables should keep their values even on a layout change...
B
33
S
6
G
7
Posts: 339
Reputation: 7,426

Post » Mon Dec 09, 2013 3:44 pm

@lze yes sure even I don't have "Reset Global Variables" event in the whole layout!
B
13
S
4
G
4
Posts: 42
Reputation: 3,962


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 14 guests