SelectSpectator still not works in 1.02.150980 on server side!
Description
Details
- Severity
- Feature
- Resolution
- Open
- Reproducibility
- Always
- Operating System
- Windows 7
- Operating System Version
- Windows 7 x64 SP1, Windows Server 2008 R2 x64 SP1
- Category
- General
Event Timeline
Hi
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...
ThanX
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.
Ok
camera is created, but how to contol it, move up, down, forward, backward etc ?
Old freedebugcam could be controlled by player (client)
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
How to setting up Camera object on server for camera control from client as freecamera?
ThanX
vector position = player.GetPosition();
GetGame().UpdateSpectatorPosition(position);
this code not works!
and how to control camera from player side???