| Classname: | trigger_counter |
| Purpose: | Triggering events with multiple or ordered triggers. |
| H2 Code: | triggers.hc |
|
This entity works by being triggered by a collection of other entities;
when enough have fired (and in the right order, if spawnflag 2
ORDERED is set), it fires its own target. So if you have to push three
buttons to open a door, each button might have the target-value
`open', which will also be the targetname-value for the
trigger_counter. The counter will also need a count-value
of 3, since 3 buttons are to be pushed before it fires. Then it will
target the door. The triggers can also be monsters, but in this case it is best to have each monster target a trigger_relay, with the relays targetting the trigger_counter. This is because a when monster is gibbed, it tends to be counted twice, leading to premature firing. You can collect an example map here (output by Quark 5, not sure how it will load under other editors). Ordered trigger counters have some additional twists, as discussed under the count and netname fields below. Also trigger_counter can be reset by trigger_counter_reset, and have triggering sequences passed to it by trigger_combination_assign.
|
| target | Value is a name; Entity with matching targetname value is triggered. |
| netname | Value is a string, Ordered trigger_coumters need to share a unique netname value with their triggers (not their targets), otherwise the map won't start. netname doesn't seem to be necessary for unordered trigger_counters, and is at least sometimes omitted with them in the Raven maps. |
| count | must be the number of triggers until the counter fires for unordered
counting and number of triggers - 1 for ordered counting. After the
counter has been triggered "count" times (default 2), it will fire
all of it's targets and shut off, unless you specify a wait time. Notes on ordered trigger_counters:
|
| wait | how long to wait after successful before giving it another try. Default is -1, meaning it works once and shuts off. If you specify a wait time, the trigger will become a multiple trigger. |
| puzzle_id | Value is a name, which is targetted when the player first departs from the correct sequence. Used in egypt2 (to activate the teleport that tosses you off the floor buttons), and romeric4 (to spawn the skull wizards that appear when you don't get the right button sequence). |
| msg2 | Value is a number, of the message that appears when you get the combination wrong. Appears in romeric4 with value 286 ("the sequence is incorrect"). |
| mangle |
This entity has the ability to have a non-sequential sequence of
numbers as a combination using mangle. The format is like a vector,
for example, if you want the counter (ordered) to work only if the
count order of 3, 5, 7 is used, enter the value "3 5 7" (no quotes). Furthermore, a trigger_combination_assign entity can pass it's "mangle" value to trigger_counter when it uses it. This way you can have a number of different possible combinations that could be used and only one would be right (depending, say, on which path the player took). The values can be as high as you like (okay, from 1 to 65336), so you can have any number of buttons in this puzzle. (wording lifted from hcode comments via Eutectic, but I have tested it now). |
| spawnflags: |
|