Game Development Community

Random Path Camera

by Shez · in Technical Issues · 09/12/2005 (10:09 pm) · 0 replies

I have done a few camera paths thanks to David's jumpToPath (http://www.garagegames.com/mg/forums/result.thread.php?qt=22754) and got everything running. Now im trying to randomize the paths so the camera would start in multiple ways. I was thinking in the lines of - >

function GameConnection::onClientEnterGame(%this)
{
commandToClient(%this, 'SyncClock', $Sim::Time - $Game::StartTime);
echo("debug - camera path initialized 1");

%this.camera = new PathCamera() {
dataBlock = LoopingCam;

position = "267.727 163.163 8.85";
};

MissionCleanup.add( %this.camera );
%this.setControlObject(%this.camera);
%this.camera.scopeToClient(%this);


%this.camera.reset(0);

Rand between 1 - 3
if Rand = 1 {
%this.camera.followPath(CameraPathOne);
}

if Rand = 2{
%this.camera.followPath(CameraPathTwo);
}

if Rand = 3 {
%this.camera.followPath(CameraPathTwo);
}


%this.score = 0;


//this.spawnPlayer();
}

Am i doing this rite?