Temporarily removing control of player
by Thomas \"Man of Ice\" Lund · in Torque Game Engine · 04/22/2004 (2:03 pm) · 4 replies
I'm trying to temporarily removing a player from the game until he clicked a button on a dialog (death situation).
I've given up on removing him from the simulation using setHidden() as it crashes the engine. If anyone know a solution to that one, please reply with the solution ;-)
So now I respawn the player, but would like to remove control until he presses the "Let me back into the game" button.
So I write this on death
%obj.client.setControlObject(0);
and when pressing the button, the client sends a message to the server where I then
%obj.client.setControlObject(%obj.client.player);
My problem is, that control is not removed. While my dialog is up I can still move the player.
Any hints?
I've given up on removing him from the simulation using setHidden() as it crashes the engine. If anyone know a solution to that one, please reply with the solution ;-)
So now I respawn the player, but would like to remove control until he presses the "Let me back into the game" button.
So I write this on death
%obj.client.setControlObject(0);
and when pressing the button, the client sends a message to the server where I then
%obj.client.setControlObject(%obj.client.player);
My problem is, that control is not removed. While my dialog is up I can still move the player.
Any hints?
#3
Setting the control object to the camera works. I still cant %player.setHidden(true); without a crash (after setting the control to the camera), but at least the control is gone until I return it.
Looking through the engine sources its not possible from script to set the control object to null.
04/23/2004 (12:56 am)
ThanksSetting the control object to the camera works. I still cant %player.setHidden(true); without a crash (after setting the control to the camera), but at least the control is gone until I return it.
Looking through the engine sources its not possible from script to set the control object to null.
#4
04/26/2004 (2:59 pm)
Or better yet push and pop the keybinds
Torque Owner Badguy
you might wanna check thru the setControlObject code see if it allows you to set it null.
my first thought would be that somewhere it has checked your value and since it is no good it is not actually set.