Page 1 of 1

Observer mode in Multiplayer

Posted: Tue Feb 21, 2017 10:31 pm
by Caledorn
Hey!

So, I've found out how you can take over another player's body and items through using the LUA console, which was funny, and slightly creepy - but not exactly what I was looking to do. So I figured I'd ask here in the forums for what I would like to do.

Is there a way that you can go into ghost mode, and then use a command to follow another player around, so you see the game from their perspective when they're moving around the map? Kind of a ghost-follow mode? :-)

- Caledorn

Re: Observer mode in Multiplayer

Posted: Tue Feb 21, 2017 10:49 pm
by prg
Something like

Code: Select all

/c game.player.character=nil script.on_event(defines.events.on_tick, function(event) game.players[2].teleport(game.players[1].position) end)
(adjust player numbers to taste)

Re: Observer mode in Multiplayer

Posted: Fri Feb 24, 2017 6:58 pm
by Caledorn
prg wrote:Something like

Code: Select all

/c game.player.character=nil script.on_event(defines.events.on_tick, function(event) game.players[2].teleport(game.players[1].position) end)
(adjust player numbers to taste)
Sorry for the late response - but thank you very, very much! That worked wonderfully!

For the record you can also replace game.players[2] etc with game.players["player_nickname"], if you don't know a player's ID. :-)