Trigger once

Trigger once

Classname: trigger_once
Purpose: Making stuff happen on a once-only basis (mostly puzzles, I suspect).
H2 Code: triggers.hc
Fires the first time the associated brush is touched. One (the main?) use is for puzzles: the trigger specifies the required puzzle pieces with the puzzle_piece_1/2/3/4 fields, & doesn't fire unless the player has them.

Fields

target Value is a name; Entity with matching targetname value is triggered.
soundtype Value is one of the following numbers:
  • 1 -- secret sound
  • 2 -- bell
  • 3 -- metal sound
message Value is a number, indicting the message to be displayed when trigger fires. QuArK users can instead use a string-valued #message field.
puzzle_piece1..4 (4 fields). Value is the name of a puzzle piece; these are listed here. Trigger won't fire until player has all the required pieces.
no_puzzle_msg Value is a number, indicating the message to be displayed when player lacks required puzzle pieces. QuArK users can instead use a string-valued #no_puzzle_msg field.
delay Value is a number; how long trigger fires targets after being used.
wait Value is a number; low long it takes (sec) for trigger to be re-fireable (default = .2).
killtarget remove the target after having triggered it once (from Eutectic's list, haven't tested it).
netname unique name used for linking to other entities (Eutetic, untested by me).
aflag order number used in sequence triggering (Eutectic, untested by me).
targetname value is a name, targetted by a activator entity, which toggles activation state; use DEACTIVATED spawnflag to start in deactivated state.
style Value is a number; some trigger effects are extended to all entities with the same style-value. I've only gotten it to work for switching off lights/torches: if the trigger targets one light with which it shares a style-value, all lights with that style will stop emitting light, tho they won't switch to their off-skins (this looks like a vestige of an abandoned idea). This also works for buttons. The code comments say you can set a lower light-value (lightvalue1 and lightvalue2) and a fading speed (fadespeed), but I haven't gotten these to work. I've also tried and failed to get style-linked destruction of breakable brushes .
spawnflags: Add up the numbers for the properties you want, & set the sum as the spawnflags value.
  • 1 - NOTOUCH: supposedly fired by other entities, not touch (untested, maybe obsoleted by trigger_relay).
  • 2 - MONSTERTOUCH: untested, supposedly fired only by monsters.
  • 4 - PUSHTOUCH: use unknown, trashes normal function.
  • 8 - DEACTIVATED: must be activated first, use with targetname field.
  • 16 - REMOVE_PP: player looses puzzle-piece when trigger fires.
  • 32 - LIGHTTOGGLE: for toggling lights; doesn't actually seem to be necessary
  • 128 - LIGHTSTARTLOW: supposedly makes targetted lights start at low value, but doesn't actually seem to work (but this can be specified on the actual lights).

Note: in the MP appears once each with the fields health, items and wait; I suspect these are mistakes or vestiges.
Back to the list.