List of Logic Circuits

## Overview

This is a list of useful logic circuits and how to build them. This list is not exhaustive and will be continuously added to over time.

## Standard Logic Circuits

These circuits are designed to function as basic logic circuits for more complex builds. They can used in a variety of ways.

### Automatic Door Circuit/Mono-stable Circuit

This circuit opens a door and then closes it after a set time. Players can change the time the door stays open, but 2 seconds is adequate time to walk through a door before it closes.

Players can swap the buttons out for other inputs, such as Laser Sensors or Volumetric Sensors. This circuit can be used for anything that requires it to be on for a set amount before turning off.

### Locking "Doors"

This circuit will allow a door to open from either side, but only when a Switch is off to unlock it.

### RS-NOR Latch

This circuit is designed to activate a device and keep it active until a separate input is pressed to reset the circuit. Additional activations the first input past the first time will do nothing. Only by activating the other input can the circuit be turned off/reset. Perfect for spam proofing delict circuitry.

### ABBA Sequence

This circuit turns on the outputs in order but turns them off in reverse (FILO Sequence). The Red output will flip first and last.

### ABBA Sequence Design 2

The benefit of this design is that players can set different delays for how fast the two outputs are activated/deactivated. An ON signal will trigger the OR gate first and the AND gate second, while an OFF signal will trigger them in reverse. The ON timer determines the delay before the AND gate activates, while the OFF timer determines the delay before the OR gate deactivates.

Suppose the OFF timer has a different time. In that case, the ON timer players must wait for the entirety of the OFF timer to time out before they can correctly turn off the circuit. For example: If the ON timer is 1 second and the OFF timer is 3 seconds, players will need to wait 3 seconds after turning on the circuit if they want it to turn off properly. Turning it off before the OFF timer has timed out will break it.

### ABBA Sequence Design 3

This design has the same functionality as design 2 but can be easily tiled to activate any number of inputs.

### Piston ABCBA Sequence

This circuit is a piston-based FILO sequence that can accommodate more than two outputs. A simple alternative to purely logic-based ABCBA sequences, it has minimal control over the timings between output activations. If players would like to change the timings of each sequence, they will need to change the speed of the piston or use Timer Gates.

If players want to add more sequences, then each intermediate Event Gate will need to have its "Condition Check" set to "Superior." That way, that leg of the sequence only activates when the piston has surpassed the designated threshold. The endpoint of the series (The one that activates last and deactivates first) will need to have its threshold set to just barely under the max length of the piston. If the final output is set to the max range of the piston, it will not activate.

### Signal Holders

This circuit stops or holds a signal, preventing it from reaching the intended destination unless an enable signal is ON. It will store the signal internally until that happens, allowing the circuit to act as a data store. Here, the top input is the setter, with the bottom switch acting as the enable line; the state won't change if the enable is OFF. The top output is the normal out, with the bottom inverted.

### "Pulse" Beam Array/Togglable Logic Clock

This circuit is rotator based logic clock that pulses a signal. This pulse is capable of bypassing the standard cooldown that comes after firing a Beam, allowing it to continuously fire by quickly pulsing the beam. It will continue to pulse until it receives an off signal. **This circuit/weapon effect may or may not be considered an exploit and may be subject to removal in the future**.

#### Setup

Unlike other circuits this one requires some extra work in order for it to function properly.

1. Build circuit as outlined in picture.
2. Unlink the NOR gate from the AND gate.
3. Activate the input so it turns the rotator which will fire the beam.
4. While the beam is firing reconnect the NOR gate to the AND gate.
5. Turn off the input and wait till the rotator has returned to 0 degrees.
6. The circuit is now functional. Further inputs will cause the beam to pulse instead of firing a sustained beam.

## Utility Circuits

These circuits are for more directly useful contraptions that can be integrated into any build.

### Alternating Messages Circuit

This is a simple circuit that is designed to send different messages depending on the state of the input. On signals will send one messages while off signals will send another. Very useful for telling the player if a vague or hidden system is online.

### Auto Target Detection System

This circuit exploits the Turret Event Gate trigger that sends a logic signal when a turret has acquired a target.

The turret must be set to "Auto" targeting to always look for enemies. A Space Station Computer with the "Control Turrets" setting turned on will force the turret to look for targets even if the player is not currently piloting the entity.

### Auto Landing Gear Circuit

This circuit will automatically deploy a ship's landing gear when it requests to dock, keep the landing gear extended while docked, and automatically retract it when undocked. The inclusion of a switch allows players to toggle it manually. This circuit does not differentiate between landing and non-landing pad Shipyards.

