Page 1 of 1

Server player cam

Posted: Wed Aug 02, 2017 10:24 pm
by Nick-Nack
Hi there!

I'm looking for a way to automatically follow a different player for a multiplayer server and live streaming. Even better if the cam automagically chooses which player to focus on, but just something where I can click a button and the camera automatically follows a selected player would be great.

Are there any mods like this? if not, would this be theoretically possible via mod?

Best
Daniel

Re: Server player cam

Posted: Tue Aug 15, 2017 8:05 pm
by kreatious
I haven't bothered looking for a mod like this.

But this type of mod is theoretically possible (please note that I'm not volunteering to actually write the mod.). Try pasting some of these commands in game.

Initialization:

Code: Select all

/c follow = game.player
webcam = game.player.gui.left.add{type="camera", name="web", position=follow.position}
webcam.style.minimal_width = 100
webcam.style.minimal_height = 100

script.on_event(defines.events.on_tick, function(e)
  if follow == nil or not follow.valid then
    webcam.style.visible = false
    return
  end
  webcam.style.visible = true
  webcam.position = follow.position
end)
Follow selected object:

Code: Select all

/c follow = game.player.selected
Follow specific player

Code: Select all

/c follow = game.players["kreatious"]
Hide webcam

Code: Select all

/c follow = nil