Code Bits

From TRLE Wiki

Jump to: navigation, search

Code Bits are the buttons you will find in the OCB menu and in triggers. They are normally used to activate and deactivate objects. Some objects have a hardcoded effect with codebits.

Contents

[edit] Setup

By default, an object is activated when all 5 codebits are triggered. The most common way to activate an object is using a trigger. In the following image, on the left (small buttons) you will see the codebits set in the OCB menu. On the right (large buttons) you see the buttons in the trigger. The following OCB + trigger combination will activate the object.
Image:Codebit1.png

A less common way but which does still work is this:
Image:Codebit2.png


[edit] Multiple triggers

As you can see, the object activates when all 5 codebits are on, and not from the trigger itself. This way you can have 2 triggers that activate 1 object. Both have to be triggered for the object to become activated:
Image:Codebit3.png


[edit] Multiple objects and multiple triggers

By combining the second and third example, we can get an even more advanched setup. Both triggers activate 1 object like in the previous example. But now both triggers each activate 2 other objects as well. This trick can, for example, trigger a flame above a puzzle hole when the puzzle is inserted, and when both puzzles are inserted, open the door. The 2 other objects only need to be triggered below the trigger that actually activates it. The code bits that should normally be triggered with the second trigger are now checked in the OCB menu:
Image:Codebit4.png



[edit] Switch puzzle

Another good example of code bits are the switch puzzles, where you have to pull the correct switches to activate something. With switches, code bits work in the way "ON" + "ON" = "OFF". So if you trigger the same code bit twice, it will be in it's original state again. This way you can force the player to pull the correct switches. Take a look at the following example:
Image:Codebit5.png

If you look, you will see that switch 1 & 4 together will cause all 5 codebits to be on. If the player pulls all switches, codebit 1 will be on, however codebits 2, 3, 4 and 5 will be triggered twice so they will be off. The object will only be activated if the switchs 1 & 4 are pulled and the 2 & 3 are off.


[edit] Advanched switch puzzle

If you know all of above, it is now easy to make a advanched switch puzzle with multiple combinations. As explained in the previous section, if all switches are pulled it will just enabled just code bit 1. So if you have a door with code bits 2, 3, 4 and 5 pressed in the OCB, that door will open if all switches are pulled. And if you pull the switched 1 & 3, code bits 2, 4 and 5 will be activated. Code bit 1 is not triggered, and 3 is triggered twice so will stay off. So a door with code bits 1 and 3 pressed in the OCB will open when switches 1 and 3 are pulled.

Below you will see this setup. There are 3 doors, and 4 switches. Each door is triggered below each switch. Below the switch there is a SWITCH trigger with the correct code bits pressed. Doors will close again when not all 5 code bits are active anymore, so no more then 1 door is opened at a time.
Image:Codebit6.png


[edit] Supported objects

Triggering of nearly every object, as well as flipmaps, is done with code bits. Flipeffects however are do not work with code bits. In fact, a flipeffect is triggered each time 1 or more of the codebits are activated, so instead of having 2 triggers activating a flipeffect, the flipeffect will be activated twice.

Also, enemies are not antritriggered when the codebits are no longer all on. The rule "ON" + "ON" = "OFF" with switches still applies, but once the 5 code bits are on, the enemy will stay alive until killed.

Finally, with flipmaps, you don't have an OCB menu. So it is not possible to enable one or more code bits like in the advanched switch puzzle. You can use the FLAME_EMITTER2 instead to trigger the flipmap. However, the FLAME_EMITTER2 acts like a FLIPON trigger and will not flip the room back when the 5 code bits are no longer on, which a normal FLIPMAP trigger does. The best solution is to pre-trigger the FLIPMAP before the puzzle with the code bits that normally should have been in the OCB menu.

Personal tools