Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Storing Variables Specific to a Player.
- FoxBunnySloth
-
Scratcher
5 posts
Storing Variables Specific to a Player.
I'm sure that many people have asked about this, but I wasn't sure how to word it in the search bar, sorry!
The game is supposed to keep track of personal wins for each player, I thought this would work through a cloud variable but I was wrong, or I programmed something incorrectly. The personal wins are important because they control how much money you have, which I also tried to store personally. I'm not sure if I need to use a normal variable or use a certain code? Thanks! Let me know if you need more info!
-FoxBunnySloth (and Otter)
The game is supposed to keep track of personal wins for each player, I thought this would work through a cloud variable but I was wrong, or I programmed something incorrectly. The personal wins are important because they control how much money you have, which I also tried to store personally. I'm not sure if I need to use a normal variable or use a certain code? Thanks! Let me know if you need more info!
-FoxBunnySloth (and Otter)
- awesome-llama
-
Scratcher
1000+ posts
Storing Variables Specific to a Player.
Cloud variables can work, but they can only store up to 128 characters. This means not all users can actually fit their data into it.
The alternative is to use save codes that the users keep for themselves, on their computer. For example, to save, the project outputs a code, and to load the save, it is typed/pasted into the input box. You could even encode the data into some long string (like a hash, if you know what that is) so that it would be harder to forge and cheat.
ninja
The alternative is to use save codes that the users keep for themselves, on their computer. For example, to save, the project outputs a code, and to load the save, it is typed/pasted into the input box. You could even encode the data into some long string (like a hash, if you know what that is) so that it would be harder to forge and cheat.
ninja
Last edited by awesome-llama (Nov. 28, 2018 02:00:30)
- drchubbington
-
Scratcher
100+ posts
Storing Variables Specific to a Player.
Use a cloud list to keep track of the name and the score of each player playing your game. Using one variable for all players' high scores won't work because it will change to the score of the last person to play the game.
- deck26
-
Scratcher
1000+ posts
Storing Variables Specific to a Player.
look at the wiki page on Global High Scores - there's not much difference between that and what you want. However the cloud variable limits do matter - you'll need something like 30 digits to encode the average usernams so a single cloud variable will only record data for about 4 people.
- Discussion Forums
- » Help with Scripts
-
» Storing Variables Specific to a Player.