When players request to dock, the circuit will extend the landing gear for as long as the configured pulse duration. Should the player take too long to dock, the landing gear will automatically retract, requiring the player to activate the landing gear or try again. Once docked, the signal will keep the landing gear extended. Upon undocking, the loss of the docking signal will cause the landing gear to retract immediately. To delay, place a timer gate between the "Docked to Shipyard" event gate and the OR gate.

### Flip Circuit

This circuit is designed to flip a platform from one side to the other. This can be used to conceal something only to be pulled out at the right time. You can adjust how long the piston stays extended by changing the speed of the utility rotor or change the values on the events gates listening to it.

It can also be used to swap weapons out while still occupying the same space. To switch between weapons make sure to have the other weapon be set as an exclusive fire group.

### Exclusive Controls Circuit

This circuit is designed to allow players to utilize exclusive Yoke Event Gate inputs while seated. Upon taking control of a vehicle the controls switch to those designed for the craft.

#### Setup

For proper functionality players will need to know a few things before setting up this circuit.

* Each chair exclusive event gate must be linked to its own AND gate. That AND gate is then linked to its appropriate output.
* Each Vehicle exclusive event gate that shares a button input with a chair event gate must be linked to their counterpart's AND gate.
* If the chair exclusive controls have more event gate inputs than the vehicle exclusive controls then the vehicle controls must have its own event gate + NOR gate set to prevent overlapping controls issues. For example: A chair has a control scheme of **[Left Mouse Button]**, **[Right Mouse Button]**, **[Hotkey 1]**, and **[Hotkey 2]** while the vehicle only has a control scheme of **[Left Mouse Button]** and **[Right Mouse Button]**. The vehicle controls must then have event gates for **[Hotkey 1]** and **[Hotkey 2]** even if they will not have any use.
* Chair exclusive controls will appear on the control list while piloting a vehicle so its best to set them to be hidden.

### Weapon Exhaust Circuit

This circuit is for a contraption that simulates the accumulation and eventual venting of heat when players fire a weapon. This an entirely cosmetic circuit and has no baring on the heat levels that an entity will acquire when using weapons or other systems.

When players activate the input the weapon fires as normal. As they continue to hold the input down eventually the light will activate; painting the light red helps with the illusion. After the player has let go of the input the vent will activate while the light slowly goes out.

#### Setup

For proper functionality players will need to know a few things before setting up this circuit.

* The circuit is setup so that the vent stays on longer than the light. This is so it looks like theres still trace amount of heat that needs to be released.
* The rotor is functions as the timer for the light and the vent. Decreasing the rotor velocity will increase the amount of time the vent and light stay on.

## Device Circuits

These circuits are for various weapons and devices that can help players win battles or increase the functionality of existing ship systems.

### Sequential Firing Array

This circuit fires off weapons in sequential order. The design on the left is for player usage, while the one on the right is for Turrets. **These designs will propagate the gimble effect found on player-fired weapons to all logic-linked ones**. Including AND gates at the end of each circuit allows for an automatic circuit cutoff when the player/turret has stopped firing.

The sequence should be:

* **Weapon > Event Gate > Timer > AND Gate > Next Weapon**.

If players want to instantly cut off the circuit once they have stopped pressing the fire button, they need to link the "Primary Fire" event gate to all AND gates.

### Piston Grappler

This circuit is for a piston based Mag-Lock grappling hook. When the input is on the pistons will extend like normal. When the player lets go of the input the Mag-lock will engage and lock whatever is in range while reeling it in. Pressing the input again will disengage the mag-lock without activating the pistons again. The circuit will reset after this.

### Repulser Cannon

This circuit is a specialized Mag-Lock array that will attract objects while the input is held down and lock it the moment the button is released. Upon pressing the input again the object will be fired out at great force.

#### Setup

For proper functionality players will need to know a few things before setting up this circuit.

* This circuit makes use of Logic Fields to artificially extend the entity's dimensional boundaries. Gravity is only applied within the boundaries of an entity. In order for the Gravity Unit to function properly the boundaries of the child entity must be expanded.
* Be sure that the attract unit's force is set relatively low while the firing unit is set high. If an object collides with the player's ship it may become logged within making extremely difficult to remove.
* Adjust each gravity unit's boundaries for better results. Switching its field type to "Ship-Wide" will allow the gravity unit to extend to the entire dimensions of the child entity it is on.
* Adjusting the speed of the rotor and the value threshold of the event gate will affect how long the repulsion effect will last.