My set up is as follows...walk into an area and trigger the door closing behind you. Continue forward and trigger a camera that swings around the room in a circle looking towards the closed door then around to a pit from which a monster will rise. All of this I have managed. What I cant do is get the monster to rise out of the pit before the player returns to first person mode. I would really like the monster to be raised up (and another event I havent scripted yet) before returning to first person view.
My script for raising the boss:
Code: Select all
// Raise and move boss platform //
void move_boss_one()
{
sys.threadname("move_boss_one");
sys.wait(10);
$boss_platform.time(8);
$boss_platform.moveTo($boss_move_1);
sys.waitFor($boss_platform);
$boss_platform.time(6);
$boss_platform.moveTo($boss_move_2);
sys.waitFor($boss_platform);
$boss_platform.remove();
}
Code: Select all
void start_camera_spline()
{
$anchor.time(20);
$anchor.accelTime(.5);
$anchor.decelTime(5);
$anchor.disableSplineAngles(); //You need to add this when aiming a moving camera.
$anchor.startSpline($camera_spline);
}
//This is the new aiming script:
void update_camera()
{
sys.threadname("aim_loop"); // Gives this thread the name "aim_loop" so it can be killed later.
while (1)
{
//This triggers the target_setkeyvall which in turn adds a key/val pair to the func_cameraview:
sys.trigger($target_setkeyval_1);
sys.waitFrame(); //This waits for the next frame before continuing
}
}
void camera_script()
{
thread move_boss_one();//my attempt at calling boss platform
sys.setCamera($func_cameraview_1);
start_camera_spline();
thread update_camera(); // This calls the function update_camera as a thread so it
// runs in the background.
sys.waitFor($anchor); // This halts execution until anchor finishes it's movement.
sys.killthread("aim_loop"); // This kills the thread "aim_loop"
sys.firstPerson(); //Turn off the camera and switch back to normal
}
Many thanks fo any assistance.