Docs · entities

entities

2 entities commands, generated from the engine's own registry — signatures, parameters and a worked example each. A does something command acts on the game; a needs x() one answers a confident wrong answer when its client hooks are missing.

hasCommand returns bool
hasCommand(subject: object, command: string) -> boolhasCommand(subject: wall, command: string) -> bool

True when this object offers that right-click option. Either of the two the cache carries counts, ignoring case.

True when this wall offers that right-click option.

ParameterTypeWhat it does
subjectrequired object the object
commandrequired string the right-click option
Example
for o in objects(within: 12) { if hasCommand(o, "Chop down") { walkTo(o.tile) } }
for w in walls(within: 8) { if hasCommand(w, "Open") { walkTo(w.tile) } }
named returns bool
named(subject: npc, name: string) -> boolnamed(subject: object, name: string) -> boolnamed(subject: wall, name: string) -> boolnamed(subject: drop, name: string) -> bool

True when the cache calls this npc that name, ignoring case.

True when the cache calls this object that name, ignoring case.

True when the cache calls this wall that name, ignoring case.

True when the cache calls this drop that name, ignoring case.

ParameterTypeWhat it does
subjectrequired npc the npc
namerequired string the whole name
Example
for n in npcs(within: 12) { if named(n, "Goblin") { walkTo(n.tile) } }
for o in objects(within: 12) { if named(o, "Iron rock") { walkTo(o.tile) } }
for w in walls(within: 8) { if named(w, "Door") { walkTo(w.tile) } }
for d in drops(within: 8) { if named(d, "Bones") { walkTo(d.tile) } }