Skip to content

CutDefs beta ​

Class of @v12-engine/client

ts
export declare class CutDefs

What a cut plays of cinematics as data (cut.defs): the defs playing on the cut's clock (play), their markers, sections, cues and loops, and playing them again from a time when the clock is seeked. The cut's play, section, seekTo, cue and the rest are this, under the names the docs give them

Members ​

constructor ​

ts
constructor(cut: Cut, 
    known: {
        names: Record<string, number>;
        refs: Map<string, RefDef>;
    });

Constructs a new instance of the CutDefs class

at ​

ts
at(marker: string): number | undefined;

The time of the cut a marker of a def played is at, or nothing for a name no def played has

cue ​

ts
cue(name: string, params?: Record<string, unknown>): void;

Cues the cinematic: what waits for the cue goes on (untilCue), and its hooks run (cue:<name>). A cue nothing waits for is kept for the next wait of its name

end ​

ts
end(): void;

Ends the defs playing as if they had reached their end: a branch that goes to the end

letGo ​

ts
letGo(replay: (from: number) => void): void;

A def let go of: a seek no longer plays it

over ​

ts
over(ending: number, replay: (from: number) => void): void;

A def over: a seek no longer plays it, and end no longer goes to its end

placed ​

ts
placed(def: CinematicDef, began: number, ending: number, replay: (from: number) => void): void;

A def begun at began on the cut's clock, ending at ending: its markers and sections, and its replay

play ​

ts
play(cinematic: CinematicDef | string, options?: {
        units?: Record<string, number>;
        at?: number;
    }): CutStep;

Plays a cinematic as data (CinematicDef, or one of the game's by its id) on the cut's time, and settles when it is over (see Cut.play)

replay ​

ts
replay(time: number): void;

Plays every def playing again from the cut's time: what a seek of the clock does

section ​

ts
section(name: string): Promise<void>;

Plays a section of the defs playing (D3): from its marker (kind: 'section') to the next section's, or the end; settles when the clock gets there. The defs play on after it unless the script does otherwise

seekTo ​

ts
seekTo(marker: string): boolean;

Jumps to a marker of a def played (see Cut.seek). Whether there is one by that name

unlooped ​

ts
unlooped: boolean;

Whether the loops of the defs playing are ended (endLoop): they play on to their ends

untilCue ​

ts
untilCue(name: string, seconds?: number): Promise<void>;

Waits for a cue, or seconds at most: one heard before that nothing waited for ends it at once

untilMarker ​

ts
untilMarker(name: string): Promise<void>;

Waits until the time reaches a marker of a def playing (its hook marker:<name>): at once for one already passed. A def played after the wait began counts: its marker is heard when it is reached