Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Cloud variables
- CyanCode
-
4 posts
Cloud variables
I opened the same project in 2 windows, but the same cloud variable in both windows were different?
- imfh
-
1000+ posts
Cloud variables
Try checking out the cloud log. If you go to a projects page (not the editor or fullscreen), and look below the project, there should be an icon that says “Cloud Variables.” On that icon, press the arrow that says “See Data.”
The cloud log will let you see if the cloud variables are actually changing. Doing certain things (like setting a cloud variable to a letter), can make them act like a regular variable.
If you are still having trouble, could you share the link to the project you were having trouble with?
The cloud log will let you see if the cloud variables are actually changing. Doing certain things (like setting a cloud variable to a letter), can make them act like a regular variable.
If you are still having trouble, could you share the link to the project you were having trouble with?
- CyanCode
-
4 posts
Cloud variables
The link is Try checking out the cloud log. If you go to a projects page (not the editor or fullscreen), and look below the project, there should be an icon that says “Cloud Variables.” On that icon, press the arrow that says “See Data.”https://scratch.mit.edu/projects/580307083
The cloud log will let you see if the cloud variables are actually changing. Doing certain things (like setting a cloud variable to a letter), can make them act like a regular variable.
If you are still having trouble, could you share the link to the project you were having trouble with?
- CyanCode
-
4 posts
Cloud variables
Also, what things can turn a cloud variable into a normal variable?
- oppooo
-
63 posts
Cloud variables
Apparently, you are setting your cloud variable multiple times in the same loop. In this case, it will only do the first block. For example:The link is Try checking out the cloud log. If you go to a projects page (not the editor or fullscreen), and look below the project, there should be an icon that says “Cloud Variables.” On that icon, press the arrow that says “See Data.”https://scratch.mit.edu/projects/580307083
The cloud log will let you see if the cloud variables are actually changing. Doing certain things (like setting a cloud variable to a letter), can make them act like a regular variable.
If you are still having trouble, could you share the link to the project you were having trouble with?
This will only set it to 1, never 2 and 3. This is because cloud variables require a 0.1 second cooldown, which means you need an interval of 0.1 in the middle of your sets. Ex:
This will set it to 1, 2, and 3 continuously. But since you have a wait, you should probably make the cloud code separate from your game mechanincs code.
However, when you read the cloud variable for other peoples' values, you don't wait. You check if it is the x, y, direction, etc. that is being sent, and decode it all to the clones/stamps.
This method may cause overriding for 3+ people, though. The more people that play, the more likely it is that two players sent in their data at the same time, ignoring one of the inputs. For this reason, you might want to use 10 cloud variables, and randomly insert your data every 0.1 seconds into one of them, while reading all of them once per loop. Although an override could still happen, this mostly clears up the risk.
Does this help?
- supergamer10000
-
1000+ posts
Cloud variables
Yes try thatApparently, you are setting your cloud variable multiple times in the same loop. In this case, it will only do the first block. For example:The link is Try checking out the cloud log. If you go to a projects page (not the editor or fullscreen), and look below the project, there should be an icon that says “Cloud Variables.” On that icon, press the arrow that says “See Data.”https://scratch.mit.edu/projects/580307083
The cloud log will let you see if the cloud variables are actually changing. Doing certain things (like setting a cloud variable to a letter), can make them act like a regular variable.
If you are still having trouble, could you share the link to the project you were having trouble with?
This will only set it to 1, never 2 and 3. This is because cloud variables require a 0.1 second cooldown, which means you need an interval of 0.1 in the middle of your sets. Ex:
This will set it to 1, 2, and 3 continuously. But since you have a wait, you should probably make the cloud code separate from your game mechanincs code.
However, when you read the cloud variable for other peoples' values, you don't wait. You check if it is the x, y, direction, etc. that is being sent, and decode it all to the clones/stamps.
This method may cause overriding for 3+ people, though. The more people that play, the more likely it is that two players sent in their data at the same time, ignoring one of the inputs. For this reason, you might want to use 10 cloud variables, and randomly insert your data every 0.1 seconds into one of them, while reading all of them once per loop. Although an override could still happen, this mostly clears up the risk.
Does this help?
- imfh
-
1000+ posts
Cloud variables
Another thing which can turn a cloud variable into a regular variable is if you press see inside. If you press see inside on a project that isn't owned by the account you are on, cloud variables will be disabled for that user until you refresh the page.
Your issue could also caused by what @oppooo explained above, however. Even if pressing see inside is the cause of your issue, you should be careful about setting cloud variables too quickly.
Your issue could also caused by what @oppooo explained above, however. Even if pressing see inside is the cause of your issue, you should be careful about setting cloud variables too quickly.
- Discussion Forums
- » Help with Scripts
-
» Cloud variables