MarkersArea beta
Class of @v12-engine/editor
export declare class MarkersAreaWhat the rules know by name or the map is dressed with: cameras, regions, points, paths and doodads
Members
constructor
constructor(
doc: MapDocument, names: NamesArea);Constructs a new instance of the MarkersArea class
addCamera
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
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
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
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
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
camera(id: number): MapCamera | undefined;The camera with that id, or undefined when the map has none
doc
readonly doc: MapDocument;The map document the area works on
doodad
doodad(id: number): MapDoodad | undefined;The doodad with that id, or undefined when the map has none
moveMarker
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
path(id: number): MapPath | undefined;The path with that id, or undefined when the map has none
point
point(id: number): MapPoint | undefined;The point with that id, or undefined when the map has none
region
region(id: number): MapRegion | undefined;The region with that id, or undefined when the map has none
regionAt
regionAt(point: Vec2): MapRegion | undefined;The region a point is in, the smallest when it is in several: what a click there picks
removeCamera
removeCamera(id: number): void;Takes a camera away; the views that started at it start at their players' starts
removeDoodads
removeDoodads(ids: Iterable<number>): void;Removes the doodads with those ids, as one step of the history
removePaths
removePaths(ids: Iterable<number>): void;Removes the paths with those ids, as one step of the history
removePoints
removePoints(ids: Iterable<number>): void;Removes the points with those ids, as one step of the history
removeRegions
removeRegions(ids: Iterable<number>): void;Removes the regions with those ids, as one step of the history
replaceModel
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
reversePath(id: number): void;Turns a path round: its last point is its first
setCamera
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
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
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
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
setPoint(id: number, change: Partial<Pick<MapPoint, 'x' | 'z' | 'facing' | 'color'>>): void;Moves a point, turns it, or colours it
setRegionCinematic
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
setRegionColor(id: number, color: [number, number, number]): void;What a region is drawn in, in the editor
setRegionShape
setRegionShape(id: number, shape: AreaShape): void;Moves a region, or makes it bigger or smaller, or of another shape
whyNotCameraName
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
writer(kind: 'regions' | 'points' | 'paths' | 'doodads', named: Namer): CollectionWriter;How regions, points, paths and doodads are written (CollectionWriter)