Space Engineers

Space Engineers

68 ratings
NAV Autopilot [OBSOLETE]
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
4.416 KB
14 Jan, 2015 @ 12:20pm
6 Apr, 2015 @ 8:25pm
11 Change Notes ( view )

Subscribe to download
NAV Autopilot [OBSOLETE]

Description
Deprecated
This script is no longer being maintained, and in its current state will no longer compile due to Space Engineers script changes. There are many better options available now, such SAMv2: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1653875433


NAV Autopilot

Autopilot in-game script that will fully steer and fly your ship
from point A to point B (and C, and D, and...).

Coordinates and other instructions are easily given without editing code.

Supports multiple waypoints, as well as patrolling (i.e. continuously
looping over a series of waypoints). Can also limit ship speed.

Gives feedback via antenna/beacon (or any named block), both for status
as well as error reporting (such as if a required block is missing).

Will automatically shutdown and stop ship if problems are detected
during flight.

Note: While flying your ship, this program will make several stops along
the way. This is normal, and is done to ensure that it won't overshoot
the destination, even if you are using a speed mod and your ship can't
slow down very fast.



Ship requirements

Four named blocks, next to each other in specific pattern
Can be any type of block, so long as you can stack and name them

Block 1: "NAV Center"
Block 2: "NAV Back" (directly behind NAV Center)
Block 3: "NAV Up" (directly on top of NAV Center)
Block 4: "NAV Right" (directly to the right of NAV Center)

Group called "NAV Thrusters", containing all rear-facing
thrusters that the program should use to move the ship forward

Programmable block, named "NAV Program"

Timer block, named "NAV Timer"
Single action set to run NAV Program

(Optional) Named block, name starting with "NAV:" followed by instructions
See below for instruction list

(Optional) Text Panel or LCD Panel, named "NAV Instructions"
Public text contains instructions
See below for instruction list

(Optional) Named block, named "NAV Status"
Used to report navigation status or error messages
If the "NAV Status" block is a Text Panel or LCD Panel, the status
messages are written to the public text rather than the block name

All gyros must be mounted on the floor, facing forward
The front of the gyro contains a round knob and/or control panel

(Optional) Group called "NAV Gyros", containing all gyros that the
program should use to steer the ship. Useful when docked with
another ship that doesn't have proper gyro orientation. If group
doesn't exist, all gyros are used.

(Optional) Named block, named "NAV Enable"
Used as a kill switch. If block exists, and is powered off, autopilot
will shutdown and stop ship. Useful to bind to the toolbar
when you are riding within the ship.

Keep inertia dampeners ON at all times.


Navigation instructions

Multiple instructions can be given in a sequence, separated by semi-colon
or new line. A space is required between the instruction letter and any
parameters you pass to it.
There is currently an arbitrary limit of 32 instructions.

C <text>
Comment, to help label your instructions.
Has no effect on the program. Does not count towards instruction limit.
D <distance>
Sets the arrival distance (how close to get to the destination), in meters,
for the next waypoint.
Distance can be a single number, which the ship will try to reach, or it
can be two numbers separated by a comma, representing the minimum and
maximum distances allowed (i.e. 50,100). Because min/max ranges are less
precise, the ship is often able to arrive at the waypoint with fewer
stops along the way.
Distance is measured from the "NAV Center" block, so if that block is in
the back of your ship, you'll need to increase the arrival distance by at
least the length of your ship (in meters, not blocks).
Also note that this value is an estimate, as the program doesn't know
exactly how fast your ship can decelerate, so giving yourself 50-100m
additional padding is a good idea until you get a feel for it.
Default value is 50,100 (50m min and 100m max).
L
Loops back to the first instruction. All instructions before this one
will be repeated indefinitely. All instructions after this one will be
ignored.
P <seconds>
Pauses the script for the specified number of seconds. The script will
still be running and in control of the ship, but it will sit idle until
the specified number of seconds have passed. After the time has passed,
it will continue on to the next instruction.
Q
Toggles quick waypoint transitions.
By default, when the ship arrives at a waypoint, it will come to a
complete stop before turning to face the next waypoint. Enabling
quick transitions will make the ship start turning to the next waypoint
immediately on arrival, without waiting to stop. This speeds up
waypoint traversal, but makes the followed path less precise, which
may be a problem for large slow ships near obstacles.
This instruction can be used multiple times to toggle on or off for
specific waypoints. Toggled setting will apply to the end of the next
waypoint.
Default value is off.
R <coordinates>
Like W, but coordinates are relative to current ship position (or
relative to the last waypoint, if there was one). For example,
coordinates 100,0,0 would move the ship 100 meters along the X axis from
it's current position.
S <number>
Sets the maximum ship speed, in meters. If set to 0, no limit is enforced.
Because the game doesn't provide a reliable way to measure ship speed,
it has to be estimated. Therefore, the actual speed that the ship limits
itself to may be up to 20% lower than what you set, and depends on server
load and simulation speed.
Default value is 0.
W <coordinates>
Adds a waypoint, at the specified coordinates. Coordinates are a set of
three numbers, separated by commas (i.e. 123,456,-78) or colons
(i.e. 123:456:-78). The last waypoint given (or only waypoint, if only
one given) is the final destination.
+ <block or group>
Turns on the specified block or group.
- <block or group>
Turns off the specified block or group.


EXAMPLE:
To have your ship patrol back and forth between coordinates 100,200,300 and
-1100,700,-123 and try to stop 200m from each point before going to the next,
your instructions would look something like this:

NAV: D 200 ; W 100,200,300 ; W -1100,700,-123 ; L

You can add comments, and you can even set a different speed or distance for
each waypoint:

NAV: C This is a test;S 200;D 500;W 100,200,300;S 100;D 0;W -1100,700,-123
151 Comments
Decimal 5 Nov, 2016 @ 1:22pm 
This is kinda useless with the autopilot now though. It basically does everything your script does in better. It doesn't need to stop because it can calculate the whole thing, it's easier to handle and has collision avoidance.
Federal 15 Mar, 2016 @ 2:03am 
I know this isn't the most reliable way of doing this but I got these errors when I checked the script

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=645727084 (Screenshot 1)
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=645727039 (Screenshot 2)

When you can get back to me with the issue here. Thanks
Mjello 13 Feb, 2016 @ 5:11pm 
Great script. However the game becomes veryvery slow when I activate your program ... Any idea why that may be ?
Wicorel 24 Sep, 2015 @ 11:48am 
I have received permission to publish my updated version of the script here:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=523965418
Ekonant 21 Aug, 2015 @ 1:09pm 
For some reason your script now fails to compile ? Did I do something wrong or did a recent update break it ?
Floki 5 Aug, 2015 @ 11:37am 
True I realized that after I played Space Engineers with the update for 1000 hours, I just never got back to deleting the comment.
Nairou  [author] 23 May, 2015 @ 6:10am 
Shotblocker: The autopilot in the recent update is very basic. My script can still do a lot more than that.
Floki 23 May, 2015 @ 5:19am 
I hope you guys realize this is sort of obsolete since the update on the 21st.
Nairou  [author] 20 May, 2015 @ 6:16am 
And for anyone who hasn't noticed, I updated the description to link to the new version of the NAV Autopilot script I'm working on. It is a significant update, so I've posted it as a separate script in order to not break any current ships. It is still a work in progress, but already far superior to this first version.
Nairou  [author] 20 May, 2015 @ 6:05am 
TheTreeman: Awesome, thanks!