Alpha: this compiler is under active development and updates will break your projects. Not recommended for real use yet.
Skip to content

twine / AreaTrigger

Type Alias: AreaTrigger โ€‹

AreaTrigger = { center: Vec3; kind: "region"; radius: number; } | { from: Vec3; kind: "cuboid"; to: Vec3; } | { kind: "zones"; zones: Zone[]; } | EntrancesTrigger | PlayersTrigger | ScoreTrigger

Defined in: twine/src/core/area.ts:33

How an area switches itself on.

  • entrances: a room entered through doorways; see EntrancesTrigger.
  • region: one sphere.
  • cuboid: one box.
  • zones: a union of spheres and boxes, for irregular areas.
  • score: while #<target> <objective> equals a value or is in a range.
  • players: while any player matches a Selector (tagged, scored, holding something...).

Presence triggers (entrances, region, cuboid, zones, players) turn the area off when nobody matches. score latches on until something calls deactivate. Areas with no trigger are activated with /function <ns>:<name>/activate.

Released under the MIT License ยท Credits
These docs were written with AI; the layout and every page have been reviewed by a human.