Discuss Scratch

Blank_page_animator
Scratcher
31 posts

How do I assign save slots to usernames?

I know a lot of you looking at this are very talented, and I am to just not in the “Days Since, or Could data” way…

I want a user to join the game and then be immediately be auto assigned to a save lot connected to there username
so when they rejoin the project it will show the user's last activity, this may not be plausible though due to the Dumbness of scratches current way it stores data, So I am already getting a very awry feeling about what you guys are going to say about this.


SansStudios
Scratcher
1000+ posts

How do I assign save slots to usernames?

Yeah, unfortunately this is pretty hard due to scratch's cloud limitations, you are constrained to a limited number of numbers that can be stored in cloud data. If you have a small game that is meant for specific people to play, cloud saving is a possibility. More complex data to save leads to less “save slots”, and if you want to save an RPG gamestate, good luck with more than 2 players at most.

This isn't to say that saving data via the cloud is impossible. There is a work around to this, which is coding a websocket client that communicates with scratch, effectively bypassing the cloud limit. However, this is a grey area in scratch's TOS and also quite a feat to implement, especially without a background in web-request based coding.

If you have any more questions, please let me know

Last edited by SansStudios (Sept. 2, 2021 03:06:54)

awesome-llama-test
Scratcher
100+ posts

How do I assign save slots to usernames?

Before going all the way to cloud data, first figure out something simpler. Get the save slots to work with something else. A list would be what you need. Try and create a system that stores the saves in one list and is able to retreive each one as well.
Then this problem can be simplified even further. You know you need to save all the game data and I will assume you already know how to create “save codes” for the user to copy-paste. However, how do you determine which save code belongs to who? The easiest way is to just include the username along with the save. Either store the username as part of the save code (preferrably at the start of it), or make use of multiple list items where the username is stored in the first item, then the save, then the next username, then the next save, etc. Other formats are possible too but I won't bother trying to list each alternative way.
Blank_page_animator
Scratcher
31 posts

How do I assign save slots to usernames?

awesome-llama-test wrote:

Before going all the way to cloud data, first figure out something simpler. Get the save slots to work with something else. A list would be what you need. Try and create a system that stores the saves in one list and is able to retreive each one as well.
Then this problem can be simplified even further. You know you need to save all the game data and I will assume you already know how to create “save codes” for the user to copy-paste. However, how do you determine which save code belongs to who? The easiest way is to just include the username along with the save. Either store the username as part of the save code (preferrably at the start of it), or make use of multiple list items where the username is stored in the first item, then the save, then the next username, then the next save, etc. Other formats are possible too but I won't bother trying to list each alternative way.

How do I make randomly generating save slots though, Could you teach me?

Last edited by Blank_page_animator (Sept. 4, 2021 14:05:42)

LG125
Scratcher
500+ posts

How do I assign save slots to usernames?

Blank_page_animator wrote:

I know a lot of you looking at this are very talented, and I am to just not in the “Days Since, or Could data” way…

I want a user to join the game and then be immediately be auto assigned to a save lot connected to there username
so when they rejoin the project it will show the user's last activity, this may not be plausible though due to the Dumbness of scratches current way it stores data, So I am already getting a very awry feeling about what you guys are going to say about this.


I’m pretty sure that if you don’t use variables at all, everyone else has their own variables. What i mean is that if there is no “set score to 0” when green flag clicked, and you haven’t set your own score or modified the variable, if another person gets a different score, that same person will keep the score until modified.
Blank_page_animator
Scratcher
31 posts

How do I assign save slots to usernames?

It works but it is the same amount for everyone across all servers? I just want the user to keep their amount

Powered by DjangoBB