Game Development Community

Some questions about "%client

by Dane Nielsen · in Torque Game Engine · 09/02/2006 (1:09 pm) · 4 replies

I'm rather new with Torque and have been looking through the FPS starter kit over the past few day. I'm noticing alot of calls to %client.something() and have some questions. I can determine that it represents a person connected to the server and that each player has one. The questions I can think of right now are:

Where is %client created?
What exactly is %client?
What is included in %client (what functions and variable can you call through it)?
How do you add variables or functions to %client?

I did search for information on this but couldn't find anything. If anyone could either explain it to me or point me to come documentation that would be great.

#1
09/02/2006 (2:42 pm)
%client is simply the client's CADD number. It represents the client thats currently being operated on, you'll see in any function that references %client its either passed the client at the beginning or its determined in the function (%client = %player.client for instance)

I suggest you brush up on your torquescript before going much further :)

[Ishbuu]
#2
09/02/2006 (3:01 pm)
Client is the GameConnection class. As far as the server side scripts are concerned, the real first reference it sees is in clientConnections.cs in the common/server/ directory. The GameConnection::onConnection functions get called when you first try to connect to a server. Once you actually get into a server, the GameConnection::onClientEnterGame function gets called, which is in starter.fps/server/scripts/game.cs . You should be able to figure any answers to your questions based off the information you can find in those scripts.
#3
09/02/2006 (7:29 pm)
Thanks that helps alot.
#4
10/04/2006 (9:06 pm)
What if we want to operate %client to AI bot,any idea how to do it