Scanner

An end-game part which can remotely retrieve Microcontroller references to parts, providing information and control. Can also triangulate the positions of enemy parts given enough well placed scanners. It is a craftable and spawnable non-flammable solid.
It consumes 2 power per tick.
It cannot be resized.
At its default size (5x5x12) it has a durability of 1.
By default, its colour is #000000.
It requires 4 AlienCore, 8 Antenna, 2 Diamond, 2 HeatPipe, 2 HeatPump, and 4 Router to be crafted.
Methods
CalculateCost(range) → cost
Calculates the cost of performing a scan with the given range.
The range parameter is a number. It can also be nil.
The cost return is a number.
GetDistance(part) → approximateDistance
Gets the approximate distance to the part. Accuracy falls off exponentially.
The part parameter is a PilotObject.
The approximateDistance return is a number.
GetPartsInRange(range, className) → objects
Does a (power hungry) query for all parts in the configured (or specified) range up to 1024 studs. Can optionally filter for a class name, but many use cases will prefer to store part objects in a set.
The parameters for GetPartsInRange are as follows:
- The range parameter is a
number. It can also benil. - The className parameter is a
string. It can also benil.
The objects return is an array of a PilotObjects.
Locate(part, scanners) → approximatePosition
Uses GPS to locate a part (uses :GetDistance() internally). The scanners you provide should be on different axes and stuff. You need at least 3 to correctly identify a position.
The parameters for Locate are as follows:
- The part parameter is a
PilotObject. - The scanners parameter is an array of a
Scanners.
The approximatePosition return is a Vector3.
Configurables
Range
The default range to scan for parts within. It is a number.
It ranges between 0 and 1024.