Restart Layout resets global variable and Webstorage

Get help using Construct 2

Post » Thu Mar 20, 2014 8:54 am

Hello,

I'm trying to get High score to work on my game but it keeps disappearing when I reset the layout.
I've tried setting 'global variables' and setting 'text to show the variable' after the 'reset layout' but it seems like the 'reset layout' function keeps resetting the global variable as well.
So I tried webstorage but I still am getting the same problem.

What I'm trying to do is having the Highscore save forever and update when I get a better highscore.

Can someone please help me?
FIXED!

Thanks!
Last edited by t33hp on Thu Mar 20, 2014 9:20 am, edited 1 time in total.
B
16
S
3
Posts: 115
Reputation: 2,428

Post » Thu Mar 20, 2014 9:15 am

Does it work now ? (It's really hard ! Can't get more than 2, so it was very difficult to verify ! :D)

Well you edited as fixed so I removed the file :)
Last edited by Joskin on Thu Mar 20, 2014 9:22 am, edited 1 time in total.
B
39
S
15
G
5
Posts: 295
Reputation: 6,089

Post » Thu Mar 20, 2014 9:22 am

Thanks :)
B
16
S
3
Posts: 115
Reputation: 2,428

Post » Thu Mar 27, 2014 12:14 am

so...why you guys deleted the capx :lol: hehe

i need to know what you did...i have a GLOBAL Variable "HIGHSCORE" and i want to use that VAR as a Savegame Score so after you restart the game, it shows the previous HighScore...but i dont know how to...
B
13
S
2
G
1
Posts: 28
Reputation: 960

Post » Thu Mar 27, 2014 8:32 am

@nanitoz Attach your capx, I'll have a look at your system. @t33hp removed is capx because it's his project, with arts and audio from his team :)
B
39
S
15
G
5
Posts: 295
Reputation: 6,089

Post » Thu Mar 27, 2014 12:46 pm

i got this
Image

at this moment im just testing it @ Chrome, but it will work on Android then?
B
13
S
2
G
1
Posts: 28
Reputation: 960

Post » Thu Mar 27, 2014 1:07 pm

Saving and loading in the same event ?
Si if Highscore is initiate at 0, you save it at 0 and load it at 0, it will always be at 0.

Save it at the end of the game, and load it at start of layout.

It will works on android :)
B
39
S
15
G
5
Posts: 295
Reputation: 6,089

Post » Thu Mar 27, 2014 1:25 pm

that was an example how Loading/Save works xD! just i put it together...hehe

ps... viewtopic.php?f=147&t=100499
B
13
S
2
G
1
Posts: 28
Reputation: 960


Return to How do I....?

Who is online

Users browsing this forum: lukewasthefish, marc254, Mayfly and 14 guests