MapObject beta
Interface of @v12-engine/engine
export interface MapObjectSomething that stands on the map when the game begins: a unit, a building, a tree, a mine
Members
abilities
abilities?: Record<string, number>;For a hero: what it has learned already, as the level of each ability by id. As far as its level lets it
amount
amount?: number;For a resource: how much there is of it. What its type holds when left out
data
data?: Record<string, unknown>;What the game's own fields were set to, by the id of each (see defineMapField). The engine does not look inside: the mapObject hook hands it to the game
drops
drops?: string;The item table it drops from when it dies (MapItemTable, by name)
facing
facing: number;The way it faces in radians, the way entities do (0 is along +z)
health
health?: number;The health it starts with, as a part of what it can have: 0.5 is half. All of it when left out
id
id: number;The object's id on the map, used by the editor
items
items?: string[];The items it carries, by the id of each, as far as it has room
level
level?: number;For a hero: the level it starts at
lifetime
lifetime?: number;Seconds until it is gone, for what is not there to stay
look
look?: string;Which of the models of its type it is drawn with, for things that come in kinds like trees. Left out: one picked for it
mana
mana?: number;The mana it starts with, as a part of what it can have. What its type starts with when left out
name
name?: string;A name of its own, for the rules to find it by (world.named('gate')). No two things on a map have the same, whatever they are
orders
orders?: MapObjectOrder[];What it is doing as the game begins, its own orders and no player's, one after the other (campaign plan MS2): a guard walking a patrol route, a caravan on its road. Nothing but what a unit does by itself when left out
owner
owner: PlayerId;The player that owns it (MAP_NEUTRAL or MAP_CREEPS for the neutral and the creeps)
random
random?: string;The random group it is drawn from when the game starts (MapRandomGroup, by name): type is what the editor shows until then
scale
scale: number;How big it is drawn
type
type: string;The id of the unit type placed
underConstruction
underConstruction?: boolean;For a building: it starts as a site that is still to be built
x
x: number;Where it stands on the map's x axis, in cells
z
z: number;Where it stands on the map's z axis, in cells