home » builders » builder's lessons » trap triggers
Trap triggers
A trap object can use more than one trigger flag, it needs to be separated by a pipe. TRIGGER_PICK triggers on knock, doorbash and pick. Doorbash will check TRIGGER_PICK, then TRIGGER_UNLOCK then TRIGGER_OPEN. If two of those triggers are used it will only trigger once. So when coded into an area, the lowest level trigger should be used, ie no need to use TRIGGER_PICK and TRIGGER_UNLOCK because anything that triggers TRIGGER_PICK will also trigger TRIGGER_UNLOCK.
TRIGGER | BIT VECTOR |
TRIGGER_NONE | 0 |
TRIGGER_GET | 1 |
TRIGGER_OPEN | 2 |
TRIGGER_SHOVE | 4 |
TRIGGER_PUT | 8 |
TRIGGER_EXAMINE | 16 |
TRIGGER_USE | 32 |
TRIGGER_UNLOCK | 64 |
TRIGGER_CLOSE | 128 |
TRIGGER_MOVE | 256 |
TRIGGER_PICK | 512 |
TRIGGER_PICK will trigger on knock, doorbash and pick
Doorbash will check TRIGGER_PICK, then TRIGGER_UNLOCK then TRIGGER_OPEN.
If two of those triggers are used it will only trigger once. So when coded, the lowest level trigger should be used, ie no need to use TRIGGER_PICK and TRIGGER_UNLOCK because anything that triggers PICK will also trigger unlock.