Respawn player
by Mark Brown · in Torque Game Engine · 05/23/2007 (11:49 am) · 1 replies
A year of frustration from one problem.
Using Torque Game Engine 1.4.2
My avatar freezes!
My project is a randomly generated 3D maze constructed from a huge library of rooms and spare parts. It works very well most of the time.
But... occasionally my avatar freezes. I run the game with the avatar hidden ( camera only ). When frozen, the keyboard and mouse motion commands no longer work (including jump ). The viewing commands work fine. I can spin around in all directions and look up and down.
I recently hooked up a new keyboard command ( using the "u" key ) as follows:
function Unstick(%val)
{
%position = $global_player.getTransform ( );
%position = vectorAdd ( ".2 .2 .75", %position );
$global_player.setTransform ( %position );
}
When stuck, I press the "u" key and it works as expected, that is the avatar/camera rises and moves over slightly. However it is not subject to gravity. Repeated pressing of the "u" key simply causes the avatar/camera to rise steadily up thru the building and into the sky. I still have full viewing control but no motion or gravity.
I want to delete the player and respawn an active player using the slight position shift as above.
How do I kill my player and then spawn a fresh active player???
Using Torque Game Engine 1.4.2
My avatar freezes!
My project is a randomly generated 3D maze constructed from a huge library of rooms and spare parts. It works very well most of the time.
But... occasionally my avatar freezes. I run the game with the avatar hidden ( camera only ). When frozen, the keyboard and mouse motion commands no longer work (including jump ). The viewing commands work fine. I can spin around in all directions and look up and down.
I recently hooked up a new keyboard command ( using the "u" key ) as follows:
function Unstick(%val)
{
%position = $global_player.getTransform ( );
%position = vectorAdd ( ".2 .2 .75", %position );
$global_player.setTransform ( %position );
}
When stuck, I press the "u" key and it works as expected, that is the avatar/camera rises and moves over slightly. However it is not subject to gravity. Repeated pressing of the "u" key simply causes the avatar/camera to rise steadily up thru the building and into the sky. I still have full viewing control but no motion or gravity.
I want to delete the player and respawn an active player using the slight position shift as above.
How do I kill my player and then spawn a fresh active player???
About the author
Torque 3D Owner mb
edit: you also need to make spawn points and a spawn command. This resource shows how to do that for teams, but you can modify it with little effort for what you want. www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=2312