Checkpoints between layouts

Get help using Construct 2

Post » Mon Feb 24, 2014 4:53 pm

So I have checkpoints at different layouts/Different rooms.

How I am trying to make it work:
Have a checkpoint at the first layout which you can check. Die at the second layout and return to the checked checkpoint. I want to be able to set checkpoints between layouts and be able to go back and forth to check them and die at different spots. (You know like in Knytt Stories)

In the How do I FAQ there were some explanation for checkpoints within the same layout but not between different ones. I would like to figure out how to do so with the least hassle and most flexibility.

Thanks!
B
9
S
1
Posts: 16
Reputation: 563

Post » Mon Feb 24, 2014 5:12 pm

Create a sprite as your checkpoint. Store all the pertinent information on layout, etc... in instance variable. When the player reaches the checkpoint take the values from the checkpoint sprite and put them in global variables. Whenever a user dies have it use the information from the global variables (layout name, etc...) to start the player where you want them.
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,603

Post » Mon Feb 24, 2014 6:20 pm

Thanks for the reply, BluePhaze.

Oh my god... I just noticed:
There are "Save/Load game" actions.
They seem to work perfectly.
B
9
S
1
Posts: 16
Reputation: 563

Post » Mon Feb 24, 2014 8:55 pm

Just remember that the save and load is for the whole state of the game. You can get yourself into odd situations depending on where you save. For example if you give the player options for disabling and enabling music, etc... and you save those settings, then the next time they load they will be where they were when they saved that setting. I tend to put a on load goto layout on there, then I can always send them back to the level select screen, etc... when they load the game. In your case that may not be needed, just be careful where you are calling the save game action.

Also any info that happened since the last save will be lost when you load.
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,603

Post » Mon Feb 24, 2014 11:56 pm

BluePhaze,

An easy way to overcome 'odd situtations' when saving and loading is by using a sprite, set it to global and then use instance variables and also use the 'no save' behaviour. Then use the event 'on load complete' set instance variable x to global variable y.

If the user toggles the sound on and off, loading or saving will have no effect as the value is stored in the global sprite :).
B
16
S
4
Posts: 69
Reputation: 1,834

Post » Tue Feb 25, 2014 3:28 am

Or you can use web storage local values
B
13
S
4
G
1
Posts: 241
Reputation: 1,724

Post » Tue Feb 25, 2014 4:37 am

@federer365 when you load you lose all current values though. Items that have no save selected would revert to their default settings. Unless I am mistaken.
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,603


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests