Game Development Community

Player object

by Ron Yacketta · in Torque Game Engine · 10/31/2002 (10:09 am) · 6 replies

All,

I have been searching for a way to get the player object script side in an onWake/onAdd function. Any ideas?

Regards,

Ron

#1
10/31/2002 (11:03 am)
Ron, I'm doing this in gui's for example:
//client/scripts/MyGui.cs
MyGui::onWake(%this)
{
   commandToServer('SomeFunction');
}
function clientCmdAnotherFunction(%myPlayer)
{
   // here we get our player object back from the server!
   echo("Player:" SPC %myPlayer);
}

--------------------------------------- 

// server/scripts/commands.cs
serverCmdSomeFunction(%client)
{
   %myPlayer = %client.player;
   commandToClient('AnotherFunction', %myPlayer);
}

Does this help?
Greetinx, beffy
#2
10/31/2002 (11:09 am)
Do not feel like running another topic, so I will piggy back off of this on :)

I think I am loosing my marbles here, just got myself all confused as well as gave myself a headache.

Is this the correct x,y,z system for TGE?

X   Y
|  /
| / 
|/_ _ _ Z

Ah!

Yes, that should do.. send a command to the server to have a return of the player :) DUH!

-Ron
#3
11/01/2002 (6:30 am)
Ron, Go into edit mode; select an interior object to move and you will see the coord sys axes.
#4
11/01/2002 (6:35 am)
Desmond,

Thanxs, it was just one of those days. everything I did was wrong just plain wrong :(
now I am hitting another "stumbling" block, I add a MissionMarker to a mission with a specific rotation, then set the cameras transform to that of the MissionMarker and the rotation reverts back to stock "1 0 0 0".. just another one of those hair pulling hell rasing TGE days!

-Ron
#5
11/02/2002 (7:36 am)
Rotation of the mission marker or the camera?
#6
11/02/2002 (9:33 am)
I have a MissionMarker with a specific xyz and rotation, when I set the players camera to the transform of the MissionMarker I loose all rotation.
I initialy had the MissionMarker rotated along the x axis to look straight down on the Mission, after setting transform the x axis rotation is gone and a output of the camera transform confirms the lack of rotation (1 0 0 0)

-Ron