Discuss Scratch

TheGreenestSlimey
Scratcher
6 posts

Why isn't my global highscore system working

I think I have a problem with the global high score system I made using cloud variables. When I looked into the cloud data, the high score was most recently changed to 136. But when I looked into the project, it displayed 112. I ended up changing it manually. Here's the system I used:
when green flag clicked
forever
if <<(points) > (☁ Highscore)> and <not <(username) = [TheGreenestSlimey]>>> then
set [☁ Highscore v] to (points)
end
end
Am I doing anything wrong? Do I not know something? I'm really confused.
Here's the game link if necessary

Last edited by TheGreenestSlimey (March 23, 2024 13:46:05)

deck26
Scratcher
1000+ posts

Why isn't my global highscore system working

The cloud variable within the project is not necessarily the cloud variable in the cloud - I know that sounds confusing but the stored value in the project is used by people who are not logged in or do not have Scratcher status and is treated as a normal variable. Not sure, but suspect the way it works is only when the project is run from the project page does it actually try to access the actual cloud value.

The cloud data log is the best way of checking what is happening.
TheGreenestSlimey
Scratcher
6 posts

Why isn't my global highscore system working

deck26 wrote:

The cloud variable within the project is not necessarily the cloud variable in the cloud - I know that sounds confusing but the stored value in the project is used by people who are not logged in or do not have Scratcher status and is treated as a normal variable. Not sure, but suspect the way it works is only when the project is run from the project page does it actually try to access the actual cloud value.

The cloud data log is the best way of checking what is happening.

I still don't get it. As a kid, I'm not much of a tech expert. The thing is, I did check the cloud data log and it said that @hamfam5000 (Who isn't a new scratcher) turned the high score into 136. In contrast, when I clicked the See Inside button and checked the variable, it said that it was 112, and the built-in high score displayer also showed 112.
Malicondi
Scratcher
1000+ posts

Why isn't my global highscore system working

TheGreenestSlimey wrote:

I think I have a problem with the global high score system I made using cloud variables. When I looked into the cloud data, the high score was most recently changed to 136. But when I looked into the project, it displayed 112. I ended up changing it manually. Here's the system I
I would recommend adding in a “wait (0.1) secs” block in the set cloud variables, to avoid that from being the problem, but try renaming your variable and then saving the project and see if that fixes the problem.

post #1000 post #100 i help in the forums post #1 post #500 0 second ninja
I recommend reading jvvg's essay about the scratch team before complaining, as it may change your opinion and provide insight on the topic.

coming soon :)


deck26
Scratcher
1000+ posts

Why isn't my global highscore system working

TheGreenestSlimey wrote:

deck26 wrote:

The cloud variable within the project is not necessarily the cloud variable in the cloud - I know that sounds confusing but the stored value in the project is used by people who are not logged in or do not have Scratcher status and is treated as a normal variable. Not sure, but suspect the way it works is only when the project is run from the project page does it actually try to access the actual cloud value.

The cloud data log is the best way of checking what is happening.

I still don't get it. As a kid, I'm not much of a tech expert. The thing is, I did check the cloud data log and it said that @hamfam5000 (Who isn't a new scratcher) turned the high score into 136. In contrast, when I clicked the See Inside button and checked the variable, it said that it was 112, and the built-in high score displayer also showed 112.
But looking inside to check the variable is where you're going wrong. You're looking at the wrong version of the variable then. Perthaps set up a simple script to show the high score when you press a certain key but run it from the project page, NOT in the editor.

Powered by DjangoBB