Turret Computer

**Turret Computers** are the system computers for Turrets. They are **Required** to create turrets.

## Overview

Turret Computers are the main system computers that allow turrets to function. Each individual turret on an entity must have its own turret computer governing it in order to function. If the turret computer is destroyed or removed then the turret will cease to function.

### Setup

Turret Computers can be placed on any entity however they are only useful on non-Handhelds. They can not be scaled nor expanded and only come in one set size. As a system computer they do not need energy to function however some aspects of its will need power to work.

Once placed, turret computers will need to have several component blocks linked to it in order for it to function. Each turret computer will need to have at least two Mechanisms and a weapon linked to it. Only rotors and hinges count as valid mechanisms for turrets. The linked mechanisms must also be stacked on top of each other as sequential child entities; attempting to link mechanism A and mechanism C while leaving out mechanism B will not work. Turrets with multiple mechanisms linked are called multi-axis turrets and require more setup than a normal turret.

Linking a weapon will determine the turrets "Forward" direction. This means that the turret will always try to face a target with its weapon facing it. At least one weapon must be linked however additional linked weapons will afford the turret more firepower. All linked weapons will be used by the AI in auto turrets. If players want to use the weapons on a manual turret they will need to link an Event Gate to the weapons.

If left as is turrets will be considered an "Auto Turret" and will only function with limited player interaction. If players wish to take manual control then they can link a Yoke to the turret computer. Taking control of the yoke will allow players to control the turret with their mouse. When a manual turret is not being controlled by the player it will act as a auto turret. If players want a turret to be exclusively a manual turret then they should set the targeting mode to "None". Connecting a Camera to a manual turret will automatically switch the player's view to it when they have taken control of it.

### Usage

Pressing **[F]** on the turret computer will bring up its context menu. Here players can configure various settings to fine tune their turrets. The Turrets tracking mode is one of the most important settings as it will determine the auto turret's targeting preferences. Whatever setting the turret is set to target turrets will only target hostile entities (Pirates for example). "Starship Target" will only target what players have targeted while piloting a craft. "Auto" targeting will set the turret to fully autonomous allowing it to attack any target within its range.

Toggling the "Auto Fire" setting will make the turrets attack with their linked weapons; If not enabled the turrets will simply "look" at the targets. Turrets will only actively target enemies when the player has control of the parent entity the turret is on. If player wish to have their turrets endlessly look for targets even when they are not present then they will need to place a Space Station Computer on board and turn on the "Control Turret" setting.

The size of entities which the turret AI will shoot at can be altered with the "Auto Fire Min/Max size" setting. All entities have a size rating which can be seen in their Entity panel in the Codex. This setting allows turrets to only go after certain size ships for instance larger caliber weapons should only attack capital ship instead of trying to hit tiny fighters.

The last setting is the "Use Resting Position" and "Set Resting Position". These settings allow turrets to have a position they return to when there is no more targets or the player has left the controls on the parent entity. This is mostly a cosmetic setting and does not need to be on in order for turrets to operate.

### Turret Computer Menu

 Command Label
 Tracking Mode
* Spaceship Target - Turret will track a target if the target has been selected by the player during flight. Click the middle mouse button to select a target.
* Auto - Turret will track any hostile ship that comes within range.
 Auto Fire
 Auto Fire Min Size
* Cat 0: <30m
* Cat 1: 31 - 90m
* Cat 2: 91 - 150m
* Cat 3: 151 - 210m
* Cat 4: 210 - 340m
* Cat 5: 340 - 470m
 Auto Fire Max Size
 Weapon Range
 Use Resting Position
 Set Current Position as Rest Position

## Event Gate Triggers

 **[Signal] Is Firing** | Sends a logic signal if the turret's linked weapon(s) are firing at a target.

## Tips

* Unlike Starship Computers, turret computers do not need to be on the parent entity in order for its connected turret to function. Placing them on the turret themselves makes Prefabs of turrets easier to set up.
* The **"Is Firing"** event gate trigger will still activate even if every weapon on a turret is obstructed from firing.
* If multiple weapons are placed in different orientations then the turret will randomly choose one to be its forward facing weapon. The AI prefers weapons placed perpendicular to the second mechanism or are horizontal.
* Mechanisms linked to turret computers are prevented from receiving Logic signals. If players wish to have turrets be moved into certain positions before firing then they will need to add additional mechanisms.