Game Development Community

Problem with client server scripts

by M Sazzad Karim · in Torque Game Engine · 08/26/2006 (11:53 am) · 2 replies

Hi,

I need ahelp from torque expert :-)

I am trying to implement a client server game where each client will get different type of responsibility.
For example,

client 1: get a Tank
client 2: Rocket launcher
client 3: Radar controller

I am trying to implement it in following way:

1. I have a function in server/scripts/game.cs

function GameConnection::onClientEnterGame(%this)
{
This function hook up the camera with a path to show the player (in a client)
a walking mission demo
}

2. I have a function in server/scripts/game.cs

function GameConnection::onClientJoinGame(%this)
{
this function call create player and hook the camera
with the player eyepoint
}

3. I have bind ctrl+l to push a dialog(AssigntoGame.gui) with join game button.
when the camera is hooked in the path (onClientEnterGame(%this)) player can
use ctrl+l to get the dialog.

4. I have a function in the client/ui/AssigntoGame.gui, which is as follows:

function toGame()
{
commandToServer('JoinGame');
}

5. in server/scripts/game.cs i have

function serverCmdJoinGame()
{
GameConnection::joinGame();
}

and another function named:

function GameConnection::joinGame()
{
onClientJoinGame(%this);
}


Now my problme is how can i call function GameConnection::onClientJoinGame(%this)
from the function GameConnection::joinGame() ??

I have tried GameConnection.onClientJoinGame(%this); it is not working

I know the post is silly but still i need help on this.

Thank you

#1
08/26/2006 (12:06 pm)
%this.onClientJoinGame

Where %this = Client
#2
08/27/2006 (2:20 am)
Thanks Tim!