Skip to content

MapDoodad beta ​

Interface of @v12-engine/engine

ts
export interface MapDoodad

Scenery: a model on the map that is no entity of the rules, with no health, owner or place in a snapshot. A rock, a fence, a ruined arch, free to lean, float and stretch. What it keeps off the cells under it (blocks) the terrain has, for the paths of units and for building

Members ​

animation ​

ts
animation?: string;

A clip of its model it plays over and over (a windmill's sails, a flag, a chest held open), by its name: none when left out, or as the game says of its model (SceneryDef.animation). It is drawn on its own while it plays

batch ​

ts
batch?: boolean;

Merged with the scenery near it, to be drawn in one go (DoodadView): yes when left out, as far as its model can be. No keeps it a copy of its model's mesh: for a game's code that reaches for it

blocks ​

ts
blocks?: 'build' | 'walk';

What it keeps off the cells within radius of its middle: building there, or walking and building. Nothing when left out

bridge ​

ts
bridge?: boolean;

A bridge: walked on, over deep water too, at its height (y) above the water. Nothing is built on it. Within radius of its middle

detail ​

ts
detail?: MapDoodadDetail;

How this one is drawn by distance, over its model's (MapDetail): pinned to a level by its index (level: 0 always at full), or levels of its own. As its model when left out

gate ​

ts
gate?: boolean;

A gate: it keeps walking off the cells within radius while it is shut, and the rules open and shut it by its name while the game runs (setGate). Shut when the game starts, unless open

id ​

ts
id: number;

The editor's, see MapRegion.id

light ​

ts
light?: MapDoodadLight;

This one's lights otherwise than its model's (GameView.ground.scenery): put out (on: false), another colour, brighter, further. Laid over every light its model gives

model ​

ts
model: string;

The model, by its path in models/: the map's own, the game's, or a shared one

name ​

ts
name?: string;

What code knows it by (client.doodads.named). Doodads are the screen's: the rules never see them

open ​

ts
open?: boolean;

Whether the gate starts open; shut when left out

pitch ​

ts
pitch?: number;

How far it leans forward in radians; 0 when left out

radius ​

ts
radius?: number;

How far around its middle it blocks, in cells

roll ​

ts
roll?: number;

How far it leans to the side in radians; 0 when left out

scale ​

ts
scale: [number, number, number];

How much bigger or smaller it is drawn than it was made, across, up and deep

tint ​

ts
tint?: [number, number, number];

A colour it is drawn in, over its own

x ​

ts
x: number;

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

y ​

ts
y?: number;

How high above the ground under it

yaw ​

ts
yaw: number;

Radians: which way it faces, the way entities do (0 is along +z), then how far it leans forward and to the side

z ​

ts
z: number;

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