Skip to content

MapObject beta ​

Interface of @v12-engine/engine

ts
export interface MapObject

Something that stands on the map when the game begins: a unit, a building, a tree, a mine

Members ​

abilities ​

ts
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 ​

ts
amount?: number;

For a resource: how much there is of it. What its type holds when left out

data ​

ts
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 ​

ts
drops?: string;

The item table it drops from when it dies (MapItemTable, by name)

facing ​

ts
facing: number;

The way it faces in radians, the way entities do (0 is along +z)

health ​

ts
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 ​

ts
id: number;

The object's id on the map, used by the editor

items ​

ts
items?: string[];

The items it carries, by the id of each, as far as it has room

level ​

ts
level?: number;

For a hero: the level it starts at

lifetime ​

ts
lifetime?: number;

Seconds until it is gone, for what is not there to stay

look ​

ts
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 ​

ts
mana?: number;

The mana it starts with, as a part of what it can have. What its type starts with when left out

name ​

ts
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 ​

ts
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 ​

ts
owner: PlayerId;

The player that owns it (MAP_NEUTRAL or MAP_CREEPS for the neutral and the creeps)

random ​

ts
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 ​

ts
scale: number;

How big it is drawn

type ​

ts
type: string;

The id of the unit type placed

underConstruction ​

ts
underConstruction?: boolean;

For a building: it starts as a site that is still to be built

x ​

ts
x: number;

Where it stands on the map's x axis, in cells

z ​

ts
z: number;

Where it stands on the map's z axis, in cells