Game Development Community

Starting Game with Camera View, not Player

by Infinitum3D · in Torque Game Engine · 02/24/2007 (1:59 am) · 2 replies

Does anybody have a simple fix for a newbie?

I want to have a square gameboard, with four cameras, one on each side. I want the game to load with the starting view from a camera, not a spawned player.

Is it as simple as "Don't exec the player.cs"?

Thanks!

Tony

#1
02/24/2007 (4:41 am)
Its almost as simple as dont exec the player.cs.
In starter.fps/server/scripts/game.cs in function GameConnection::onClientEnterGame, around line 218 you see the line
%this.spawnPlayer();
comment that line out (or remove it) so it looks like :
//%this.spawnPlayer();

now below that add
%this.camera.setTransform( pickSpawnPoint() );

that should work, but it with this (almost default) method 2 or more players could have their cameras spawned on the same spawnpoint.
#2
02/24/2007 (8:06 am)
If it's a simple 2 player game, name your spawn points "spawn1" and "spawn2" and put an "if" statement in there checking if spawn1 is occupied. If it is, player spawns in at spawn2, if both are occupied, then give them a message stating the game is full or make them an observer.