Annoying inconsistency in "Play Solo" mode

It’s not really a huge bug per se, it’s just a minor inconvenience.

Sometimes the player in Play Solo is named “Player” and sometimes the player is called “Player1”. It is annoying when trying to reuse command bar code, only for it to error because the client is named differently

It’s seemingly randomly decided when you first open up studio, and then it never changes until you close studio again

I thought it was if you ran a server then it showed up as player1.
however I feel like what you said happens too.

[quote] It’s not really a huge bug per se, it’s just a minor inconvenience.

Sometimes the player in Play Solo is named “Player” and sometimes the player is called “Player1”. It is annoying when trying to reuse command bar code, only for it to error because the client is named differently

It’s seemingly randomly decided when you first open up studio, and then it never changes until you close studio again [/quote]

Well that’s interesting. That probably shouldn’t happen!

Yeah, this happends some times, i just add “player”, “player1” in almost all my scripts, but normally it’s player1

I agree, it can be inconvenient.

I have notice the distinction is this: if you open the place from local storage and play solo, it will be Player1. If you upload your place and keep it open, or start by clicking Edit on your place (i.e. any time you see the cloud icon in the tab for your place) and then play solo, it will name you Player.

[quote] I agree, it can be inconvenient.

I have notice the distinction is this: if you open the place from local storage and play solo, it will be Player1. If you upload your place and keep it open, or start by clicking Edit on your place (i.e. any time you see the cloud icon in the tab for your place) and then play solo, it will name you Player. [/quote]

That’s a nice find, and makes this a lot easier to track down, thanks!

If you do make a change, please make the name Player1. I (and I’m sure countless others) have scripts tuned to “Player1” and it would be extremely inconvenient to have to edit each and every one.

In the actual game you don’t know players names, they can be any. Could you please provide more details on why your scripts rely on player names?

In the initial stages of your project you may want to throw together a quick hack to see if something works or try something out in the command bar, for which it is useful if the test players have consistent and predictable names (Player for Play Solo, and Player1, Player2, etc for Test Server) when you run Play Solo / Test Server (otherwise you have to change your hack code / command bar commands every time you run the game again). Naturally it has nothing to do with live games.

Simple whitelists, for one. It’s easier to check if the name is “Player1” than it is to do all the hacks required to see if a game is online or not.

There’s only one.

function isRealPlayer(player)
    return player.UserId > 0
end

In Play Solo your UserId is -1, and in test servers, the negative of the number after the name.

before the necro, such hacks didn’t happen.

What’s wrong with this method?

Returns true for Test server, Run mode, and Play Solo (I just tested)

1 Like

Yeah, what buildthomas pointed out is better. That’s a clean solution. With it, there’s no reason for the player to be named “Player1” – “Player” would be more appropriate since it’s unique and there can’t be more than one.

1 Like

Thank you for clarification, we will add this issue to our pipeline.