Skip to content

CampaignDef beta ​

Interface of @v12-engine/client/app

ts
export interface CampaignDef<D extends object = Record<string, unknown>>

A campaign: missions played one after the other, the heroes carried from one to the next, and what else each mission carries (MissionDef.carry) kept as its own data, of the type D

Members ​

chapters ​

ts
chapters?: CampaignChapter[];

Its missions in chapters, as its menu shows them, each with a heading and a picture: one list when left out

debug ​

ts
debug?: boolean;

Whether its missions have the debug tools (the debug panel, cheats): while the app is being developed, when left out (ClientRuntime.dev)

difficulties ​

ts
difficulties?: string[];

The difficulties the player chooses from in its menu, by name: the engine's (easy, normal, hard, insane) or the game's own (Rules.ai.difficulties). Easy, normal and hard when left out; normal (or the first) until one is chosen. Kept with the progress, and given to each mission (MissionContext.difficulty) and its computers

game ​

ts
game: Game<unknown> | LoadedGame;

The game (createGame) its missions are played by: its rules, and its view, fetched as its menu opens (Game.view(() => import('./view')): its looks and the client that draws them are not part of the start screen's code), a mission's code on its way while the player chooses. Or one loaded already (LoadedGame)

id ​

ts
id: string;

The campaign's id, which prefixes its scene ids (<id>, <id>-mission) and keys its saved progress

ts
menu?: {
        title?: string;
        subtitle?: string;
        background?: string;
    } & Own<CampaignMenuProps>;

The menu it opens on. Each way takes more of it over than the last: - declared: its title, the words under it, a background (CSS): the campaign's name on stone when left out - in code: where its progress is kept (store), and each mission's own (MissionDef) - a component in the place of the client's (CampaignMenu, which it can wrap), given what the menu shows and what its buttons do (CampaignMenuProps: the campaign's controller, and its words) - an element of the game's own (mount), given the same

missions ​

ts
missions: MissionDef<D>[];

The missions in play order; a mission's next can send the campaign elsewhere in the list

name ​

ts
name: string;

The campaign's name, shown on its menu and loading screens

screens ​

ts
screens?: {
        briefing?: Own<BriefingProps>;
        debrief?: Own<DebriefProps>;
    };

The screens between its missions, each the game's own in the client's place: a component (BriefingScreen, DebriefScreen of @v12-engine/client/app to wrap) or an element of its own (mount), given what the client's is (BriefingProps, DebriefProps: the words, the picture, the objectives, the stars, what its buttons do). The client's own when left out

store ​

ts
store?: CampaignStore;

Where its progress is kept. This browser when left out

watch ​

ts
watch?: boolean;

Whether its missions may be watched from other pages: a panel in each shares the game through a relay, and a scene (<id>-watch) watches it, from one mission to the next. Not when left out

worker ​

ts
worker?: boolean;

Whether its missions are played in the app's worker (StartAppOptions.worker, whose file calls serveCampaign) where the app gives one: yes when left out. False plays them in the page whatever the app gives. A campaign that may be watched (watch) shares a world of the page's, and says false: it is refused in a worker