Need help with HighScore

Discussion and feedback on Construct 2

Post » Sat Apr 12, 2014 8:27 am

Why it become NaN ?
What is NaN ?
You do not have the required permissions to view the files attached to this post.
~Everyone can make GAMEs~
B
56
S
12
G
1
Posts: 414
Reputation: 5,911

Post » Sat Apr 12, 2014 8:34 am

NaN is "Not a Number"

I've help you lots so I think some tough love - Seriously its called search and find.
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,718

Post » Sat Apr 12, 2014 10:21 am

@Dutoit so? how to make it be a number? i've follow every highscore tutorial.
~Everyone can make GAMEs~
B
56
S
12
G
1
Posts: 414
Reputation: 5,911

Post » Sat Apr 12, 2014 10:28 am

Hardty wrote:@Dutoit so? how to make it be a number? i've follow every highscore tutorial.


You've made a mistake. It is not storing any info. Or it is storing as text. Either way, you aren't storing it correctly or calculating it correctly. Redo the tutorials, check your process.
You ask a lot of help, you ask a lot of capx (please make me a capx to do this), but you still can't master the basics. You are a copy paste programmer, and will never learn until you actually start programming.

Time to start learning. You made a mistake in your how you store the highstore, or calculate it, or retrieve it.

Easter is here. Go find the easter egg ;)
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,718

Post » Sat Apr 12, 2014 10:38 am

DUTOIT wrote:
Hardty wrote:@Dutoit so? how to make it be a number? i've follow every highscore tutorial.


You've made a mistake. It is not storing any info. Or it is storing as text. Either way, you aren't storing it correctly or calculating it correctly. Redo the tutorials, check your process.
You ask a lot of help, you ask a lot of capx (please make me a capx to do this), but you still can't master the basics. You are a copy paste programmer, and will never learn until you actually start programming.

Time to start learning. You made a mistake in your how you store the highstore, or calculate it, or retrieve it.

Easter is here. Go find the easter egg ;)

owhh.. i have search it correctly,but nothing finded the error,i will search it again later.

lol :lol:
~Everyone can make GAMEs~
B
56
S
12
G
1
Posts: 414
Reputation: 5,911

Post » Sat Apr 12, 2014 10:51 am

What tutorial you using?
Check the process of storing the highscore. I suspect you will find the problem there.
Also run it in debug mode and see what is being stored or isn't being stored
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,718

Post » Sat Apr 12, 2014 10:58 am

@DUTOIT

You can tell your a father as you have the patience of a saint !
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
86
Posts: 5,418
Reputation: 59,522

Post » Sat Apr 12, 2014 11:04 am

DUTOIT wrote:What tutorial you using?
Check the process of storing the highscore. I suspect you will find the problem there.
Also run it in debug mode and see what is being stored or isn't being stored

i use Construct 2 video tutorial,and by the way,that's all same with the tutorial.

and now i have tested it again,i want ask something,Web Storage save all of highscore right?
and the local key values must different with first time local key?
ex :
First time : HighScore
Second time : HighScore2 => is this problem?
~Everyone can make GAMEs~
B
56
S
12
G
1
Posts: 414
Reputation: 5,911

Post » Sat Apr 12, 2014 2:26 pm

zenox98 wrote:@DUTOIT

You can tell your a father as you have the patience of a saint !


:lol: He shall now be bestowed the name Saint Dutoit!

Hardty, I am still a beginner, but I went through what you are facing not too long ago, so I will give you a clue. Dutoit mention that it is either an error in how you store, calculate or retrieve the data, I can't say for sure without seeing it, but I would take a good look at how you store it. It might have just missed your eye, so look at it a bit more.

Hehe I won't give you a straight answer and go against Saint Dutoit who has helped me soo much :P
B
46
S
23
G
31
Posts: 693
Reputation: 20,637

Post » Sun Apr 13, 2014 8:34 am

@zenox98, @rekjl,

:oops: Lol, thanks guys.


@Hardty,

Webstorage only saves players score, and cannot be accessed by other players. Webstorage is not what you think it is. It is saving to players computer only.

If you want global webstorage, you need an external database, which is going to be far beyond your current skill level. There are tuts on it using mysql (I think) but that is pretty advanced an requires actual programming knowledge.

I don't understand your highscore1 and highscore2,
But highscore is highscore and should be over written with new highscore.
Highscore = 5000
PlayerScore >= Highscore then Set Highscore = PlayerScore else Leave Highscore = Highscore.

But like i said, global highscore cannot be stored using anything in construct, you need to use external storage options.

Edit:
Global Highscore is players wanting to beat the best score of the game.
or
Player wanting to beat his current best score? which you don't need an external database. Because if you just want player competing against his best score then, webstorage will work.

Edit 2: Added 2 files. One is highscore example. As you can see it stores highscores, but the high scores are not persistent, when you exit game, you loose highscores.
You need to save them to webstorage to make them persistent.
So attachment to is something I did for someone else, it is saving gold coins to webstorage.

Your homework assignment is to make the highscores save to webstorage. Oh, I will not be checking your homework, because in life, you have to be your own teacher and student.

Saving to external database is too advanced for you, so I am not even going into that.
You do not have the required permissions to view the files attached to this post.
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,718

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 28 guests