mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-08-03 19:17:27 -04:00
Created Component/Navigation (markdown)
parent
c504fead81
commit
c155926942
10
Component-Navigation.md
Normal file
10
Component-Navigation.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
This is the component provided by the [[Navigation Upgrade|Items#navigation-upgrade]].
|
||||||
|
|
||||||
|
Component name: `navigation`.
|
||||||
|
Callbacks:
|
||||||
|
- `getPosition(): number, number, number or nil, string`
|
||||||
|
Gets the current relative position of the robot. This is the position relative to the center of the map item that was used to craft the upgrade. Note that the upgrade can be re-crafted with another map to change it's point of reference. Returns `nil` and the string `out of range` if the robot is too far away from the point of reference (i.e. when it is out of bounds of the map that was used to craft the upgrade).
|
||||||
|
- `getFacing(): number`
|
||||||
|
Gets the current facing of the robot, as one of the `sides` constants.
|
||||||
|
- `getRange(): number`
|
||||||
|
Gets the effective range of the upgrade. If the absolute value of the relative X or Z coordinate becomes larger than this, `getPosition()` will fail.
|
Loading…
x
Reference in New Issue
Block a user