Appearance
twine / ModuleMetadata
Interface: ModuleMetadata
Defined in: module.interface.ts:78
Metadata attached to a class by the Module decorator.
Properties
activeByDefault?
optionalactiveByDefault?:boolean
Defined in: module.interface.ts:110
Initial state of an area's flag, set in load. Default false - areas start inactive and are switched on by a trigger (a level you enter, etc.). Set true for an area that should be live from load.
area?
optionalarea?:boolean
Defined in: module.interface.ts:103
Mark this module as an area: it owns an active scoreboard flag, and its own onTick and the entire subtree of modules it imports run only while that flag is 1. An inactive area costs a single execute if score … active check per tick - everything beneath it (including children's proximity checks) is skipped. Flip it with the generated <name>/activate / <name>/deactivate functions, or a regionTrigger/scoreTrigger.
env?
optionalenv?:BuildEnv[]
Defined in: module.interface.ts:124
Restrict the module to specific build environments. When set, the module (and any modules reachable only through it) is compiled in only if the active BuildEnv is listed - e.g. env: ["dev"] for debug-only features that must never reach a prod build. Omit to include in all envs.
imports?
optionalimports?:ModuleRef[]
Defined in: module.interface.ts:93
Child modules to compose in (NestJS-style): decorated classes and/or ConfiguredModules. Listing a module here enables it; removing it disables it at compile time. References are de-duplicated by identity, so the same class (or the same configured instance) imported by several parents is only built once - but two separate Door(...) calls are two distinct doors.
name
name:
string
Defined in: module.interface.ts:83
Stable identifier for the module. Used as the scoreboard fake-player id (#<name> modules) and as the namespace for the enable/disable functions.
tickEvery?
optionaltickEvery?:number
Defined in: module.interface.ts:133
Throttle this module's onTick: run it once every tickEvery ticks instead of every tick. Wrapped inside any area gating, so it still costs nothing while an ancestor area is dormant - this just spreads out the work while active. Omit (or 1) to run every tick. Use for per-tick work that doesn't need 20 Hz (proximity sweeps, slow timers) to cut per-tick command volume.
tickPhase?
optionaltickPhase?:number
Defined in: module.interface.ts:142
The offset (in ticks, 0..tickEvery-1) at which this module's throttled onTick fires within its period. Lets you deliberately spread same-period modules across different ticks. Omit to have the factory auto-assign distinct phases round-robin across modules sharing a tickEvery, so they don't all fire on the same tick. Only meaningful with tickEvery set.
trigger?
optionaltrigger?:AreaTrigger
Defined in: module.interface.ts:116
How this area switches itself on (see AreaTrigger). Omit to activate it manually via the generated <name>/activate function.