What's My ID?!?!
by Welias D. Willie II · in Torque Game Engine · 12/12/2004 (4:58 pm) · 6 replies
Ok this is sad and I am sure I am overlooking the obvious. Maybe it is just too late or I have been looking at code too long.
How do I get my local client's id? I have a GUI that launches a function in playGui.cs and I have tried these variations to find my clientID:
Keep in mind this is all client side, no calls to the server. Surely it is stupid easy and I am missing something here.
How do I get my local client's id? I have a GUI that launches a function in playGui.cs and I have tried these variations to find my clientID:
function calledFunctionFromGUI(%this){
echo("My Client ID: " @ %this);
}function calledFunctionFromGUI(%this){
echo("My Client ID: " @ %this.player);
}function calledFunctionFromGUI(%this){
echo("My Client ID: " @ $player); // did not find this set globally anywhere but what the heck
}function calledFunctionFromGUI(%this){
echo("My Client ID: " @ %this.client);
}Keep in mind this is all client side, no calls to the server. Surely it is stupid easy and I am missing something here.
About the author
#2
I guess I should also note that %this doesn't have a value at all. So %this.getID(); will not work either.
12/12/2004 (5:10 pm)
No I am sure it is something really dumb that I am doing. I guess I should also note that %this doesn't have a value at all. So %this.getID(); will not work either.
#3
If you can't figure it out, you could always just have the server do a commandtoclient to tell the client what his id is, and just store the id in a global.
12/12/2004 (5:17 pm)
I don't think the client knows his own id. If you can't figure it out, you could always just have the server do a commandtoclient to tell the client what his id is, and just store the id in a global.
#5
12/12/2004 (5:24 pm)
Bleh, double posted
Associate Craig Fortune