Passing objects to clients via commandToClient?
by Richard Foge · in Torque Game Builder · 05/07/2006 (10:07 pm) · 3 replies
I seem to be having trouble doing this. Is it even possible?
Looks something like:
commandToClient($Player1, 'clientCommand01', %object)
function clientCmdclientCommand01(%object)
{
%localObj.name = %object.name;
}
%object doesn't contain any data. Is what I am trying to do supported?
And if it isn't supported is there an optimal way for moving that kind of data across from server to client?
Looks something like:
commandToClient($Player1, 'clientCommand01', %object)
function clientCmdclientCommand01(%object)
{
%localObj.name = %object.name;
}
%object doesn't contain any data. Is what I am trying to do supported?
And if it isn't supported is there an optimal way for moving that kind of data across from server to client?
#2
Now you pass that string over the net.
I would even suggest having different functions and a leading identifier in the string blocks (like a byte), so you can update different datas independently (like position, state and the like)
05/24/2006 (1:32 am)
The easiest way is to give your object a function that returns the needed data as a string and a function that can update the object from a given string.Now you pass that string over the net.
I would even suggest having different functions and a leading identifier in the string blocks (like a byte), so you can update different datas independently (like position, state and the like)
#3
05/27/2006 (2:16 pm)
That's perfect, thanks!
Torque Owner Tim Doty
A way to do this entirely in script would be to use functions to send over the object's "pieces".