Solo map and player name saved ?

Bugs that are actually features.
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1525
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Solo map and player name saved ?

Post by binbinhfr »

Hi,

I wonder if it's a bug, but it's annoying :

Let say that player1 save a solo map and send it to player2 so that he can play with it.

When opening the map, player2 character will have the name of player1.
confirmed by several tests with
/c game.local_player.print( game.local_player.name )

Is it normal ?
If it is intended, then is there a way for a mod in soloplay to retrieve the name of the actual local player ?
This name must be available somewhere, because the name of player1 was saved in the map...
My mods on the Factorio Mod Portal :geek:
Rseding91
Factorio Staff
Factorio Staff
Posts: 15903
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Solo map and player name saved ?

Post by Rseding91 »

Mods have no concept for "local player" and they shouldn't. They should just operate on all players in the game and deal with each player accordingly.

Loading a map in single player will always connect as the 1 single player until you open it in Multiplayer - that's intended.
If you want to get ahold of me I'm almost always on Discord.
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1525
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: Solo map and player name saved ?

Post by binbinhfr »

Rseding91 wrote:Mods have no concept for "local player" and they shouldn't. They should just operate on all players in the game and deal with each player accordingly.

Loading a map in single player will always connect as the 1 single player until you open it in Multiplayer - that's intended.
I understand what you say, but it is not very coherent with the fact that in solo mode, the multiplayer name (in player-data.json) is given to the player when he is created, and never changed later until the map is opened in MP. To be coherent, the name in solo should always be empty, until MP.

On another hand, it could be useful and logical in a solo map, to update the single player name with the name in the player-data.json .
It would permit a mod to print messages or report windows, using the real name of the player, and not the name of a player that created the map.
My mods on the Factorio Mod Portal :geek:
Rseding91
Factorio Staff
Factorio Staff
Posts: 15903
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Solo map and player name saved ?

Post by Rseding91 »

Player names aren't unique and can be changed at any time. The player index is the only useful part currently to identify a specific player.
If you want to get ahold of me I'm almost always on Discord.
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1525
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: Solo map and player name saved ?

Post by binbinhfr »

Rseding91 wrote:Player names aren't unique and can be changed at any time. The player index is the only useful part currently to identify a specific player.
Yes, I understood, but I just wanted to emit personal messages to the attention of the player with the name he has declared. Nevermind. I understood it's not possible in solo play.
My mods on the Factorio Mod Portal :geek:
Post Reply

Return to “Not a bug”