Webstorage HighScore

Get help using Construct 2

Post » Sat Dec 14, 2013 9:20 pm

http://www.dwbailey.com/images/webstorage.capx

I am trying to do a highscore save for my level for the Acorns that are picked up...for some odd reason I cannot get it to work

lines 4,5,83

variable AcornReturned
variable AcornHighScoreLvl01

I am trying to have it when the game starts the webstorage looks at the saved value and sets the value to that.

and when the players health is 0, if acorn score is higher than what is stored, replace it...


You got to play Lvl one, the game will start out in the menue, then a tutorial level....then select level
B
9
S
2
Posts: 272
Reputation: 1,632

Post » Sat Dec 14, 2013 10:16 pm

You save the string "AcornReturned" instead of the contents of your variable AcornReturned. Leave the "" away.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Sat Dec 14, 2013 10:27 pm

maybe I did not do it right. in level 1, i collected some nuts...then i forced myself to die...and the highscore still reset to 0....

did it work for you?
B
9
S
2
Posts: 272
Reputation: 1,632

Post » Sat Dec 14, 2013 10:35 pm

its like I have something still reseting something....I do have the a layout restart when I die...and when I die is when I am trying to save my highscore..also on upon the start up of layout I have the Acornreturned =0.....
B
9
S
2
Posts: 272
Reputation: 1,632

Post » Sat Dec 14, 2013 10:40 pm

well something is working...i returned a nut and died...came back and returned another nut....and it added what i collected previously
B
9
S
2
Posts: 272
Reputation: 1,632

Post » Sun Dec 15, 2013 7:10 pm

well i found out that my AcornHighScorelvl01 var for the webstorage is not actually being changed even though my set text for it says it is....

so its not being saved....
B
9
S
2
Posts: 272
Reputation: 1,632

Post » Sun Dec 15, 2013 7:12 pm

www.dwbailey.com/images/Webstorage01.capx



B
9
S
2
Posts: 272
Reputation: 1,632

Post » Sun Dec 15, 2013 8:08 pm

finally got it....it had to do with placement of my webstorage code on line 83.....had to move it out of the when health=0.....to when the player returned the nut to the tree...store webstorage value...

anyway good stuff.
B
9
S
2
Posts: 272
Reputation: 1,632


Return to How do I....?

Who is online

Users browsing this forum: jorgmaquoi, senecaa and 18 guests