Page MenuHomeFeedback Tracker

SelectSpectator still not works in 1.02.150980
Closed, ResolvedPublic


SelectSpectator still not works in 1.02.150980 on server side!


Operating System
Windows 7
Operating System Version
Windows 7 x64 SP1, Windows Server 2008 R2 x64 SP1

Event Timeline

borizz.k created this task.Mar 29 2019, 6:08 PM
Geez assigned this task to rVn.
borizz.k updated the task description. (Show Details)Apr 1 2019, 1:16 PM
rVn changed the task status from New to Need More Info.Apr 4 2019, 5:04 PM

Hi, please add reproduction steps or code sample.

borizz.k added a comment.EditedApr 5 2019, 11:29 AM


I not use any mods for server and client
Only server functions on server side

If i need to turn on free camera for player (PlayerBase Player) (connected client) i use on server side this code:

PlayerBase pBody = Player;
PlayerIdentity pIdentity = Player.GetIdentity();

//pBody and pIdentity is global class variables

vector position = Player.GetPosition();
GetGame().SelectPlayer(Player.GetIdentity(), NULL); //not necessary
GetGame().SelectSpectator(pIdentity, "freedebugcamera",position);

In old patches camera always creates at position regardless of player position, in next patches camera always creates at player position, regardless of the specified coordinates

for turn off free camera i use next cod:
GetGame().SelectPlayer(pIdentity, pBody); or GetGame().SelectPlayer(Player.GetIdentity(), Player);

since 1.02 experemental and stable updates this functions not works and freecamera not create

This is very necessary to make videos, for admins watching the players and world during pvp, testing mods etc...


rVn added a comment.Apr 5 2019, 2:11 PM

In the above example you use
PlayerBase pBody = Player;
and then get identity and other things with Player instead of pBody, but I will assume that is a copy mistake

On the select spectator line, try using "Camera" instead of "freedebugcamera" as the debug one should only work internally. Also note that the argument is case sensitive so don't use "camera"

That should work as intended.

camera is created, but how to contol it, move up, down, forward, backward etc ?
Old freedebugcam could be controlled by player (client)

rVn closed this task as Resolved.EditedApr 5 2019, 5:31 PM

CGame::UpdateSpectatorPosition exists for this very reason, loop it when spectating

If you would like to move around, you will have to achieve it by setting up your own Camera object

borizz.k added a comment.EditedApr 5 2019, 6:44 PM

How to setting up Camera object on server for camera control from client as freecamera?


vector position = player.GetPosition();

this code not works!

and how to control camera from player side???