Game Development Community

How can I change camera view in runtime

by Kevin Yu · in Technical Issues · 04/22/2007 (11:29 pm) · 1 replies

Hi,

I'm working on multi cam stuff these days. I have made 2 cam modes, one is the default cam view of TGE, cam's on player's shoulder, follows the player. Defined in GameConnection::onClientEnterGame like:

$FollowCamera = new Camera() {
dataBlock = Observer;
gui = "CameraGUI";
};

And another is like TSE demo, fixed view, 5 cams are defined, use GUI or accerate key to shift cams. In GameConnection::onClientEnterGame it looks like:

%this.player = new PathCamera() {
dataBlock = LoopingCam;
position = "108.9891 -244.86 193.615";
gui = "SceneGUI";
};

// Start up the room gui system
$Server::Client = %this;
%this.setControlObject(%this.player);
SceneGui.setSceneNumber(0);


And my problem is, I can make any of these two cam modes works fine IF I define it in GameConnection::onClientEnterGame. That means you will use that cam mode as your default cam.
But what I need is to make these two cam modes both in my game, and I can use accerate key to shift the cam mode. (observer mode as default mode, press a key to shift to fixed view)

Is there any way to make this happed?

Thank you guys.

Kevin.Yu

#1
04/28/2007 (4:53 pm)
I dont understand why you cant put it into a new script file and on "keypress" .... Ex:
function Newcam(%val)
{
$Newcam = %val;
//This Line add your Camera statements.
//
//
}


moveMap.bind(keyboard, F3, Newcam );