Torque/Networking/Ghosting/Examples
From TDN
Contents |
[edit]
Examples of Managing Ghost Objects
[edit]
In Script
[edit]
You want to pass an object ID from the server to a client
An example of this might be telling a particular client that some object is of special interest to them.
on the server:
function foo(%targetClient, %serverObject)
{
%objIndex = %targetClient.getGhostID(%serverObject);
commandToClient(%targetClient, 'bar', %objIndex);
}
on the client:
function ClientCmdBar(%objIndex)
{
%clientObject = $gameConnection.resolveGhostID(%objIndex);
%clientObject.DoSomething();
}
[edit]



