Game Development Community

My player is stuck

by Mark Brown · in Torque Game Engine · 11/20/2007 (7:31 am) · 4 replies

I have upgraded to TGE 1.5, but I still have a recurring problem for over a year. My player occasionally gets stuck and will not move. He can look all about, but is frozen to one spot. I implemented a bit of code to get him unstuck and mapped it to the "U" key:

function Unstick(%val)
{
%position = $global_player.getTransform ( );
%position = vectorAdd ( ".2 .2 .75", %position );
$global_player.setTransform ( %position );
}

This works and moves the player up and slightly away from his prior x,y position, but the player still has no motion and is not subject to gravity. The game scene is a 3D maze building. Repeated pressing of the "U" key causes the player to continue up through ceilings and floors and finally into the sky while still being able to look about in all directions.

How to I bring him back to life and subject once again to gravity and motion?
Do I have to remove him and respawn him, and if so, how?

#2
11/21/2007 (1:47 pm)
I have been working on the program for over a year. The main program generates a random maze, ( 3 X 3 X 3 or 4 X 4 X 4 or 5 X 5 X 5 etc. ) It then creates a mission.mis document. The rooms are selected from a library of close to 1,000 rooms. If a suitable room can not be found, it creates the room from spare parts, ( walls, doors, windows, step/stairs, paintings, furniture, etc. ). The player is randomly spawned in one of the rooms. His goal is to find his way to the only ground floor exit in the building. There is also a single exit to the roof, ( water towers, vents, etc. ) but this is not a solution as you can not jump off the roof.
The game plays fine most of the time, but every 100 plays or so, the player gets stuck.
#3
11/21/2007 (2:04 pm)
Are you using dts objects for your maze with polysoup collisions? I know from some tests that I did that the polysoup code will do this. The player actually get's "cemented" to the object, but if moved off, it moves about just fine.
#4
11/24/2007 (6:23 am)
All of the rooms and room parts are ".dif" files. Some objects in the room may be ".dts" but they are not causing a problem.