Unblock chains - Part 1
How to set up complex chains of events
Hexen II offers a wide range of powerful entities, allowing mappers to express all their creativity, build complex mechanisms and obtain spectacular in-game outcomes. The vanilla game is packed with diplays of bravura: the opening of Loric's tomb, the giant statue falling down in tower - Tower of the Dark Mage, the initialy empty room in keep1 - Eidolon's Lair suddenly filled with a mezzanine, stairs and columns, etc.
Youtuber Degorram disconcerted by the fancy tomb opening scripting
This article is all about getting started with the basics...
Trigger_relay
If there's only one to remember it's trigger_relay. Its job is pretty simple: when it's triggered, it triggers its own targets in turn. Simple but essential because it's how one single action can trigger a whole set of entities with different targetnames.E.g.:
- An initial trigger points to target "t1".
- 3 trigger_relays share the targetname "t1" and point to targets "t2", "t3" and "t4" respectively.
- So when the initial trigger is fired, thanks to the relay mechanism "t2", "t3" and "t4" are fired.
A few interesting properties:
trigger_relay | |
---|---|
delay | Once the trigger has been fired, how long (in seconds) it waits before firing its targets |
wait | Once the trigger has been fired, how long (in seconds) it waits before being able to be fired again (please notice the nuance) |
message | An optional text printed in the middle of the player's screen upon the trigger's targets firing |
Actually there's nothing you can do with a trigger_relay you wouldn't be able to do with a trigger_multiple entity as well. The difference revolves around the trigger_multiple being a brush entity, contrary to the trigger_relay which is a point entity. Both have their use, which is generally not the same:
- trigger_multiple is defined by its shape within the 3D world and triggers things when the player enters its volume/touches it.
- trigger_relay has no dimension and cannot be touched. It isn't self-sufficient and needs to be fired by something else, to start with.
Time for a digression about long sequences now... Click on the emoji to collapse this section if you prefer to pass. |
Usually when the player triggers something, the triggered event is pretty simple and takes relatively no time: a door opens, a platform moves, stairs raise, etc. But on some occasions the chain of events triggered may take a bit longer because it involves several sub-events happening in sequence.
Let's have a look at that memorable puzzle in Portal Of Praevus:
In a similar situation, there might be more actions to perform and each of them might take longer. If so, and if each of them is time positioned in relation to the zero point, when as a mapper you'll be testing the sequence you'll have to trigger it from start because the start is the key to everything afterwards. Unless it takes really few iterations to set up things properly, after just a few of them it might become boring and time wasting to just see the whole sequence again and again.
The trick is to define multiple "zero points" inside the sequence for each key moment with a corresponding targetname, in order to make sub-sequences. The player will trigger the initial lever only and see the whole smoothly flowing from one key moment to the next. But you mapper will also be able to directly trigger any individual key moment as well thanks to a "debug trigger" which won't be included in the final release. For example, in the sequence above you might focus on the "paddle wheel" thing without having to watch the gears and wheel stopping each time.
From the previous explanations you should see how trigger_relay allows that very easily.
Let's have a look at that memorable puzzle in Portal Of Praevus:
Dego is awed by the scripting possibilities of Hexen II!
- The view switches to camera mode.
- The gears stop rotating.
- The view switches to a second camera.
- The Wheel of Time stops rotating.
- The wall's "paddle wheel" brings in the Jewel of Buddha.
In a similar situation, there might be more actions to perform and each of them might take longer. If so, and if each of them is time positioned in relation to the zero point, when as a mapper you'll be testing the sequence you'll have to trigger it from start because the start is the key to everything afterwards. Unless it takes really few iterations to set up things properly, after just a few of them it might become boring and time wasting to just see the whole sequence again and again.
The trick is to define multiple "zero points" inside the sequence for each key moment with a corresponding targetname, in order to make sub-sequences. The player will trigger the initial lever only and see the whole smoothly flowing from one key moment to the next. But you mapper will also be able to directly trigger any individual key moment as well thanks to a "debug trigger" which won't be included in the final release. For example, in the sequence above you might focus on the "paddle wheel" thing without having to watch the gears and wheel stopping each time.
From the previous explanations you should see how trigger_relay allows that very easily.
· · · End of digression · · ·
Let's have a last time Degorram be our guide to introduce an eloquent illustration of it:
Thysis' worst crazy-driving puzzle (dead heat with the buggy "Eyes of Horus" chessboard)
What basically happens behind the scene is that, thanks to relaying, the button triggers both the wheel and a trigger_message_transfer (let's call it A) which changes its activator relay's target to the next trigger_message_transfer (let's call it B). Next time the button is pressed, it will triggers the wheel and B. Then the time after the wheel and C, and so on until it has gone full circle back to A.
The diagram above shows a simplified version of how it's set up at design time then what actually happens in-game. We can imagine that A issues a message about Taurus, B about Isis and C about Aries. We could also imagine a variant where not only a message is printed out but some brush entities also move. E.g. there could be 3 doors called A, B and C; the set up above would then result in door A opening upon first button press, then door B upon the next press, then door C...
Want to ask for clarification, report an issue with this trick or propose another one? Drop me an email If you use the trick please credit me and put a link to this website.