Saving High Score Problem

Genadiy

  • Posts: 12
I will keep this short and simple I have a timer that goes up every second and when my character dies I want to save the high score to the next scene. I wrote a code to do that but its not saving! hears my code what could be wrong?

Photon

  • Posts: 2691
You have to save High Score to a game attribute for it to persist between scenes. Right now in the load, you are just setting high score to itself. Check this out:

http://www.stencyl.com/help/view/saving-and-loading-games/
http://www.stencyl.com/help/viewArticle/158/
Do NOT PM me your questions, because I likely will not respond. If I have replied to your question on the forum, keep using that topic. Thanks!

Genadiy

  • Posts: 12
Hmm I forgot about making a game attribute, I remember making a code similar to this one for 2.0 and it worked fine, after upgrading to 3.0 I can't seem to figure it out, so I did what you had told me and I'm still having the same problem, hears what I got

Photon

  • Posts: 2691
What does happen then?
Do NOT PM me your questions, because I likely will not respond. If I have replied to your question on the forum, keep using that topic. Thanks!

Genadiy

  • Posts: 12
The time isn't saving as a high score , it just stays 0. Let me clear things up so basically the time saves as a high score but if the time gets above the original time I want the new time to save as the new high score

Photon

  • Posts: 2691
Look at your "Do Every." Your increment block says to increment "number," not your timer attribute.
Do NOT PM me your questions, because I likely will not respond. If I have replied to your question on the forum, keep using that topic. Thanks!

Genadiy

  • Posts: 12
Okay I changed it to timer but I can't place a timer block in place, I'm still having the same problem

Photon

  • Posts: 2691
Okay I changed it to timer but I can't place a timer block in place
What do you mean? You can't put the timer attribute getter into the increment block? You should be able to select it from the increment block's dropdown instead of moving another block into it.

Also, shouldn't you now also be comparing timer against the game attribute for saving a new high score?
Do NOT PM me your questions, because I likely will not respond. If I have replied to your question on the forum, keep using that topic. Thanks!

Genadiy

  • Posts: 12
Yes I did selected the timer in the drop down list and what do you mean by "comparing timer against the game attribute"?