EntityOps

Methods
4
Fields
1

Getting one

client:getObjectDefinition(…):getOps()

Methods

MethodReturnsDescription
getNumOps()numberThe highest index of the list: its size minus one, so -1 for a type with no ops and, for a sub-op list, its highest sub-op id. A loop `i <…
getOp(number)string?The op at idx as the menu shows it now: the first of its conditional texts whose varbit (or varp) value is in range, else its own text. `…
getSubOps(number)EntityOps?The sub-ops of op idx, an EntityOps indexed by sub-op id, or nil for an op with none (and for every op of a sub-op list). Raises for…
equals(any)booleanWhether other equals this EntityOps, as == answers it (false for a value of another class).

Fields

FieldTypeDescription
MAX_OPSnumberEntityOps.MAX_OPS: 5, the ops a loc or NPC type has.

Returned by

MethodReturnsDescription
ObjectComposition.getOpsEntityOpsIts menu ops: getActions()'s, each as the menu shows it now (an op with a conditional text answers that text while its varbit or varp is…

Method details

getNumOps

getNumOps: (EntityOps) -> number

The highest index of the list: its size minus one, so -1 for a type with no ops and, for a sub-op list, its highest sub-op id. A loop i < getNumOps() therefore stops before the last slot.

getOp

getOp: (EntityOps, number) -> string?

The op at idx as the menu shows it now: the first of its conditional texts whose varbit (or varp) value is in range, else its own text. nil outside the list, for a slot with no op (a hidden op included), and for an empty text.

getSubOps

getSubOps: (EntityOps, number) -> EntityOps?

The sub-ops of op idx, an EntityOps indexed by sub-op id, or nil for an op with none (and for every op of a sub-op list). Raises for an idx outside the list and for a slot with no op, so test getOp(idx) first.

equals

equals: (EntityOps, any) -> boolean

Whether other equals this EntityOps, as == answers it (false for a value of another class).