Cinematic
TypeAlias of @v12-engine/client
export type Cinematic = (cut: Cut, params?: Record<string, unknown>) => Promise<void>;Cinematics: the camera flown along the map, kept on a unit, clips played on units, lines of dialog, with the HUD out of the way and the player's hands off. A cinematic is a script, an async function given a Cut to stage it with:
const intro: Cinematic = async (cut) => {
await cut.camera({ at: { x: 4, z: 30 }, distance: 20 })
await cut.camera({ at: { x: 60, z: 30 }, yaw: 0.4 }, 6)
await cut.say('td.commander', 'Here they come.')
}
client.play(intro, { hold: true })Every step waits until it is done; steps not waited for go on together. Skipping (Esc) ends every step at once and the script with it. It is the screen's only: the game goes on underneath, or waits (hold) where the simulation runs in the page. What a cinematic changes in the game, it changes with commands like anything else.
params is what the rules hand it when they play it (playCinematic(world, id, { params })), or the view does (client.play(id, { params })): what the screen does not know of itself, like the road of the map being played