Skip to content

PrefabObject beta ​

Interface of @v12-engine/engine

ts
export interface PrefabObject

A unit or a building of a prefab, where it stands around the prefab's middle *

Members ​

facing ​

ts
facing?: number;

Radians, the way entities face

health ​

ts
health?: number;

0..1 of its health, less than whole

look ​

ts
look?: string;

The id of the look the entity is drawn with, in place of its type's own

name ​

ts
name?: string;

A name of its own, for the rules to find it by: made free where it is taken (a number added)

owner ​

ts
owner?: 'owner' | 'neutral' | 'creeps' | PlayerId;

Whose: the player the prefab is spawned for ('owner', the default), neutral, the creeps, or a player of the map's by id (a file's objects say the id they had; one that is a player's becomes 'owner' as the file is read)

scale ​

ts
scale?: number;

Size of the entity as a multiple of its type's own; the prefab's scale is applied on top

type ​

ts
type: string;

The unit type id to spawn

underConstruction ​

ts
underConstruction?: boolean;

Structures: as a construction site

x ​

ts
x: number;

Where it stands east-west, in cells from the prefab's middle before the prefab's turn and size

z ​

ts
z: number;

Where it stands north-south, in cells from the prefab's middle before the prefab's turn and size