ObjectComposition

Methods
11
Fields
None

Getting one

client:getObjectDefinition(…)

Methods

MethodReturnsDescription
getId()numberThe loc id.
getName()stringIts name ("null" for an unnamed loc, as the cache stores it).
getActions(){ n: number, [number]: string? }Its five menu actions, nil where there is none. Holes are nil and the array carries n, its length: walk it for i = 1, actions.n. `t…
getOps()EntityOpsIts 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…
getImpostorIds(){number}?The loc ids it can turn into, or nil when it is not a multiloc.
getImpostor()ObjectComposition?The loc it is now, chosen by its varbit (or varp) as the client chooses it, or nil (not a multiloc, or the choice is -1).
getVarbitId()numberThe varbit that chooses the impostor, or -1.
getVarPlayerId()numberThe varp that chooses the impostor, or -1.
getSizeX()numberIts width in tiles, unrotated.
getSizeY()numberIts length in tiles, unrotated.
equals(any)booleanWhether other equals this ObjectComposition, as == answers it (false for a value of another class).

Returned by

MethodReturnsDescription
Client.getObjectDefinitionObjectCompositionLoc type id's definition.

Method details

getActions

getActions: (ObjectComposition) -> { n: number, [number]: string? }

Its five menu actions, nil where there is none. Holes are nil and the array carries n, its length: walk it for i = 1, actions.n. table.find stops at the first hole, so search it with your own contains(actions, x) that walks to n.

getOps

getOps: (ObjectComposition) -> 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 in range), and the sub-ops under each (getSubOps). Raises on a build whose op layout is not matched (EntityOps).

equals

equals: (ObjectComposition, any) -> boolean

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