Game Development Community

Are you experienced with torque's load game process?

by Matthew W · in Torque Game Engine · 05/01/2008 (7:25 pm) · 3 replies

Our game torqueDemo.exe has been set up with the AdvancedCamera observer camera, focused on a torque logo, movable while holding down the right mouse button. Clicking the terrain with the left mouse button causes the player to move toward that spot. This works!

For some reason, after we added our startup GUIs and 3DS-Max objects, the camera starts in first-person as the player falls to the ground. Why does this happen? Even odder is that we found, after commenting out the line
createServer("SinglePlayer", expandFilename("./data/missions/flat.mis"));
from loadMyMission in the tutorial.base main.cs file, that it starts in observer mode like we want. However it freezes before LOADING MISSION and you have to press F11 to unfreeze it.. and then it works how we want it to. How can we fix this?

#1
05/01/2008 (9:12 pm)
Check out the game.cs file. As I remember that's where it spawns the player and sets the control object. If there's a player spawned and no spawnsphere the player is created at XYZ "0 0 30" - 30 metres in the air. Try editing that.
#2
05/01/2008 (9:17 pm)
Use DropCameraAtPlayer() server-side function.

example:
add this function in "server/scripts/game.cs"
function GameConnection::createPlayer(%this, %spawnPoint) 
{
   . . .
   . . .
   . . .
   // Give the client control of the player
   %this.player = %player;
   %this.setControlObject(%player);


   [b]DropCameraAtPlayer( %this );[/b]
}
#3
05/02/2008 (9:20 am)
@Mquaker

THANK YOU SO MUCH!! You must be a genius. :D