Discuss Scratch

ProjectMaker59
Scratcher
500+ posts

I need someone expert to do this (What's wrong with this)

Hi, I like to know what's wrong with this http://scratch.mit.edu/projects/113447052 it doesn't work perfectly sometimes it just gets errors, added then deleted then added then deleted, I tried run without screen refresh but it doesn't work
Please help.

Last edited by ProjectMaker59 (June 11, 2016 18:52:15)


Last edited by Kaj (Today 00:00:00)
———————————————-
500th posts: http://scratch.mit.edu/discuss/post/2452980/

ᴍʏ sɪɢɴᴀᴛᴜʀᴇ
New paint: paint
would you rather follow me or give me an internet
Click here to see how to get 100,000 of followers
Binary clock (100% Pen)
ProjectMaker59
Scratcher
500+ posts

I need someone expert to do this (What's wrong with this)

Nobody replies

Last edited by ProjectMaker59 (June 11, 2016 19:32:05)


Last edited by Kaj (Today 00:00:00)
———————————————-
500th posts: http://scratch.mit.edu/discuss/post/2452980/

ᴍʏ sɪɢɴᴀᴛᴜʀᴇ
New paint: paint
would you rather follow me or give me an internet
Click here to see how to get 100,000 of followers
Binary clock (100% Pen)
zp100
Scratcher
100+ posts

I need someone expert to do this (What's wrong with this)

What's wrong with it?

Logic will get you from A to B. Imagination will take you everywhere.

- Albert Einstein
ProjectMaker59
Scratcher
500+ posts

I need someone expert to do this (What's wrong with this)

zp100 wrote:

What's wrong with it?
The problem is when I log in 2 accounts it says “1 user(s) online” then 2 then 1 it switching quickly and I got confused, why not do it again to see what happens, wait

Last edited by Kaj (Today 00:00:00)
———————————————-
500th posts: http://scratch.mit.edu/discuss/post/2452980/

ᴍʏ sɪɢɴᴀᴛᴜʀᴇ
New paint: paint
would you rather follow me or give me an internet
Click here to see how to get 100,000 of followers
Binary clock (100% Pen)
zp100
Scratcher
100+ posts

I need someone expert to do this (What's wrong with this)

ProjectMaker59 wrote:

zp100 wrote:

What's wrong with it?
The problem is when I log in 2 accounts it says “1 user(s) online” then 2 then 1 it switching quickly and I got confused, why not do it again to see what happens, wait
I'm on the project right now on a different webpage. You run the project, and I'll see what happens.

Logic will get you from A to B. Imagination will take you everywhere.

- Albert Einstein
zp100
Scratcher
100+ posts

I need someone expert to do this (What's wrong with this)

Wait, I keep seeing your name flash on and then disappear. This is too complicated for me to understand, but maybe somewhere it only lets one person on the list at a time…

Logic will get you from A to B. Imagination will take you everywhere.

- Albert Einstein
ProjectMaker59
Scratcher
500+ posts

I need someone expert to do this (What's wrong with this)

Bring up my post, Anyone?

Last edited by ProjectMaker59 (June 12, 2016 11:32:02)


Last edited by Kaj (Today 00:00:00)
———————————————-
500th posts: http://scratch.mit.edu/discuss/post/2452980/

ᴍʏ sɪɢɴᴀᴛᴜʀᴇ
New paint: paint
would you rather follow me or give me an internet
Click here to see how to get 100,000 of followers
Binary clock (100% Pen)
deck26
Scratcher
1000+ posts

I need someone expert to do this (What's wrong with this)

Your upload and download are named the wrong way round! The ‘upload’ is taking the cloud variable and loading it into the local list and the ‘download’ takes the local list and saves it to the cloud.

So your Load script is running in a loop because of the forever loop and is doing this

take the cloud data and expand to a list
add the local user to the list
store the list to the cloud
clear the cloud variable
repeat

Think that through and you should see the problem.
ProjectMaker59
Scratcher
500+ posts

I need someone expert to do this (What's wrong with this)

deck26 wrote:

.
So your Load script is running in a loop because of the forever loop and is doing this

take the cloud data and expand to a list
add the local user to the list
store the list to the cloud
clear the cloud variable
repeat

Think that through and you should see the problem.
I am thinking that through and I can't see the problem, Please tell me What do I do wrong?

Last edited by Kaj (Today 00:00:00)
———————————————-
500th posts: http://scratch.mit.edu/discuss/post/2452980/

ᴍʏ sɪɢɴᴀᴛᴜʀᴇ
New paint: paint
would you rather follow me or give me an internet
Click here to see how to get 100,000 of followers
Binary clock (100% Pen)
deck26
Scratcher
1000+ posts

I need someone expert to do this (What's wrong with this)

So what's the last thing you do before you repeat the loop (I know I may have omitted other thngs which aren't relevant). You clear the cloud variable and then try to expand it to a list which will always be empty, you add your own username and store that to the cloud before clearing it again.

So the most the cloud variable can hold at any time, and only very briefly, is a single username.

Last edited by deck26 (June 12, 2016 13:44:45)

ProjectMaker59
Scratcher
500+ posts

I need someone expert to do this (What's wrong with this)

deck26 wrote:

So what's the last thing you do before you repeat the loop (I know I may have omitted other thngs which aren't relevant). You clear the cloud variable and then try to expand it to a list which will always be empty, you add your own username and store that to the cloud before clearing it again.

So the most the cloud variable can hold at any time, and only very briefly, is a single username.
Hi, I really got confused what to do, can you remix to solve the problem?

Last edited by Kaj (Today 00:00:00)
———————————————-
500th posts: http://scratch.mit.edu/discuss/post/2452980/

ᴍʏ sɪɢɴᴀᴛᴜʀᴇ
New paint: paint
would you rather follow me or give me an internet
Click here to see how to get 100,000 of followers
Binary clock (100% Pen)
deck26
Scratcher
1000+ posts

I need someone expert to do this (What's wrong with this)

I'm trying to think of a method like this but haven't managed to do so thus far.

Let's assume you have two users A and B. We can't rely on A deleting A from the list when they disconnect so B has to remove A and vice versa.

So we get A to remove B from the list and B has to add itself back on reasonably quickly if still connected. But B is also removing A regularly so A has to keep adding itself. If these two processes are happening at the same rate nothing is ever stable enough to ensure either A or B knows the other is connected. This only gets more complicated as the number of connected users increases!

These are the issues. I'm still pondering it.
Arcum
Scratcher
17 posts

I need someone expert to do this (What's wrong with this)

bruh its simple as move 2 steps block.
You looping script where it clears cloud var so it will show name of the user that ran it latest.

Generation 378: the first time you see this copy and paste it on top of your sig in the scratch forums and increase generation by 1. Social experiment.
Arcum
Scratcher
17 posts

I need someone expert to do this (What's wrong with this)

I can help if you need help. You using hacked blocks for nothing. You can do it without them. Also i will make a new project just to help you and link it in 10 min.

Generation 378: the first time you see this copy and paste it on top of your sig in the scratch forums and increase generation by 1. Social experiment.
Arcum
Scratcher
17 posts

I need someone expert to do this (What's wrong with this)

https://scratch.mit.edu/projects/113351726/

Generation 378: the first time you see this copy and paste it on top of your sig in the scratch forums and increase generation by 1. Social experiment.
ProjectMaker59
Scratcher
500+ posts

I need someone expert to do this (What's wrong with this)

Arcum wrote:

https://scratch.mit.edu/projects/113351726/
Hi, I'm very Sorry It doesn't help me, I'm trying to make multiplayer game with “Usernames”.

Last edited by Kaj (Today 00:00:00)
———————————————-
500th posts: http://scratch.mit.edu/discuss/post/2452980/

ᴍʏ sɪɢɴᴀᴛᴜʀᴇ
New paint: paint
would you rather follow me or give me an internet
Click here to see how to get 100,000 of followers
Binary clock (100% Pen)
jokebookservice1
Scratcher
1000+ posts

I need someone expert to do this (What's wrong with this)

You could try and make another cloud variable, which allocates two digits per user. When they are connected, they must change their pair by 1 at least every five seconds, but the script should do it every half a second, so that it accounts for five seconds of internet transfer time. When the pair of digits gets to “99” it should loop back to “01”. If, after five seconds, a user detects that the person has left, they should set a third variable to an encoded form of their username, and a fourth stating when they started (using the “days since 2000” block. If, after 5 seconds the inactive user is not removed, anther user will step in and do it.

Does that solve it?
deck26
Scratcher
1000+ posts

I need someone expert to do this (What's wrong with this)

jokebookservice1 wrote:

You could try and make another cloud variable, which allocates two digits per user. When they are connected, they must change their pair by 1 at least every five seconds, but the script should do it every half a second, so that it accounts for five seconds of internet transfer time. When the pair of digits gets to “99” it should loop back to “01”. If, after five seconds, a user detects that the person has left, they should set a third variable to an encoded form of their username, and a fourth stating when they started (using the “days since 2000” block. If, after 5 seconds the inactive user is not removed, anther user will step in and do it.

Does that solve it?
There are certainly alternative ways of doing it. My multiplayer basics demo for example. My point was that the method being used here wasn't going to work.

However there's always a risk with what you suggest that two players are in sync with each other so each time player A changes the variable player B changes it as well so it looks like only one is connected. That's why I'd always use one cloud variable per player. Each player is then in total control of one cloud var and a new player will only join if there's a spare. If the cloud var stores the username (encoded of course) and a constantly changing variable you can detect if they're still connected. There's no need to constantly decode the usernames, just check the last encoded versions with the current ones. The same cloud vars can be used for game data.
zp100
Scratcher
100+ posts

I need someone expert to do this (What's wrong with this)

https://scratch.mit.edu/projects/98837341/#editor. Look at the third-to-last script in the Stage. Every second, it clears all the players from the list. If the players are still on, they'll immediately add their names back on. Hopefully this helps!

Logic will get you from A to B. Imagination will take you everywhere.

- Albert Einstein
ProjectMaker59
Scratcher
500+ posts

I need someone expert to do this (What's wrong with this)

zp100 wrote:

https://scratch.mit.edu/projects/98837341/#editor. Look at the third-to-last script in the Stage. Every second, it clears all the players from the list. If the players are still on, they'll immediately add their names back on. Hopefully this helps!
Thanks it helps me bit, but I still need help

Last edited by ProjectMaker59 (June 23, 2016 17:50:31)


Last edited by Kaj (Today 00:00:00)
———————————————-
500th posts: http://scratch.mit.edu/discuss/post/2452980/

ᴍʏ sɪɢɴᴀᴛᴜʀᴇ
New paint: paint
would you rather follow me or give me an internet
Click here to see how to get 100,000 of followers
Binary clock (100% Pen)

Powered by DjangoBB