Skip to content

level: members

28 implemented, 19 reserved. Entries are sorted by name.

level.board: array

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

The 4096 tiles of layer 0 of this level, row by row (a read only copy).

echo(level.board[5 + 5 * 64]);

Specification: standard-library.md§17.6.

level.findareanpcs(x: number, y: number, width: number, height: number) -> npc[]

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no.

Returns the NPCs of this level whose position is inside the rectangle, ordered by id.

echo(level.findareanpcs(0, 0, 64, 64).size());

Specification: world-and-objects.md§20.3.

level.getareanpcs(x: number, y: number, width: number, height: number) -> npc[]

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Same as findareanpcs: the NPCs of this level inside the rectangle, ordered by id.

echo(level.getareanpcs(0, 0, 64, 64).size());

Specification: standard-library.md§17.6.

level.getmappartfile(column: number, row: number) -> string

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Returns the level at a cell of the world map the player is on, or an empty string when the cell is empty or there is no map.

level.echo(getmappartfile(1, 0));

Specification: world-and-objects.md§20.7.

level.getnpcindex(name: string) -> number

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Returns the position of the first NPC with this name in the NPCs of this level, or -1.

echo(level.getnpcindex("door"));

Specification: standard-library.md§17.6.

level.height: number

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The height in tiles. Read-only.

echo(level.height);

Specification: world-and-objects.md§3.1.

level.isgmap: number

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

1 when the level belongs to a loaded gmap. Read-only.

echo(level.isgmap);

Specification: world-and-objects.md§3.1.

level.links: levellink[]

Runs on: client only. Origin: engine extension. Since: M8. Playground: no. read-only.

The links of the level file. Read-only.

echo(level.links.size());

Specification: world-and-objects.md§20.5.

level.name: string

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The file name of the level, with its extension. Read-only.

echo(level.name);

Specification: world-and-objects.md§3.1.

level.npcs: npc[]

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The NPCs in the level, ordered by id. Read-only.

echo(level.npcs);

Specification: world-and-objects.md§3.1.

level.onwallpath(x: number, y: number, width: number, height: number, dx: number, dy: number) -> boolean

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Returns 1 when a box moved by (dx, dy) meets a blocked tile or NPC shape on the way.

echo(level.onwallpath(30, 30, 1, 1, 2, 2));

Specification: standard-library.md§17.6.

level.onwaterpath(x: number, y: number, width: number, height: number, dx: number, dy: number) -> boolean

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Returns 1 when a box moved by (dx, dy) crosses a water tile on the way.

echo(level.onwaterpath(30, 30, 1, 1, 2, 2));

Specification: standard-library.md§17.6.

level.players: player[]

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The players in the level, ordered by id. Read-only.

echo(level.players);

Specification: world-and-objects.md§3.1.

level.projectiles: projectile[]

Runs on: client only. Origin: engine extension. Since: M8. Playground: no. read-only.

The projectiles in flight in the level, in the order they were shot. Read-only.

echo(level.projectiles.size());

Specification: world-and-objects.md§20.6.

level.reflectarrow(index: number)

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Turns the projectile at the index of the level projectile list around.

level.reflectarrow(0);

Specification: world-and-objects.md§20.6.

level.removearrow(index: number)

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Takes the projectile at the index of the level projectile list out of the air.

level.removearrow(0);

Specification: world-and-objects.md§20.6.

level.setz(x: number, y: number, width: number, height: number, z1: number, z2: number, z3: number, z4: number)

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Sets the ground height over a rectangle of tiles from the heights at its four corners: top left, top right, bottom left, bottom right. Later calls win where they overlap.

level.setz(0, 0, 8, 8, 0, 1, 0, 1);

Specification: world-and-objects.md§20.7.

level.shoot(x: number, y: number, z: number, angle: number, zangle: number, speed: number, ani: string, params: string)

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no.

Shoots a projectile in this level; the arguments are those of shoot.

level.shoot(30, 30, 0.5, 0, 0, 5, "arrow", "");

Specification: world-and-objects.md§20.3.

