Coordinate Strings - iimurpyh/pilot-lua GitHub Wiki

Parts like StarMap, Telescope, and HyperDrive send and receive universe coordinates as strings. The standard format for them is as follows:

<Universe X>, <Universe Y>, <System X>, <System Y>, <OnPlanet>

Universe X and Y are integers between -100 and 100 describing where the position is on the universe grid. System X and Y are integers between -10 and 10 describing where it is within the system on that grid space. OnPlanet is a boolean that specifies whether the position is inside the planet in that system grid space or outside of it. Since only teleporters can teleport inside planets, this value is ignored as an input for parts like the HyperDrive. If an OnPlanet boolean is not provided, it will default to false.

For example, here is how you would represent the center of the universe:

local coords = "0, 0, 0, 0, false"

When you receive a coordinate string as an output, it will always follow the above format. When you provide one, the format does not need to be followed - you can put anything before, after, or between each value, as long as there are four coordinate positions and optionally the OnPlanet boolean. For the sake of consistency, it is better to write them in the standard way.

⚠️ **GitHub.com Fallback** ⚠️