Skip to content

EditorPlaying beta ​

Class of @v12-engine/editor

ts
export declare class EditorPlaying

Playing the map: here, over the editor (paused, stepped, stopped), or in a scene of its own.

A part of the editor, as it gives it (editor.plays)

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the EditorPlaying class.

Members ​

followEdits ​

ts
followEdits(): void;

The map as it is now is what the game played here is pushed from, from here on (pushEdits): as a game starts here, its world made of the map as it is, or loaded from a test point (what stood on the map before is not followed then: only what is placed after)

keepReplay ​

ts
keepReplay(replay: Replay, at?: Date): Promise<string>;

Keeps a replay of the game played here among the map's files (replays/<date>.json), written there at once (the project's <map>.files/replays/, the browser's pack of the map) without saving the map: what the editor's page does with the replay of each game played here as it is stopped (one that lasted more than a few seconds). A map kept nowhere yet holds it until it is saved. Its name

mapShown ​

ts
mapShown: boolean;

Whether the map is shown while it is played here, to be edited (showMap): the game plays on out of sight

pause ​

ts
pause(): void;

Stops drawing and listening while a game is played over the editor (playHere): it is left just as it was

paused ​

ts
paused: boolean;

Whether the editor stopped drawing for a game played over it

pausePlay ​

ts
pausePlay(paused?: boolean): void;

Pauses the game played here, or lets it go on (paused says which, the other of now when left out): Ctrl+Shift+P. For a game played in the page; one played elsewhere goes at its server's pace

play ​

ts
play(): Promise<void>;

Saves the map and starts a game on it

playFrom ​

ts
playFrom(name: string): boolean;

Plays the map here from a test point: its world loaded (loadWorld) in the place of a new one, as the map's play scene loads a save, from its seat unless Play here as says another. A game played here already starts again from it. One that is not this game's, or of saves it does not read, is refused with why; one made with other rules (the Data panel changed since, the game's code) is the game's to refuse as it loads, its screen says why

playHere ​

ts
playHere(options?: {
        player?: PlayerId;
        reveal?: boolean;
    }): MapBeingEdited | undefined;

What a game of this map played over the editor needs (MapBeingEdited): the map as it is now, without saving it, its files, who plays, the view where the editor's camera looks, and whether all is seen

playingTo ​

ts
playingTo?: {
        until: PlayTo;
        seconds: number;
    };

What Play to runs the game on to while it does, and how far it has come: what the Cheats panel shows

playOrStop ​

ts
playOrStop(): void;

Plays the map here, or, while it is played, stops it: the bar's ▶ and ■, Ctrl+P

playState ​

ts
get playState(): 'stopped' | 'starting' | 'running' | 'paused';

Where Play here is: no game, one being made, one running, one paused

playTo ​

ts
playTo(until: PlayTo): Promise<boolean>;

Runs the game played here on, as fast as the page can, until the moment asked (PlayTo: a time, an objective given, done or failed, a computer's wave), then pauses it there to be looked at: a slice of ticks every frame (LocalSession.runUntil), the ticks the game would run at its own pace, so the same game comes to the same moment. Gives back whether it came to it: not where it was stopped (stopPlayingTo, the game stopped), where the game ended first, or after an hour of the game. For a game played in the page

pushEdits ​

ts
pushEdits(): number;

Pushes what was changed of the map since the last push into the game played here, without stopping it (EQ10): a thing placed is put down as the map has it, one moved is moved (a structure, or one changed in more than where it stands, is taken away and put down again), one taken off the map is taken out of the world, and the ground (its heights, cliffs, water, paint, the game's layers of cells) is reshaped where it changed, the ways cut again of it. Each a debug command, through the simulation: a replay and a test point saved after hold them. Done as each step of the history is made, while pushingEdits; for a game played in this page that may use the debug tools. Markers, scenery, the players and the map's settings are read as the world is made, and not pushed: a rule that read them is not told. Gives back how many commands were sent

pushingEdits ​

ts
pushingEdits: boolean;

Whether what is changed of the map while it is played here goes into the game too (pushEdits, EQ10): what is placed, moved and taken away, the ground. On unless turned off (Play › Push map edits into the game)

pushStyles ​

ts
pushStyles(): number;

Pushes the styles of the game's layers of grass and bushes, as the editor has them now, into the game played here (debug.cellStyles): what a style is to the rules (whether it hides, burns, slows), its name and colour, set in the Terrain panel for this map or every map, taken by the game at once. A layer whose styles did not change since the last push is not sent. Done as each step of the history is made, whether map edits are pushed or not (as the Data panel's changes are), for a game that may use the debug tools. Gives back how many layers were sent

removeReplay ​

ts
removeReplay(name: string): void;

Takes a replay out of the map's files: gone at the next save

removeTestPoint ​

ts
removeTestPoint(name: string): void;

Takes a test point out of the map's files: gone at the next save

replay ​

ts
replay(name: string): {
        replay: Replay;
    } | {
        problem: string;
    };

The replay a file of the map keeps, read; or why it is none to open (problem)

replays ​

ts
replays(): string[];

The names of the map's replays (replays/<name>.json in its files), the newest first

resume ​

ts
resume(): void;

Draws and listens again, after a game played over it

sandbox ​

ts
sandbox(): Promise<void>;

Saves the map and opens the dev sandbox on it: the champions, the dummies and the debug panel, on this ground

saveTestPoint ​

ts
saveTestPoint(name?: string): Promise<string | undefined>;

Saves the game played here, as it stands, as a test point of the map (tests/<name>.save.json in its files, with the map at once: into the project, or this browser): Ctrl+Shift+S while it plays. name is made of the moment when left out (2m05s, with a number where that is taken); a name given that is taken is saved over. Gives back its name, none where nothing is played in the page

showMap ​

ts
showMap(on?: boolean): boolean;

Shows the map while it is played here, to be edited (on; the other of now when left out): the game plays on out of sight, the editor draws and listens again, the Hierarchy and the Inspector are the map's, and what is changed is pushed into the game (pushEdits). Back to the game, the editor waits under it again. Ctrl+Shift+E

stepPlay ​

ts
stepPlay(ticks?: number): void;

Moves the game played here on by a tick (or ticks), paused first: Ctrl+Alt+P

stopPlayingTo ​

ts
stopPlayingTo(): void;

Stops Play to where it has come: the game stays paused there

testPoint ​

ts
testPoint(name: string): {
        save: WorldSave;
    } | {
        problem: string;
    };

The save a test point keeps, read; or why it is not one to play from (problem)

testPoints ​

ts
testPoints(): string[];

The names of the map's test points (tests/<name>.save.json in its files), in order

watching ​

ts
watching?: string;

The replay of the map played back here, by its name, while one is (watchReplay)

watchReplay ​

ts
watchReplay(name: string): boolean;

Plays a replay of the map back here, in the game's place, with its bar (hold, faster, on to any moment): in the place of a game played here; Stop (Ctrl+P) is back to the map. It is watched, not played: no cheats, no test points, nothing pushed. Whether it opened