Server/Client side gameTSCtrl
by Jendrik Posche · in Torque Game Engine · 09/17/2008 (5:04 am) · 1 replies
Hey all,
I have a problem with this gametsctrl class. I added a boolean to this class to determine that a certain key has been pressed/released. However this boolean is only known on the server side and not client side.
Now there is no such thing as packupate/unpackupdate and I also tried to :
commandToClient/Server but i get this error message:
NetConnection::serverToGhostId - could not find specified object.
I used the following code:
commandToServer('BPressedServer', %val);
function serverCmdBPressedServer(%client, %val){
%guiID = %client.getGhostID( PlayGui ) ;
commandToClient(%client, 'BPressedClient', %guiID, %val);
}
function clientCmdBPressedClient(%guiid, %val){
%gui = ServerConnection.resolveGhostID( %guiid );
%gui.fooKey( %val );
}
Any idea why I get this error and how can I solve this problem?
Greets
I have a problem with this gametsctrl class. I added a boolean to this class to determine that a certain key has been pressed/released. However this boolean is only known on the server side and not client side.
Now there is no such thing as packupate/unpackupdate and I also tried to :
commandToClient/Server but i get this error message:
NetConnection::serverToGhostId - could not find specified object.
I used the following code:
commandToServer('BPressedServer', %val);
function serverCmdBPressedServer(%client, %val){
%guiID = %client.getGhostID( PlayGui ) ;
commandToClient(%client, 'BPressedClient', %guiID, %val);
}
function clientCmdBPressedClient(%guiid, %val){
%gui = ServerConnection.resolveGhostID( %guiid );
%gui.fooKey( %val );
}
Any idea why I get this error and how can I solve this problem?
Greets
Associate James Ford
Sickhead Games
commandToClient( %client, 'SetBool', %bool ); // on the client side function SetBool( %bool ) { YourCtrl.foo = %bool; }