getNumOps
getNumOps: (EntityOps) -> 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 < getNumOps() therefore stops before the last slot.
client:getObjectDefinition(…):getOps()| Method | Returns | Description |
|---|---|---|
getNumOps() | 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 <… |
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) | boolean | Whether other equals this EntityOps, as == answers it (false for a value of another class). |
| Field | Type | Description |
|---|---|---|
MAX_OPS | number | EntityOps.MAX_OPS: 5, the ops a loc or NPC type has. |
| Method | Returns | Description |
|---|---|---|
ObjectComposition.getOps | EntityOps | Its 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… |
getNumOpsgetNumOps: (EntityOps) -> 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 < getNumOps() therefore stops before the last slot.
getOpgetOp: (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.
getSubOpsgetSubOps: (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.
equalsequals: (EntityOps, any) -> booleanWhether other equals this EntityOps, as == answers it (false for a value of another class).