Discuss Scratch

dj_greener
Scratcher
500+ posts

Automatic Player ID (still not answered)

So like i (dj_greener) is Player ID 000000 and AlexTacoMit Player ID 000001 and then ZG20 Player ID 000002 but i want to be it automatic. (I want ID's becase cloud variables only support numbers.) It's for my Windows Simulator game, an populair game.

Last edited by dj_greener (March 16, 2022 15:31:53)

LG125
Scratcher
500+ posts

Automatic Player ID (still not answered)

You can use encoders and decoders to send usernames through, there’s quite a bit
dj_greener
Scratcher
500+ posts

Automatic Player ID (still not answered)

LG125 wrote:

You can use encoders and decoders to send usernames through, there’s quite a bit
I know there is an
when green flag clicked
if <(username) = [dj_greener]> then
set [☁ ID v] to [000000]
end
but thats not automatic… i just wanna know if its possible to make this automatic becase yeah a lot of people are playing my project.
LG125
Scratcher
500+ posts

Automatic Player ID (still not answered)

dj_greener wrote:

LG125 wrote:

You can use encoders and decoders to send usernames through, there’s quite a bit
I know there is an
when green flag clicked
if <(username) = [dj_greener]> then
set [☁ ID v] to [000000]
end
but thats not automatic… i just wanna know if its possible to make this automatic becase yeah a lot of people are playing my project.
Wdym, that u take the next available id?

Im thinking of a script
dj_greener
Scratcher
500+ posts

Automatic Player ID (still not answered)

LG125 wrote:

dj_greener wrote:

LG125 wrote:

You can use encoders and decoders to send usernames through, there’s quite a bit
I know there is an
when green flag clicked
if <(username) = [dj_greener]> then
set [☁ ID v] to [000000]
end
but thats not automatic… i just wanna know if its possible to make this automatic becase yeah a lot of people are playing my project.
Wdym, that u take the next available id?

Im thinking of a script
yes and okay
LG125
Scratcher
500+ posts

Automatic Player ID (still not answered)

dj_greener wrote:

LG125 wrote:

dj_greener wrote:

LG125 wrote:

You can use encoders and decoders to send usernames through, there’s quite a bit
I know there is an
when green flag clicked
if <(username) = [dj_greener]> then
set [☁ ID v] to [000000]
end
but thats not automatic… i just wanna know if its possible to make this automatic becase yeah a lot of people are playing my project.
Wdym, that u take the next available id?

Im thinking of a script
yes and okay

when I receive [Join online v]
if <(☁ User 1 ID) = []> then
set [☁️ User 1 ID v] to [001]
else
if <(☁ User 2 ID) = []> then
set [☁️ User 2 ID v] to [002]
else
And so on.
end
end
Other cloud scripts

I cant think of anything better at the moment.
dj_greener
Scratcher
500+ posts

Automatic Player ID (still not answered)

LG125 wrote:

dj_greener wrote:

LG125 wrote:

dj_greener wrote:

LG125 wrote:

You can use encoders and decoders to send usernames through, there’s quite a bit
I know there is an
when green flag clicked
if <(username) = [dj_greener]> then
set [☁ ID v] to [000000]
end
but thats not automatic… i just wanna know if its possible to make this automatic becase yeah a lot of people are playing my project.
Wdym, that u take the next available id?

Im thinking of a script
yes and okay

when I receive [Join online v]
if <(☁ User 1 ID) = []> then
set [☁️ User 1 ID v] to [001]
else
if <(☁ User 2 ID) = []> then
set [☁️ User 2 ID v] to [002]
else
And so on.
end
end
Other cloud scripts

I cant think of anything better at the moment.
Oh okay. I hope you know something better soon!
dj_greener
Scratcher
500+ posts

Automatic Player ID (still not answered)

dj_greener wrote:

LG125 wrote:

dj_greener wrote:

LG125 wrote:

dj_greener wrote:

LG125 wrote:

You can use encoders and decoders to send usernames through, there’s quite a bit
I know there is an
when green flag clicked
if <(username) = [dj_greener]> then
set [☁ ID v] to [000000]
end
but thats not automatic… i just wanna know if its possible to make this automatic becase yeah a lot of people are playing my project.
Wdym, that u take the next available id?

Im thinking of a script
yes and okay

when I receive [Join online v]
if <(☁ User 1 ID) = []> then
set [☁️ User 1 ID v] to [001]
else
if <(☁ User 2 ID) = []> then
set [☁️ User 2 ID v] to [002]
else
And so on.
end
end
Other cloud scripts

I cant think of anything better at the moment.
Oh okay. I hope you know something better soon!
Also it IS still not answered.
deck26
Scratcher
1000+ posts

Automatic Player ID (still not answered)

If you want a username to automatically to be added to a list in the project you'd need a ‘server’ version of the project running on your account. It would have to look for new users, receiving encoded usernames and adding them to the list so they can be used after that.

I've never done this as don't have anything I want to leave connected to Scratch 24/7. I presume it would have to be running in the editor for any non-cloud data changes to be saved within the project so these can be seen by others but don't know how often Scratch will update the data on that basis. Presumably someone connecting would also have to reload the project for their name to be seen, by them, in the list.

An alternative is to keep one or two cloud variables for new user info. Then encoded usernames can be allocated numbers and stored in the cloud. So anyone running the project can access the saved list of users as well as the list of pending users from the cloud variables. Then once a week or whatever you can run a script that properly allocates the usernames to the list and clears the pending users from the cloud vars. The main issue is having to do that work at the right time interval and the risk of having no space for new users if there are too many pending users.
LG125
Scratcher
500+ posts

Automatic Player ID (still not answered)

Im not really good with cloud variables so I cant help a lot here.
deck26
Scratcher
1000+ posts

Automatic Player ID (still not answered)

LG125 wrote:

Im not really good with cloud variables so I cant help a lot here.
So don't post if you have nothing useful to add!

Powered by DjangoBB