By savedbygrace
Now we reach the Segment which deals with technical code for weaving your magic.
First of all SQS format is still the preferred scripting syntax in which to build a camera script (I'm not certain that SQF code has supporting commands for camera functions) So with this clear we must first create the canvas for what will be the foundation of our camera script. I truly recommend the use of the built in camera.sqs program offered by the games editor. (I will make referrence to it in this tutorial)
You do this by opening notepad and before anything else, you save it as camerascript.sqs. camerascript can of course be whatever you would like to name your script but you must add the .sqs to the end of it. Make sure you save it to your mission folder.
We are now ready to create the camera.
_camera = "camera" camCreate [0,0,0]
_camera cameraEffect ["INTERNAL","BACK"]
Name | Position |
Internal | Top |
External | Left |
Fixed | Right |
Fixed with zoom | Front |
Back |
TitleCut["","BLACK IN",2]
Transition Type | Definition |
PLAIN | Prints text in center of screen |
PLAIN DOWN | Prints text at bottom center of screen |
BLACK | Fades screen slowly from normal to black |
BLACK FADED | Instantly switches screen to black (no mistake here) |
BLACK OUT | Screen fades from normal to black in 2 seconds |
BLACK IN | Screen fades from black to normal in 2 seconds |
WHITE OUT | Screen fades from normal to white in 2 seconds |
WHITE IN | Screen fades from white to normal in 2 seconds |
There are 3 commands by which to print text on the screen...
TitleCut | TitleText | CutText |
TitleCut has been noted as obsolete in the COMREF but still functions as it should
CutText is identical to TitleCut and so serves at it's replacement. Therefore we will only discuss CutText & TitleText further.
TitleText is similar to CutText but with some noteworthy differences.
For Example...
If this were printed just before the cutscene script exited, it would disappear when the camera view was returned to the player.
CutText ["The End","plain"] If this were printed just before the cutscene script exited, the text would still be visible after the camera view is handed back to the player.
TitleText ["The End","plain"]
For Example...
TitleText ["This sentence will be printed first","plain"]~3
TitleText ["This sentence will be printed second","plain"]
The above code would print the first sentence and then 3 seconds later, replace it with the second sentence. The same would occur with the Cuttext command.
Titletext ["This sentence will be printed first","plain"]~3
CutText ["This sentence will be printed second","plain"]
The above code would print the first sentence and then 3 seconds later, print the second sentence on the same line without removing the existing text. Although this is obviously not what you would want to achieve, this occurence has its advantages. By implementing the "\n" (break) code, you can get creative with your text.
For Example...
CutText ["Written and Produced by","plain"]~3
TitleText ["\nThe Staff at OFPEC","plain"]
The above code would print the first sentence and then 3 seconds later, print the second one right below it without removing the first sentence. If you were to repeat the same command while using the break code, it would still replace the existing text.
The time duration of the text printed by both commands is 20 seconds wether inside or outside the cutscene. To shorten the display time of the text for either command you will have to repeat the command with empty text quotes.
For Example...
TitleText ["Monday morning 1400 hours","plain"]~3
TitleText ["","plain"]
The code above will display the first sentence and 3 seconds later, the text will disappear.
We have created the camera, added the effect, and transitioning. We now must place the camera where we need it to start. The best and most precise way to do this is by using the camera.sqs program within the editor. Within the editor, once you have your mission loaded, create a trigger set to repeated radio. Type in the OnActivation field "player exec "camera.sqs". Review the mission and then activate the radio. you are now inside the eye of the camera. Basic movement is similar to in game unit control but most importantly, the capture screen button is your "Fire" button. Move the camera into a position you want and then press the "Fire" button. You then Alt Tab back to desktop, navigate to your camera script and press Cntrl + V to paste it into the document. You should now see something similar to the code below.
;=== 23:17:01_camera camPrepareTarget [-86735.77,8551.40,19.14]
_camera camPreparePos [13263.63,8848.29,3.56]
_camera camPrepareFOV 0.700
_camera camCommitPrepared 0
@camCommitted _camera
By not using any time delay codes between camera creation and this first position, we have created an instant transition from normal game view to the camera script. We can now either pause the script or place another position for which to allow the camera to move to.
WORK IN PROGRESS 12-7-08