CUTSCENE TUTORIAL 3
AUTHOR: KENGO
DATE: 25/11/02
In tutorial 2 we managed to create a very basic cutscene with a static camera staying in position for a few seconds. As strange as this may sound, that really is the hardest part, once you get it working for the first time, you can experiment and improve. In this tutorial we'll be looking at having the camera move between a number of locations, and at zooming.

First open up Radiant and BehavEd, opening up the map you created in tutorial 2 and the script
cin1 also from tutorial 2.

In Radiant create another 2 ref_tags, each connected to an info_null. You can just clone the ref_tag connected to an info_null already present twice (press spacebar in Radiant to clone) and then alter the targernames of the two new ref_tags. Call them
cam2 and cam3 respectively. Make sure cam2 and cam3 are each pointing at an info_null That's all you need to do in Radiant for this tutorial. Compile the map.





































































Now onto the BehavEd scripting.

For every ref_tag (camera) there should be at least two camera commands, one a MOVE, one a PAN. Clone the MOVE and PAN commands for cam1, then rename $tag("cam1",ORIGIN)$,0) to $tag("cam2",ORIGIN)$,0), and $tag("cam1",ANGLES)$,< 0 0 0 >,0 ) to  $tag("cam2",ANGLES)$,< 0 0 0 >,0 ). Then clone the MOVE and PAN commands for cam1 again and this tim rename  $tag("cam1",ORIGIN)$,0) to $tag("cam3",ORIGIN)$,0) and $tag("cam1",ANGLES)$,< 0 0 0 >,0 ) to $tag("cam3",ANGLES)$,< 0 0 0 >,0 ). The MOVE and PAN commands should be kept one after the other to avoid problems, and each pair of these camera commands should be seperated by a wait command. Just leave the wait commands as the default 1000 for now. You should now have a script looking like the picture below:














































If we ran the script like this then because the time to reach each cameras
ORIGIN is 0 the camera would start at cam1, wait for 8 seconds, switch immediately to cam3, wait for 1 second, switch immediately to cam3, wait for 1 second, then camera mode would end. If you want the camera to switch instantly to a new position this is what you do, have a 0 time for the MOVE command. However, if you want the camera to move smoothly between a number of locations, then you have to have a time for each MOVE command. If we keep the MOVE time for cam1 at 0, as we want the camera to begin there instantly, but set the MOVE time of cam2 as 5000 and cam3 as 5000 as well. However, if we compiled this script and tried to run it, it wouldn't work properly. The camera would start at cam1, start to move to cam2 then move back to point 1, then try to move to cam3 then move back to cam1, or something along these lines. The reason? The wait command following each set of MOVE and ANGLE commands has to be as long or longer than the time for the MOVE command. So as the MOVE command for cam2 is 5000, we will set the wait command after the commands for cam2 to 7000. We will then set the wait command after the camera commands for cam3 to 8000. This will mean that the camera will begin at cam1, wait for 8 seconds, move to cam2 over a period of 5 seconds, then wait for 2 seconds, then move to the position of cam3 over 5 seconds then wait for 3 seconds.

However, to ensure that the camera alter the direction it is facing as it moves, not abruptly in one go, we should set the time for the PAN command to the same as for the MOVE command for the same camera. So for cam2 the MOVE command time is 5000, if we set the PAN command time to 5000 too then the camera will slowly change it's direction as it moves, rather than altering to face the direction of cam2 before moving towards that position. We can set the PAN time for cam3 to 5000 to match the MOVE time for cam3. If the ANGLE command is less then the MOVE command for the same camera then the camera will reach the direction it is facing at the ref_tag before it actually reaches the ref tag, if the ANGLE command is more than the move command for the same camera then the camera will reach the ref_tag then will reach the angle the ref_tag is facing afterwards. Whichever out of the MOVE or PAN command is longest, the wait time after it must be as long or longer or the script will not run properly. The script should now look as in the picture below:


















































Now to add the zoom command. Doublr click on the camera symbol to the left of the program to create another camera command in the Script Flow area. Drag this command to just after the 8000 wait after the cam3 camera commands. Double click on the command to bring up the Event editor. Select
ZOOM from the drop down menu. The middle box is the amount of zoom, as it tells you in the box, 80 is the normal level of zoom, 10 is very zoomed in, 120 is the maximum you can zoom out. The box to the right is concerned with the amount of time it takes to do the zoom. In the middle box select 30, which is zoomed in quite a lot, and in the right hand box select 8000, which means the zoom will take 8 seconds to complete. As with MOVE and PAN cammera cmmands, there must be a wait command after the ZOOM command that is at least as long or longer than the amount of time the ZOOM takes, otherwise it will not work properly. So add a wait command of 9000 after the ZOOM camera command. The final script should then look like this:


















































To recap the above script should: Start at cam1, wait there for 8 seconds before moving to cam 2 over a period of 5 seconds, with the camera altering its facing as it moves. The camera waits at cam2 for 2 seconds before moving to cam3 over a period of 5 seconds, with the camera altering it's facing as it moves. The camera waits at cam3 for 3 seconds before zooming in to 30 over a period of 8 seconds. The camera then pauses for 1 second (remaining in the zoomed in state) before the camera mode ends.

Now compile the script, and run the map (my name for the mapiwas cutscene1). If you have any problems with this tutorial please re-check you steps, and make sure you have completed everything in tutorials 1 and 2 successfuly. If you cannot get the cutscene to work after doing this then please feel free to
email me
1