Skip to content

MarkersArea beta ​

Class of @v12-engine/editor

ts
export declare class MarkersArea

What the rules know by name or the map is dressed with: cameras, regions, points, paths and doodads

Members ​

constructor ​

ts
constructor(
    doc: MapDocument, names: NamesArea);

Constructs a new instance of the MarkersArea class

addCamera ​

ts
addCamera(pose: Omit<MapCamera, 'id' | 'name'>, name?: string): MapCamera | null;

Saves a view under a name (MapCamera): camera-1 and so on when none is given. Null when that name is taken

addDoodad ​

ts
addDoodad(model: string, at: Vec2, options?: Partial<Omit<MapDoodad, 'id' | 'model' | 'x' | 'z'>>): MapDoodad;

Puts down scenery (MapDoodad): a model, facing a way, as big as it was made. radius is how far around it blocks, when it is told to (blocks): the editor gives it from the size of the model

addPath ​

ts
addPath(points: Vec2[], name?: string, width?: number): MapPath | null;

Starts a path at its first points, named path-1 and so on when no name is given. Null when that name cannot be had

addPoint ​

ts
addPoint(at: Vec2, facing?: number, name?: string): MapPoint | null;

Puts down a point, named point-1 and so on when no name is given. Null when that name cannot be had

addRegion ​

ts
addRegion(shape: AreaShape, name?: string, cinematic?: MapRegionCinematic): MapRegion | null;

Marks out a region, named region-1 and so on when no name is given. Null when that name cannot be had

camera ​

ts
camera(id: number): MapCamera | undefined;

The camera with that id, or undefined when the map has none

doc ​

ts
readonly doc: MapDocument;

The map document the area works on

doodad ​

ts
doodad(id: number): MapDoodad | undefined;

The doodad with that id, or undefined when the map has none

moveMarker ​

ts
moveMarker(kind: 'regions' | 'points' | 'paths', from: number, to: number): void;

Moves a region, a point or a path to another place among those of its kind (master plan OC2): the order the panels and the Outliner list them in, kept with the map. One step to undo

path ​

ts
path(id: number): MapPath | undefined;

The path with that id, or undefined when the map has none

point ​

ts
point(id: number): MapPoint | undefined;

The point with that id, or undefined when the map has none

region ​

ts
region(id: number): MapRegion | undefined;

The region with that id, or undefined when the map has none

regionAt ​

ts
regionAt(point: Vec2): MapRegion | undefined;

The region a point is in, the smallest when it is in several: what a click there picks

removeCamera ​

ts
removeCamera(id: number): void;

Takes a camera away; the views that started at it start at their players' starts

removeDoodads ​

ts
removeDoodads(ids: Iterable<number>): void;

Removes the doodads with those ids, as one step of the history

removePaths ​

ts
removePaths(ids: Iterable<number>): void;

Removes the paths with those ids, as one step of the history

removePoints ​

ts
removePoints(ids: Iterable<number>): void;

Removes the points with those ids, as one step of the history

removeRegions ​

ts
removeRegions(ids: Iterable<number>): void;

Removes the regions with those ids, as one step of the history

replaceModel ​

ts
replaceModel(ids: Iterable<number>, model: string): number;

Doodads given another model (Replace with, FB4): each stays where it is, turned and sized as it was. One step to undo. How many were

reversePath ​

ts
reversePath(id: number): void;

Turns a path round: its last point is its first

setCamera ​

ts
setCamera(id: number, change: Partial<Omit<MapCamera, 'id'>>): string | null;

Changes a camera: the view it saves, or its name, which the players whose view starts at it follow. Returns why not, or null

setDoodad ​

ts
setDoodad(id: number, change: Partial<Omit<MapDoodad, 'id'>>, name?: string): void;

Changes a doodad: where it is and how high, how it is turned and leans, how big it is each way, its tint, what it blocks. What is given as undefined goes back to none

setDoodads ​

ts
setDoodads(changes: ReadonlyMap<number, Partial<Omit<MapDoodad, 'id'>>>, name?: string): void;

Changes many doodads at once, as setDoodad changes one: a drag of hundreds goes over the map's doodads once, not once for each, and works out what they block once

setPath ​

ts
setPath(id: number, change: Partial<Pick<MapPath, 'points' | 'width' | 'paint' | 'keepClear' | 'color' | 'profile'>>, name?: string): void;

Changes a path: its points (moved, added, taken away, turned round), how wide it is, what it paints, whether it keeps buildings off, and the bed it carves (profile: given whole, or nothing for none). A path that paints or carves the ground has it worked out again where it was and where it is; a point of it dragged, around that point

setPoint ​

ts
setPoint(id: number, change: Partial<Pick<MapPoint, 'x' | 'z' | 'facing' | 'color'>>): void;

Moves a point, turns it, or colours it

setRegionCinematic ​

ts
setRegionCinematic(id: number, cinematic: MapRegionCinematic | undefined): void;

The cinematic a region plays (ED4): as a unit of a player first walks in, or as the game's code says (play: 'code'); none for nothing

setRegionColor ​

ts
setRegionColor(id: number, color: [number, number, number]): void;

What a region is drawn in, in the editor

setRegionShape ​

ts
setRegionShape(id: number, shape: AreaShape): void;

Moves a region, or makes it bigger or smaller, or of another shape

whyNotCameraName ​

ts
whyNotCameraName(id: number | undefined, name: string): string | null;

Why a camera cannot be called a name: cameras are known by their names, one each. Null when it can

writer ​

ts
writer(kind: 'regions' | 'points' | 'paths' | 'doodads', named: Namer): CollectionWriter;

How regions, points, paths and doodads are written (CollectionWriter)