]>
Cut-scenes can make a big difference to the professionalism of a mission. But they can also be annoying. Don't have them too long, they are fine the first time you watch it, but just get tedious after that. Also make sure all your units are safe before running it. The last thing you want is to have your troops running into battle when a cut-scene kicks in and you find yourself dead 20 seconds later.
You will need to create a script file for a cut-scene, as it requires a fair few lines of code. Put a suitably named .sqs file into your mission directory and open it in a text editor.
Here is an example of a simple camera script:
# init _cam = "camera" camcreate [0,0,0] _cam cameraeffect ["internal", "back"] # Target first object and position _cam camsettarget myunit _cam camsetrelpos [20,0,10] _cam camcommit 0 @camcommitted _cam ~5 # Target new object and move _cam camsettarget anotherunit _cam camsetrelpos [-40,50,60] _cam camcommit 15 @camcommitted _cam ~5 _cam cameraeffect ["terminate","back"] camdestroy _cam exit
Seems a bit confusing at first, but here is the break down of what is happening. From this you can figure out what to do to make your own cut-scenes.
_cam = "camera" camcreate [0,0,0] _cam cameraeffect ["internal", "back"]
This creates the camera, the effect can be one of a whole load, this one works, use it. You need this at the beginning of your script to create the camera to use etc.
_cam camsettarget myunit _cam camsetrelpos [20,0,10] _cam camcommit 0 @camcommitted _cam ~5
This positions the camera by the first object. The first line makes the camera look at the unit called 'myunit'. The second line is where your artistic talent (license?) will come into play. This is where the camera will move to relative to the unit.
Presume you have a bird's eye view of your unit. The entries [20,0,10] are 3D grid references, so to speak. The first one is the X plane. This is a line through your soldiers eyes. Setting it to 20 will put the camera 20 metres in front of the unit. Setting it to -100 will put it 100 metres behind. The second figure is the Y plane. This goes across the breadth of your unit. Setting it to 50 will put it 50 metres to the unit's right hand side; -50 to the left. The final figure is your Z plane, or up and down. Positive for above, negative for below.
The next line camcommit tells the camera to move to this position in the defined number of seconds. You will want the first one you do set to 0 otherwise you will have a camera floating around from where it was originally created.
The next bit has an @ sign, indicating that the script will pause until the camera has been committed and has arrived at it's destination. The tilid ~5 will cause the entire script to pause for 5 seconds. Resulting in the camera sitting where it is for 5 seconds before executing the next part.
You can add as many movements as you want, to get something to scroll around something you really need to create a movement to each side of the object.
_cam cameraeffect ["terminate","back"] camdestroy _cam exit
The last bit turns off the camera, clears out the variables, and finishes the script allowing you to continue with the game.
There not too difficult hey?