OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Bakab0t on 23 Jan 2017, 03:55:38

Title: How to make cutscenes?
Post by: Bakab0t on 23 Jan 2017, 03:55:38
I have tried camera.sqs but i really cant do it , trying since before christ.
Title: Re: How to make cutscenes?
Post by: h- on 23 Jan 2017, 14:08:22
Have you read this camera tutorial (http://www.ofpec.com/editors-depot/index.php?action=details&id=54&game=OFP), and then this camera.sqs tutorial (http://www.ofpec.com/editors-depot/index.php?action=details&id=50&game=OFP)?
Title: Re: How to make cutscenes?
Post by: Bakab0t on 23 Jan 2017, 18:05:02
i didnt read the first and i finally made it , tx mate i love you. // Oh no , theres a little problem here , i cant end the cutscene, this is the script i'm using :

_cam = "camera" camcreate [0,0,0]
_cam cameraeffect ["internal", "back"]
_cam camsettarget [-95540.45,14445.98,-21978.23]
_cam camSetPos [1595.15,5471.54,2.00]
_cam camcommit 15
~2
titlecut [" ","BLACK OUT",2]
~2
_cam cameraeffect ["terminate", "back"]
camdestroy _cam
titlecut [" ","BLACK IN",2]

exit
Title: Re: How to make cutscenes?
Post by: h- on 24 Jan 2017, 19:52:28
Tested your code and it works just fine for me  :dunno:

How are you executing the code?
Title: Re: How to make cutscenes?
Post by: The-Architect on 03 Feb 2017, 20:14:20
There's a super easy way to make cutscenes. Make a notepad file called "CameraIntro.sqs"

Paste the following into it:

_camera = "camera" camCreate [12108.70,-97532.18,826.72]
_camera cameraEffect ["internal","back"]
titlecut [" ","BLACK IN",2]

Then go into the editor and create a unit. In his init, write "this exec "Camera.sqs"

Preview the mission and you'll be in camera mode. Click the fire button to save an angle. then Alt+Tab out. Ctrl+V in your CameraIntro.sqs just after the Black In bit. That's that bit done.

Then, after your pasted section write "~5"

Then paste the following at the end:

titlecut [" ","BLACK OUT",2]
~3
_camera cameraeffect ["terminate", "back"]
camdestroy _camera
endmissionintro = true
exit

"endmissionintro = true" is the condition you put in an end trigger. That will end the cutscene. Without it everything will stay black.

Your bit of code, pasted from the game might look something like this:

;=== SecondTank
_camera camPrepareTarget frt5
_camera camPreparePos [3544.65,6742.83,0.28]
_camera camPrepareFOV 0.429
_camera camCommitPrepared 0
@camCommitted _camera

You can see I've named the snippet. That's for future reference if I want to change an angle. Usually it displays the time. Also, "camPrepareTarget" has been changed from a selection of numbers to a unit name (a unit that I named). This means the camera will follow it everywhere from the location it has been started.
"camCommitPrepared" is the transistion time. If I want an immediate cut to another angle it stays at 0. If I want a pan, I change it to the amount of seconds I want the pan to take.