Combination Lock

First, create several items:

– one physical/Gizmo/Gauge/Odometer
– 2-10 physical/Gizmo/Switches/Buttons/NumberButton
– one fnord/TrapTrig/QuestVarTrigger
– An item (eg. Door) you can control with a ControlDevice Link.

After placing these in a level, we do the following.

1 – Add a property Trap/QuestVar to the Odometer and give it the argument “door_combo” (no quotes)
2 – Repeat step 1 for all the NumberButtons
3 – Add the property Shape/TxtRepl r0 to all of the NumberButtons. The argument for these is “obj\txt16\button0” (no quotes), where of course the button0 will always be replaced with the number of the button you want, button1, button2, button3, etc…

NOTE: The ‘door_combo’ thingamajic actually looks to the texture of the button to see which number is being pressed! So you must change the textures for this to work.

4 – Add a property Trap/QuestVar to the QuestVarTrigger and give it the argument “1138:door_combo (YES, a QUOTE goes to the beginning but not the end! Kinda like cheap French literature.)

OBVIOUSLY, you should replace 1138 with the combination you want to use, or we’ll have the combination 1138 in every fan mission…

5 – Add a ControlDevice link from the QuestVarTrigger to the item you want to control with the code.

Presto. It’s a very simple system, and I think we’ll be seeing a lot of these in coming FMs. Keep in mind that there can be only one of these setups in a single mission (or, you can have many… just that all the numberbuttons control every odometer). You can, however, control 9999 different things with it.

There remains one problem, though. For some reason, in my test mission, the number textures of the buttons look messed up. Can anyone suggest a fix?

About this entry