CinematicStage beta
Interface of @v12-engine/client
export interface CinematicStageThe rest of what a cinematic is played on, each part said: what a stage lacks is a type error where the stage is made, not a step that silently does nothing. A part a stage has none of by design is given as nullCinematicStage gives it: a function that says once in the log that it was asked for and is left out, or null for a part the cut goes without in its own way (no screen: a fade is the stage's fade; no dialog queue: lines are the stage's say)
Members
audio
readonly audio: StageAudio | null;The client's sounds, for a cinematic's music, stingers, sounds and volumes (D1). Null on a stage that has none
choice
readonly choice: {
show(menu: ChoiceMenu, pick: (id: string) => void): () => void;
} | null;Shows a choice's menu (C3) until what it gives back is called; pick is the answer the player picked (a click on it). Null on a stage that shows none: code picks (cut.pick), or the keys do
cinematic
cinematic(id: string): CinematicDef | undefined;A cinematic of the game's as data, by its id (GameView.cinematics.defs, the entry's def), or nothing
dialog
readonly dialog: DialogQueue | null;The dialog said to the player (client.dialog): the lines of the cinematic go into its queue with the rules', in one box. Null on a stage without one: its lines are shown by say
direct
direct?(command: Record<string, unknown>): void;Sends a director's command for the cinematic playing (director): where the cinematic holds the game, it is moved on a tick so that the command lands at once
directing
directing?(cinematic: string, playing: boolean): void;Says to the rules that a cinematic began or ended on this screen (cinematicPlaying), where the game has a director
directs
directs?(): boolean;Whether the game takes a director's commands (directorPack, campaign plan CI1): the units lane puts down, kills, moves and orders anyone's units through them. None where the stage has no game
eases
readonly eases: EaseRegistry;The eases a key or a shot may name (kit.eases): the client's own and the game's
entities
entities(): readonly CutEntity[];The entities the screen sees now (A5's queries, cut.state): what, whose, where
env
readonly env: StageEnv | null;The hour the screen draws and the map's look on it (B6). Null on a stage that draws no world
fade
fade(opacity: number, seconds: number): void;Blacks the screen out, to opacity (0 clear, 1 black) over seconds, where the stage has no screen of its own
flash
flash(id: number, color: Rgb, seconds?: number): void;Flashes an entity's model in a colour for so many seconds
fx
fx(name: string, options: FxPlay): FxHandle | undefined;Plays an effect of the game's (client.fx.play), or nothing where there are none
hide
hide(id: number, hidden: boolean): void;Hides an entity's model or shows it again
hud
readonly hud: {
kept(): HudWidget[];
keep(parts: readonly HudWidget[]): void;
} | null;The parts of the HUD kept while a cinematic plays (B6): those kept now, and keeping others. Null on a stage with no HUD
ink
ink(id: number, look: InkLook | null): void;Draws an entity's model with an ink look (an outline or a flat colour), or back as it was with null
lanes
readonly lanes: LaneRegistry;The lanes known here (kit.lanes): the client's own and the game's
marks
marks?(id: number, listener: (mark: string, clip: string) => void): () => void;Tells each mark of the clips an entity's model plays as it is reached (hit of a swing), until the returned function is called: a fight's flash and kill are linked to the blow by it (UnitDoing.fight). None on a stage that draws no models: a fight takes its seconds for the blow
named
named(name: string): number | undefined;The entity a unit placed on the map was named in the editor, where the screen can know it
onEvent
onEvent(listener: (event: SessionEvent) => void): () => void;Hears the game's events as they come (D2's waits on one). Gives back what stops hearing
onInput
onInput(listener: (input: CutInput) => void): () => void;Hears a key or a click while the player's hands are off (D2's waits). Gives back what stops hearing
path
path(name: string): readonly Vec2[] | undefined;The points of a path of the map by its name (MapPath: a road), for a camera on a rail; nothing when it has none
picture
readonly picture: StagePicture | null;The picture as the renderer finishes it (WorldPicture), for the cinematic's say over it (B5): null on a stage that finishes none
ping
ping(at: Vec2, color?: string): void;A ping on the minimap at a spot, in a colour (B6)
preload
preload(def: CinematicDef): Promise<void>;Loads ahead what a cinematic needs: its models, sounds and voices, and those of what it includes (D3)
prop
prop(model: ModelDef | string, at: Vec2, options: {
facing?: number;
scale?: number;
clip?: string;
loop?: boolean;
}): Promise<(Omit<CutProp, 'remove'> & {
remove(): void;
}) | undefined>;A model placed for a cinematic alone (B6): a ModelDef, or a unit type's model by the type; once loaded
region
region(name: string): Vec2 | undefined;The middle of a region of the map by its name, for a { region } ref
releaseClip
releaseClip(id: number): void;Lets go of a clip an entity plays over and over (kit.releaseClip)
say
say(speaker: string, text: string, waits?: boolean): () => void;Shows a line of dialog by a speaker of the view, in their voice, where the stage has no dialog of its own. Returns what takes it away. waits: it stays until it is moved on (Enter, or a click), and says so
screen
readonly screen: {
get(): ScreenState;
set(state: Partial<ScreenState>): void;
reset(): void;
} | null;The screen as the renderer draws it (ScreenPass): the bars, a fade, a vignette, a tint, an overlay, a crop, a blur, as values set whole or in parts and read back. Null on a stage that has no screen: a fade is its fade
send
send(command: PlayerCommand): void;Sends a command as the player, for the lanes that ask the game for something (an order): it lands at the next tick
stopClip
stopClip(id: number): void;Stops the clip an entity plays on demand, once or over and over (kit.stopClip)
swing
swing?(id: number): number | undefined;Seconds its attack clip takes at normal speed (0 where that is not known yet) when the model an entity is drawn with marks the blow (a hit mark): a fight links its kill to the blow by it. Nothing where the model has no such mark
time
readonly time: StageTime | null;The game's speed and the animations' rate, for slow motion (B6). Null on a stage that has no game
tint
tint(id: number, color: Rgb | null): void;Tints an entity's model with a colour, or takes the tint off with null
track
track(name: string): CinematicTrack | undefined;A track of the game's by its name (GameView.tracks), or nothing
transition
readonly transition: {
begin(def: TransitionDef, options: TransitionOptions, at?: () => Vec2 | undefined): void;
set(t: number, elapsed?: number): void;
end(): void;
} | null;The renderer's transition between shots (TransitionPass): begin keeps the last frame and starts one, set moves it along (0 to 1), end lets go. Null on a stage that draws none: a cut there is a hard one
transitions
readonly transitions: TransitionRegistry;The transitions a cut may name (client.transitions): the client's own and the game's
ui
readonly ui: StageUi | null;Where a cinematic's own interface goes (C4): over the picture, over everything, pinned in the world. Null on a stage with none
units
units(who: 'me' | 'enemy' | 'everyone'): number[];The units of a side as the screen sees them now: the player's own, their enemies', or everyone's
videos
readonly videos: StageVideos | null;Where a video is drawn into the picture (CI4: the video lane's picture layer), under the screen's pass. Null on a stage that draws none: a video goes on its page (ui)
videoUrl
videoUrl(path: string): string | undefined;Where a video of the game's files is (the video lane's), by its path in videos/ (intro.mp4): the map's own first, the game's, the shared ones; an address as it is. Nothing on a stage with no files
view
view(name: string): CameraPose | undefined;A view of the map saved under a name in the editor (MapCamera), or nothing when it has none by that name
words
words(text: MessageRef): string;The words of a message of the game's (MessageRef: a key and its params), as the player reads them
world
world: CutWorld | null;What the waits tied to the world read ({ arrived }, { dead }, { inRange }, a sequence's orders): the session's snapshots in a game, cutWorldOf makes one. Null on a stage with no world: they are taken to have come