setCinematicCamera
Client
Sets the camera shots the cinematic directs during playback. It replaces the earlier shots.
bool setCinematicCamera(cinematic cinematic, table shots)
Parameters
| Name | Type | Description |
|---|---|---|
| cinematic | cinematic | The cinematic. |
| shots | table | A list of shots, in order of start. An empty list takes the camera out of the cinematic. |
Returns
true if they were applied. false if the table is invalid, with a warning saying why.
Common shot fields
Times are cinematic time, in ms. Each shot starts once the one before has stopped:
start: when it comes in (required).blend: ms to blend from the shot before.0is a cut.stop: when it stops. Without it, it runs until the next shot; once stopped, the camera holds its last view.shake: shake in metres,0by default.shakeSpeed: its frequency in Hz,12by default.letterbox:trueshows SA's widescreen borders during the shot.
Path shots
A path shot defines keys (a list of keyframes in time order):
time: keyframe time in ms (required).positionandtarget:vec3coordinates (required).roll: roll angle in degrees (0by default).fov: field of view in degrees, above0and below180(70by default).smooth:truefollows SA's cutscene curve;falsegoes straight to the next key.ease: easing to the next key —"linear"(default),"inQuad","outQuad","inOutQuad","inCubic","outCubic"or"inOutCubic".
Actor-following shots
A shot that follows an actor defines:
Example
local intro = createCinematic("cinematics/intro.cine")
setCinematicCamera(intro, {
{
start = 0,
letterbox = true,
keys = {
{ time = 0, position = vec3(2480, -1700, 30), target = vec3(2495, -1680, 14) },
{ time = 6000, position = vec3(2500, -1700, 20), target = vec3(2495, -1680, 14), ease = "inOutQuad" },
},
},
{ start = 6000, blend = 1000, actor = "hero", offset = vec3(0, -4, 1.5), lookAtActor = "hero" },
})