problem defining another view and disable the standard cam

Posted By: Darkyyes

problem defining another view and disable the standard cam - 02/16/09 22:11

VIEW* cam1_view =
{
layer = 0;

pos_x = player.x - 210 * cos(player.pan);

pos_y = player.y - 210 * sin(player.pan);

size_x = 1050;

size_y = 1680;

arc = 90;

aspect = 1;

ambient = 100;


flags = SHOW;

}

how to activate this cam in lite-c ? :S when i run the game with this code it doesnt follow my player model as the normal camera function would. and how would i make this view have a tilt?
in fact it wont follow the player at all, its just in the center of the level

I dont know how to do it as you might understand by now, but I dont understand anything about the view_create, etc from the manual, perhaps my knowledge of english language is too weak :|

Code:
camera.x = player.x - 210 * cos(player.pan);

camera.y = player.y - 210 * sin(player.pan); 

camera.z = player.z + 130; 
camera.arc = 90;

//camera.tilt = -10; 
camera.tilt = -10;


//camera.pan = player.pan;
camera.pan = player.pan;


this is the code i try to get into another view.
Posted By: heinekenbottle

Re: problem defining another view and disable the standard cam - 02/17/09 04:28

you are calling arithmetic functions in a view definition. If that even compiles, it won't work. it will make the calculation the moment the view is created and never update.

Rather, you need those two trig functions in a while loop so they consistently update:

Code:
while(1)
{
   cam1_view.pos_x = player.x - 210 * cos(player.pan);
   cam1_view.pos_y = player.y - 210 * sin(player.pan);
   wait(1);
}


The rest of the view definition is fine.
Posted By: Mahdi

Re: problem defining another view and disable the standard cam - 02/17/09 04:43

You should use something like:

cam1_view.visible=ON;

in another function.
Posted By: Darkyyes

Re: problem defining another view and disable the standard cam - 02/17/09 07:28

ok this messes up my point and click movement in so many ways, how do I silence the standard camera function and make only cam1_view audible?

camera.flags &= ~AUDIBLE ?
© 2024 lite-C Forums