Save only high score

Get help using Construct 2

Post » Thu Feb 06, 2014 2:23 pm

Hello,

I have a global variable which stores the highest score which the player has managed to achieve.

It saves fine but I only want to save the global variable and nothing else.

Is this possible?

Thanks.
B
4
S
1
Posts: 15
Reputation: 455

Post » Thu Feb 06, 2014 4:00 pm

Hey !

Yes, you can save the variable, and set what you don't want to save. You should take a look to this tutorial where Ashley explains how this works, step by step.
How to make savegames
B
17
S
8
G
4
Posts: 461
Reputation: 6,157

Post » Fri Feb 07, 2014 3:09 pm

Hi,

I had a look at that tutorial before but it doesn't go into how to save individual parts of the game.

From what I can see there is a 'no save' behaviour which you can only give to objects.

Giving an event an action of 'save' it just saves the whole game, you can't save an individual variable.

Thanks.
B
4
S
1
Posts: 15
Reputation: 455

Post » Fri Feb 07, 2014 3:17 pm

The default save system is like this : it saves everything except the nosave behavior objects. If you want to do another type of save, you have to do it manually. This means create a function that prepare your save and store it (in local storage). Then do another "load" function that loads the game from the local storage.

Local storage is a cache system letting you store datas through different sessions. It is a local system, meaning the same user going from a computer to another will lose its save. If you have a login system, you could also save it online.
B
17
S
8
G
4
Posts: 461
Reputation: 6,157

Post » Fri Feb 07, 2014 6:35 pm

B
48
S
16
G
9
Posts: 1,097
Reputation: 11,195

Post » Sun Feb 09, 2014 4:43 pm

Thanks guys I've got it sorted now. Instead of 'save' I used the object 'web storage' and got it working.
B
4
S
1
Posts: 15
Reputation: 455


Return to How do I....?

Who is online

Users browsing this forum: Lordshiva1948 and 47 guests