Game Development Community

Client side camera stuff

by Stephen Clark · in Torque Game Engine · 08/08/2004 (7:10 pm) · 4 replies

So only one cam resource that i know of handles ded. client stuff properly.??? What gives?

Anyways, I did my own thing and now what I need to do is on a any client (dedicated too...) just have a function that calls a method (zoom) on the local client's player. What do I do? I've seen other refs to getting the player obj on a client, but not a damn thing came out of them. LocalClientConnection only works on a client/server.


thanks,

-s

#1
08/08/2004 (8:29 pm)
You would have to send a command to the server, which would then send a command to all the clients.
#2
08/09/2004 (8:22 pm)
Really? That seems like a waste of bandwidth... I can put checks in the engine code so that a client can't see too much, and besides they are only gonna see what their client has data on...

Here's what I did, comments please:
ConsoleFunction( setZoom, F32, 2,2,"client only zoom")
{

GameConnection * conn = GameConnection::getServerConnection();
if( !conn)
  return;

ShapeBase* control = conn->getControlObject();

if(!control)
   return;

if( ! control->isClientObject())
  return;

control->setZoom( atof(argv[1]));

return 1;

}

Shouldnt this or something like it just find the client's object and do a mutator??

thanks,

-s
#3
08/09/2004 (9:02 pm)
Oh oh oh! You are only setting your client to zoom. I thought you wanted to make OTHER clients zoom. My mistake. I misread. That looks good to me.
#4
08/10/2004 (10:58 pm)
Cool, thanks!!

-s