Discuss Scratch

kammmuschel
Scratcher
32 posts

Importing projects with cloud variables

Hi,

I have a project Archie's World (https://scratch.mit.edu/projects/1291313446/) and I have another one Archie DEVELOP (not shared) which I use while developing. When I want to release a new version, I export “Archie DEVELOP” and I import it to “Archie's World”. The project is using cloud variables to save the progress of the player.

Now when I import it seems the values of my cloud variables are overwritten by the values of the imported project. I do not see a change in the cloud monitor, but the value of the variable seems changed. That is an issue. Workaround could be to copy the value of the cloud variables to a text editor, import the project and update the variables with the original values.

Is that an error of the cloud variable logic or is that how it should be?

Best regards,
Daniel

Last edited by kammmuschel (July 9, 2026 08:53:14)

applezzs
Scratcher
3 posts

Importing projects with cloud variables

hello
colinmacc
Scratcher
1000+ posts

Importing projects with cloud variables

kammmuschel wrote:

Hi,

I have a project Archie's World (https://scratch.mit.edu/projects/1291313446/) and I have another one Archie DEVELOP (not shared) which I use while developing. When I want to release a new version, I export “Archie DEVELOP” and I import it to “Archie's World”. The project is using cloud variables to save the progress of the player.

Now when I import it seems the values of my cloud variables are overwritten by the values of the imported project. I do not see a change in the cloud monitor, but the value of the variable seems changed. That is an issue. Workaround could be to copy the value of the cloud variables to a text editor, import the project and update the variables with the original values.

Is that an error of the cloud variable logic or is that how it should be?

Best regards,
Daniel

No that isn't usually a problem, but I'm not sure you're using cloud variables properly here.

The values in the cloud are shared FOR ALL users of the project - it doesn't store a copy of the cloud variables for each user. So, although I haven't looked at your code on how you're doing it, I can't see how you'd be able to store progress for the users in the cloud. At most you could only store progress for a handful of users at a time.

Going back to your original question, I mean, yes, the initial values of the cloud variables will be the values saved inside the Copy Project, but as soon as you run the project it should immediately set the values of all the cloud variables to the values stored in the cloud.

The way you do describe is the way I do it all the time and it's never been a problem.
nembence
Scratcher
1000+ posts

Importing projects with cloud variables

I think that's temporary and it will load the values from the cloud when you reload the project if the cloud variables have the same name in both versions, but I didn't test it so this might be wrong
kammmuschel
Scratcher
32 posts

Importing projects with cloud variables

colinmacc wrote:

kammmuschel wrote:

Hi,

I have a project Archie's World (https://scratch.mit.edu/projects/1291313446/) and I have another one Archie DEVELOP (not shared) which I use while developing. When I want to release a new version, I export “Archie DEVELOP” and I import it to “Archie's World”. The project is using cloud variables to save the progress of the player.

Now when I import it seems the values of my cloud variables are overwritten by the values of the imported project. I do not see a change in the cloud monitor, but the value of the variable seems changed. That is an issue. Workaround could be to copy the value of the cloud variables to a text editor, import the project and update the variables with the original values.

Is that an error of the cloud variable logic or is that how it should be?

Best regards,
Daniel

No that isn't usually a problem, but I'm not sure you're using cloud variables properly here.

The values in the cloud are shared FOR ALL users of the project - it doesn't store a copy of the cloud variables for each user. So, although I haven't looked at your code on how you're doing it, I can't see how you'd be able to store progress for the users in the cloud. At most you could only store progress for a handful of users at a time.

Going back to your original question, I mean, yes, the initial values of the cloud variables will be the values saved inside the Copy Project, but as soon as you run the project it should immediately set the values of all the cloud variables to the values stored in the cloud.

The way you do describe is the way I do it all the time and it's never been a problem.

I will do some more testing and see why it overwrote my cloud data last time. But yes, colinmacc, I know. I have space for ca 75 save games, after that I thought I can show the save string as a number and people can store it themselves if they want to. Or I just delete the oldest one. In case the game ever becomes that popular ;-)

Last edited by kammmuschel (July 9, 2026 13:45:18)

kammmuschel
Scratcher
32 posts

Importing projects with cloud variables

I have tried it again. It seems to be ok now.

What I have learned:

- Directly after import, the variable has the “locally saved” value from the other project

- After a while it does get updated though with the correct cloud value. Funny was that “a while” now is just seconds, some hours ago it was not updated even after minutes. But it doesn't matter, now it works.

- I have learned that the client (different user, second PC) needs to run the game, not go to the editor (“go inside”). Because once inside, the cloud variables don't update. I guess that is on purpose, otherwise anyone could write code to change the cloud variables.

Anyways, I am happy now, everything works. THANK YOU!
colinmacc
Scratcher
1000+ posts

Importing projects with cloud variables

Yes regarding your last point, that is deliberate - If you look inside a project that isn't yours, your session is automatically disconnected from the cloud, so you can't in any way cheat
kammmuschel
Scratcher
32 posts

Importing projects with cloud variables

colinmacc wrote:

Yes regarding your last point, that is deliberate - If you look inside a project that isn't yours, your session is automatically disconnected from the cloud, so you can't in any way cheat

One more question: what happens if my game is run by 2 clients and both update the same cloud variable 10 times a second. Will all 20 updates be processed? Or will every other be skipped? Will I get blacklisted for that?
colinmacc
Scratcher
1000+ posts

Importing projects with cloud variables

All 20 updates should be processed. Hard to predict in what order though!

And you won’t be blacklisted because it’s not your account doing it.

In fact I don’t think anything bad happens if you accidentally send multiple updates without a delay anyway - it just ignores them.

It’s been years since I tested this, but by if you send 3 updates without a delay it will process the first one and the last one but ignore the middle one.

So you can in fact send two without a delay and it processes both of them. There’s some kind of buffer built in which enables that to work
kammmuschel
Scratcher
32 posts

Importing projects with cloud variables

Thanks!!!

Powered by DjangoBB