[0.16.12]force.spawn_position ignored on player creation

Bugs that are actually features.
Post Reply
Bilka
Factorio Staff
Factorio Staff
Posts: 3135
Joined: Sat Aug 13, 2016 9:20 am
Contact:

[0.16.12]force.spawn_position ignored on player creation

Post by Bilka »

When a new player joins a multiplayer game, the spawn_position set by force.set_spawn_position is ignored. To reproduce:

1. Start mp game
2. Run:

Code: Select all

/c game.create_surface("2", game.player.surface.map_gen_settings)
	game.player.teleport({0, 0}, "2")
	for _, force in pairs(game.forces) do
		force.set_spawn_position({1,1}, "2")
	end
3. Have a 2nd player join

Expected: The second player spawns next to the first player because their spawn position is set to the second surface.

Actual result: The second player spawns on nauvis.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.12]force.spawn_position ignored on player creation

Post by Rseding91 »

Thanks for the report. Spawn positions are per-surface and aren't exclusive: If you define a spawn position for surface 2 but don't define one for surface 1 then the game defaults to position 0,0 on surface 1 - it pays no attention to what other surfaces have defined.

Additionally joining a MP game always spawns on surface 1 (as it's guaranteed to always exists).
If you want to get ahold of me I'm almost always on Discord.

chrisgbk
Long Handed Inserter
Long Handed Inserter
Posts: 92
Joined: Mon Jan 02, 2017 4:31 am
Contact:

Re: [0.16.12]force.spawn_position ignored on player creation

Post by chrisgbk »

This seems like it was just a misunderstanding: the surface parameter specifies which surface the spawn position is being set for, -not- which surface is the default to spawn to.
Last edited by chrisgbk on Sun Dec 31, 2017 11:32 pm, edited 1 time in total.

Bilka
Factorio Staff
Factorio Staff
Posts: 3135
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: [0.16.12]force.spawn_position ignored on player creation

Post by Bilka »

chrisgbk wrote:This seems like it was just a misunderstanding: the surface parameter specifies which surface the spawn position is being set for, -not- which surface is the default to spawn to. Try this out by changing the spawn location for "2" to {100,100} then killing yourself after teleporting to "2" - you'll respawn on surface "2" at {100,100} instead of {0,0}.
That's what Rseding said..?
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Post Reply

Return to “Not a bug”