level.signs: sign[]

Runs on: client only. Origin: engine extension. Since: M8. Playground: no. read-only.

The signs of the level file. Read-only.

echo(level.signs.size());

Specification: world-and-objects.md§20.5.

level.testnpc(x: number, y: number) -> number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no.

Returns the index among the NPCs of this level of the first NPC whose box holds the point, or -1.

echo(level.testnpc(10, 10));

Specification: world-and-objects.md§20.3.

level.testsign(x: number, y: number) -> number

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Returns the index in the level sign list of the first sign whose box holds the point, or -1. A sign covers two tiles in a row.

level.echo(testsign(30, 30));

Specification: world-and-objects.md§20.3.

level.tilelayercount: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no.

How many tile layers the level has for scripts, from 1 to 8.

echo(level.tilelayercount);

Specification: world-and-objects.md§20.7.

level.tilelayers: tileslayer[]

Runs on: server and client. Origin: engine extension. Since: M8. Playground: no. read-only.

The tile layers of the level, bottom first. Read-only.

echo(level.tilelayers.size());

Specification: world-and-objects.md§20.7.

level.tiles: object

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

The tiles of the bottom layer of the level: level.tiles[x, y] reads or writes the tile number at a cell.

player.level.tiles[10, 20] = 0;

Specification: world-and-objects.md§20.7.

level.tiletype(x: number, y: number) -> number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no.

Returns the tile type at the point in this level; outside the level it is 22.

echo(level.tiletype(10, 10));

Specification: world-and-objects.md§20.3.

level.updateboard(x: number, y: number, width: number, height: number)

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Same as updateboard2 on a level.

level.updateboard(0, 0, 64, 64);

Specification: standard-library.md§17.6.

level.updateboard2(x: number, y: number, width: number, height: number)

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Sends the changed board of the level to the players that know it. Tiles are changed with layer.tiles[x, y] = tile; savelevel writes the file.

level.updateboard2(0, 0, 64, 64);

Specification: standard-library.md§17.6.

level.width: number

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The width in tiles. Read-only.

echo(level.width);

Specification: world-and-objects.md§3.1.

These names exist so that older scripts compile. Calling one reports R-NOT-IMPLEMENTED and does nothing else.

Name Signature Runs on
hitcompu level.hitcompu(arg1: number, arg2: number, arg3: number, arg4: number) -> any client only (not yet verified)
isnopkzone level.isnopkzone() -> any client only (not yet verified)
issparringzone level.issparringzone() -> any client only (not yet verified)
noplayerkilling level.noplayerkilling() -> any client only (not yet verified)
putbomb level.putbomb(arg1: number, arg2: number, arg3: number) -> any client only (not yet verified)
putbomb2 level.putbomb2(arg1: number, arg2: number, arg3: number, arg4: string) -> any client only (not yet verified)
putexplosion level.putexplosion(arg1: number, arg2: number, arg3: number) -> any client only (not yet verified)
putexplosion2 level.putexplosion2(arg1: number, arg2: number, arg3: number, arg4: number) -> any client only (not yet verified)
puthorse level.puthorse(arg1: string, arg2: number, arg3: number) -> any client only (not yet verified)
removebomb level.removebomb(arg1: number) -> any client only (not yet verified)
removecompus level.removecompus() -> any client only (not yet verified)
removeexplo level.removeexplo(arg1: number) -> any client only (not yet verified)
removehorse level.removehorse(arg1: number) -> any client only (not yet verified)
removeitem level.removeitem(arg1: number) -> any client only (not yet verified)
save level.save(arg1: number, arg2: number) -> any client only (not yet verified)
testbomb level.testbomb(arg1: number, arg2: number) -> any client only (not yet verified)
testexplo level.testexplo(arg1: number, arg2: number) -> any client only (not yet verified)
testhorse level.testhorse(arg1: number, arg2: number) -> any client only (not yet verified)
testitem level.testitem(arg1: number, arg2: number) -> any client only (not yet verified)

Engine version 0.1.0. Built 2026-11-18.