MapEditorDef beta
Interface of @v12-engine/engine
export interface MapEditorDefWhat a game brings to the map editor, beyond its units: the fields of its own, what can be scattered, its players, and what it takes for a map to be one of its maps. Each that is decided from something can be given as a function
Members
camps
camps?: boolean;Whether the game has creep camps to place. It does when it has a unit type with a bounty, when left out
check
check?: (map: GameMap, registry: Registry) => MapProblem[];What is wrong with a map as a map of this game: no start for anyone, no way through. Errors keep it from being played from the editor; warnings are said
erase
erase?: MapEraseKind[];What the erase brush can be set to take, besides everything and camps. Units, buildings, resources and trees (a resource one cell big) when left out
fields
fields?: MapFieldDef[];Fields of the game's own on what is placed on a map, shown in the inspector (see defineMapField)
heights
heights?: readonly [number, number];The lowest and the highest the ground is raised to. -4 to 16 when left out
measure
measure?: (map: GameMap, registry: Registry) => GameMeasure[];What the game measures of a map of its own, for the editor's report (measureMap): the length of the road
palette
palette?: (registry: Registry) => MapPaletteGroup[];The palette's groups of unit types, each saying whose what is put down from it is and whether it makes camps. Units, heroes, buildings, resources (nobody's) and creeps (the creeps', making camps) when left out
players
players?: MapPlayer[] | ((map: GameMap) => MapPlayer[]);The players of every map of the game, when the game decides who they are, as a tower defense does: the editor shows those and only lets their starts be set. Open slots to add and take away when left out
playersNote
playersNote?: string;A line under the players, saying what the game makes of them: who is the player, who gets a base
reach
reach?: (def: UnitTypeDef) => boolean;What the starts must be able to walk to, which the checks look for (unreachable): a resource two cells big or more when left out, a gold mine and not a tree
references
references?: (ref: MapRef, map: GameMap, registry: Registry) => MapRefUse[];Where else the game names a thing of a map (a unit type in its waves, a region in a mission's goals): what the editor lists under Used by and selects with Find references, beyond what it finds on the map itself (placed objects, camps, random groups, the game's fields, prefabs, cinematics). Given the thing asked about and the map
scatter
scatter?: string[] | ((registry: Registry) => string[]);Unit types the scatter brush puts down many of at once, like a forest. Resources one cell big when left out: trees. What is scattered belongs to nobody
silence
silence?: string[];The editor's checks the game does not want, by their rules' ids (MapProblem.rule), for every map of it