Elevator Lights

This tutorial for Thief II is about using Sources & Receptrons to make elevator lights which light up when an elevator reaches a certain floor. The setup is rather simple and can be easily varied to make all kinds of things happen when a moving object arrives at (or passes) a certain location.
This is for advanced Dromeders. There’s also a DEMO LEVEL to accompany the tutorial.

This tutorial assumes you already made a working elevator. If you don’t know how to do that, please consult an appropriate tutorial or explore the demo level. It’s not too hard to understand. It basically consists of an elevator platform, a set of TerrPts linked by TPath links and a couple of buttons linked to the TerrPts via ControlDevice links.
I also assume you know how to set up a light switch. If you don’t, please read the tutorial here at Dromed Central.

Ok, let’s get to work!

1.) A New Stim

Open the Object Hierarchy, select Act/React stimuli and add a new stim. Name it ElevStim. Set and save the gamesys. Go to game mode once, then back to the editor. This is necessary to make Dromed recognize the new stim (at least it was for me).

2.) Making the Elevator a Stim Source

Edit the properties of the elevator platform and add a Source to it. Set the parameters as follows:

Object: number of the elevator platform
Stimulus: ElevStim
Propagator: Radius
Intensity: 1

Edit Shape:

Radius: roughly half the width of the elevator shaft (I’ll explain that later)
Flags: Line of Sight
Dispersion: None

Edit Life Cycle:

Flags: No Max Firings
Period: 500
Max Firings: 0
Intensity Slope: 0

3.) Lights and Switches

Create one light for each TerrPt the elevator comes by and place them at the desired locations. I used ‘DecoBulb’ in the demo.
Create one lever for each light and set them up as light switches. Every lever should now have a ControlDevice link to the light it controls.

4.) Making the Switches react to the Stim

Edit the properties of each lever and add a Receptron for the ElevStim. Set its parameters as follows:

Object: number of the lever
Stimulus: ElevStim
Min Intensity: No Min
Max Intensity: No Max
Effect: Tweq Control
Target Object: Me

Edit the effect as follows:

Type: TweqJoints
Action: DoForward
XtraBits: On

Now the levers will turn on their lights whenever they receive the ElevStim.

The next task is to place the levers close to the path of the elevator so that they will be stimmed if the elevator comes by. Now the radius parameter mentioned in section 2 becomes important. In order to get the best-looking effect, the lights should be turned on only if the elevator is very close to the stopping point of the floor the light belongs to, and should go out shortly after the elevator has started to move on.
To achieve this, it’s best to
– place the levers in the X/Y direction in a way that the edge of the bounding box of the passing elevator platform intersects with the bounding box of the lever.
– place them at the same Z height as the TerrPt where the elevator stops.
– set the stim radius to half the width of the elevator bounding box.

If your lights don’t turn on, increase the radius slightly or move the levers closer to the elevator path.

Ok, now the lights get turned on when the elevator comes by, but how do we switch them off again? Well, by…

5.) Making the Switches turn off automatically

Create a revert trap for each lever. Make one ControlDevice link from the lever to the revert trap and one from the revert trap back to the lever.
Edit the properties of each revert trap and add the Script/Timing property. Enter 1000 as the timing value. This value must be a good deal greater than the firing period of the Stim Source.
Add the Script/TrapControlFlags property to each revert trap and set it to ‘NoOff’.
Now if a light is switched on, the lever will trigger the revert trap, which will switch the lever (and the light) off again after 1 second. The ‘NoOff’ parameter prevents the revert trap from being re-triggered by the lever going to the “off” position. Otherwise the lever and the trap would continuously trigger each other and the light would start blinking.

6.) Hiding the Switches

Edit the properties of the levers and add Renderer/RenderType. Set it to “Not Rendered” to make the levers invisible. The sound of the moving levers will still be present, but the elevator usually makes so much noise you can hardly hear it.


About this entry