Game Development Community

Easy one.. how does a client know its got an active player?

by Phil Carlisle · in Torque Game Engine · 03/16/2002 (3:51 am) · 3 replies

Yep, I'm sure there's a script function call or whatever, I just cant find it.

I want to know, client side, if I have an active player on my connection or not (that is, am I controlling an object).

Anyone got any idea's?

Phil.

#1
03/16/2002 (4:43 am)
Like this?

%obj = %client.getControlObject();
if( %obj == %client.player )
{
// It's a player...and it's In Control(TM)!
}
#2
03/16/2002 (4:58 am)
Is that client side tho james.. and where is %client from? is it stored globally?

Phil.
#3
03/16/2002 (5:53 am)
Ahh, fixed it, there is a function in gameconnection called

initialControlSet

which is basically the place where playGui gets pushed. I put my own choose team gui after that (I needed to do that because my gui was getting pushed before the playgui when I first coded it).

So I could set a global variable in there (so that I'd know i had a control object) and if I got a killed message, I'd set it to false etc.

Cool.

Phil.