Jump to content
Sign in to follow this  
Hoyan

Cutscenes

Recommended Posts

Hi guys, does anyone know how to create cutscenes or point me to a tutorial please?

I have tried taking and editing a script from one of the missions in the campaign which was a cutscene script all I get now is sky, I have tried messing about with the camera angle but still end up with sky. It used to be so much easier in ofp. sad_o.gif

Thanks in advance.

Share this post


Link to post
Share on other sites

I assume you know some basic scripting for OFP/ArmA.

Make a script in your mission folder.

Call it init.sqs

Enter this

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">player exec "camera.sqs"

Start the mission and place the camera where you want it.

W,S,A,D,Q,Z,L (crosshair),SHIFT and Numpad 4,8,6,2,+,- (and V turns of the camera) to control it. Press LEFT MOUSE BUTTON to copy the position of this camera into the clipboard.

Go to your init.sqs and press Ctrl+V to insert that code.

Should look similar to this

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;=== 23:58:35

_camera camPrepareTarget [65260.85,74635.02,-29443.72]

_camera camPreparePos [2535.93,2543.26,11.49]

_camera camPrepareFOV 0.700

_camera camCommitPrepared 0

@camCommitted _camera

Remove the

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">player exec "camera.sqs"

and enter these lines at the top of the script

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_camera = "camera" camcreate [0,0,0]

_camera cameraeffect ["internal", "back"]

Save and preview the mission! There you go!

Share this post


Link to post
Share on other sites

OK. Lets take this a bit further. How about cutting from one camera to another as if the sequence would have shot with multiple cameras at different angles?

Share this post


Link to post
Share on other sites

This is controlled by the line:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_camera camCommitPrepared 0

The number at the end defines how long it should take for the camera to reach it's new position. 0 means instantly.

So this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;=== 23:58:35

_camera camPrepareTarget [65260.85,74635.02,-29443.72]

_camera camPreparePos [2535.93,2543.26,11.49]

_camera camPrepareFOV 0.700

_camera camCommitPrepared 7

@camCommitted _camera

Would make the camera take 7 seconds to get to the new position.

Share this post


Link to post
Share on other sites

That sounds nice and straight forward, thanks.

I'll have a play with this and see what I can do. thumbs-up.gif

Share this post


Link to post
Share on other sites

Ok, but what about the duration of each shot? I do not want camera panning or trucking just an instant cut from camera position to another.

Like:

- 4 seconds close up on a soldier's face

- 5 seconds over the shoulder shot as troops get in a truck

- 9 seconds of wide shot as trucks leave

Ok. Figured it out myself -> just commit same camera values second time with a proper duration. When I want to cut, I just commit camera to a new location instantly. Too simple... biggrin_o.gif

Share this post


Link to post
Share on other sites

Do stop the panning motion leave

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_camera camCommitPrepared

at

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_camera camCommitPrepared 0

The number at the end represents an amount of seconds.

To have time delays, I will use this sample script..

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_camera = "camera" camcreate [0,0,0]

_camera cameraeffect ["internal", "back"]

;=== 23:58:35

_camera camPrepareTarget [65260.85,74635.02,-29443.72]

_camera camPreparePos [2535.93,2543.26,11.49]

_camera camPrepareFOV 0.700

_camera camCommitPrepared 7

@camCommitted _camera

~5

;=== 23:58:35

_camera camPrepareTarget [65260.85,74635.02,-29443.72]

_camera camPreparePos [2535.93,2543.26,11.49]

_camera camPrepareFOV 0.700

_camera camCommitPrepared 7

@camCommitted _camera

~5

The part '~5' is the time delay, so the shot will stay in the posistion for 5 seonds

Share this post


Link to post
Share on other sites

(I hate when you reply simoultaniosly huh.gif)

If you want it to wait after commiting one camera, put in a sleep function.

The number represents the number of seconds to wait before executing next line in script

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">some code

~1

some more code

Example:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;=== 23:58:35

_camera camPrepareTarget [65260.85,74635.02,-29443.72]

_camera camPreparePos [2535.93,2543.26,11.49]

_camera camPrepareFOV 0.700

_camera camCommitPrepared 0

@camCommitted _camera

~3

_camera camPrepareTarget [65260.85,74635.02,-29443.72]

_camera camPreparePos [0,0,0]

_camera camPrepareFOV 0.700

_camera camCommitPrepared 7

@camCommitted _camera

The above code makes the camera go to the initiate position, then wait 3 seconds and then again go to position 0,0,0 in 7 seconds.

The line:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">@camCommitted _camera

Is used to wait for the camera to move... The @ means "Wait for", and is used for lot of different scripts. The line stops execution of the script until the camera has moved into the new position. After this the script will be resumed.

Other examples of @ use:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">guy1 doMove getMarkerPos "marker1"

@unitReady guy1

titleText ["Guy 1 reached marker 1"]

The code above, will make a unit called guy1 move to a marker called marker1. It will then stop executing the script until guy1 is ready (He won't be ready before he have completed his objective, which was to move to marker1). When he is ready, execution of script will continue.

Btw, if you want to destroy the camera (to make the player be able to control again) execute this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_camera = "camera" camcreate [0,0,0]

_camera cameraeffect ["internal", "back"]

Hope some of this were understandable!

Share this post


Link to post
Share on other sites

This is all great stuff, I wasted 2 hours last night getting nowhere, five mins after seeing your relpy's and I am getting on with it. Thx.

Share this post


Link to post
Share on other sites

Is there anything you can do to stop the camera from travelling through buildings? Other than plotting it's path so it avoids them of course! smile_o.gif

Share this post


Link to post
Share on other sites
Quote[/b] ]Is there anything you can do to stop the camera from travelling through buildings? Other than plotting it's path so it avoids them of course!

Plot it's path so it avoids them of course smile_o.gif

Share this post


Link to post
Share on other sites

Btw, if you want to destroy the camera (to make the player be able to control again) execute this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_camera = "camera" camcreate [0,0,0]

_camera cameraeffect ["internal", "back"]

the end camera code should be

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_camera cameraeffect ["terminate", "back"]

camdestroy _camera

Share this post


Link to post
Share on other sites

Yeah.. Thnx Ziggy... Forgot to change the "internal" to "terminate" before posting... :P

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×