Space Engineers

Space Engineers

1,567 ratings
Spug's Easy Auto-Docking 2
74
70
7
2
28
3
5
6
8
4
4
2
3
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
963.162 KB
28 Jun, 2020 @ 4:57pm
26 Nov, 2020 @ 5:26am
23 Change Notes ( view )

Subscribe to download
Spug's Easy Auto-Docking 2

Description
Overview
With a single button to dock, this script will land your ship reliably, while you sit outside on the sun deck sipping a gin and tonic. But don't relax for long, as your ship will be landed in no time.

Easily setup your ship/drone to glide effortlessly to it's home then spin to line up with the saved direction to match up with your OCD. (can turn off the spinning).



This script has a much better code foundation than version 1.0, which is not being maintained. This new script has been totally rewritten, with a much more reliable system.

Please remember to press the rate button - it really helps bring in more people.
I hope you enjoy!

How To Use
  • Load the script, check it says "Initialized", then it's ready.
  • To save a docking location, land onto a connector (connector should go yellow or green), come up with an exciting name for this home location and put it into the "Argument" field of the programming block.
  • Press Run. Now this location (and direction for small ships) will be saved.
  • To dock, if you press Run with a particular argument, it will fly and land at that saved location.

Docking To Mobile Ships
To allow this script to dock to mobile ships, an extra script is needed to be placed onto the mobile home ship. This script can be found here:

( https://steamproxy.net/sharedfiles/filedetails/?id=2155667657 )
This extra script also enables you to use drone recall. This is explained more in the script description.

Using Waypoints
  • To enter waypoint placement mode, use the argument: record
  • Decide on a name for this docking location and run it as the argument.
  • Now, every-time you press Run, it will record a new waypoint in space. (The argument doesn't matter ** ).
  • Record waypoints leading up to the desired connector, ensuring the final waypoint is above it. This stage is easiest if you have the script on your hotbar.
  • Land onto a home connector and press Run to finish the recording mode.
  • Running the script with the name you saved will make the ship follow those waypoints to the home connector.
** The argument in the recording stage doesn't matter, unless you use one of these two arguments:
!nospin -If this argument is used when recording a waypoint, the ship won't rotate when moving to that waypoint.
!NUMBER -Where NUMBER is any positive number (e.g. !3.5). if this argument is used when recording a waypoint, the ship will travel at this maximum speed when moving towards that waypoint.

Features
  • Adding [dock] to the name of a timer block will make this script trigger the timer block immediately upon landing. Great for turning off/on landing lights or more advanced automation.
  • Adding [dock] to the name of an LCD panel will make this script output it's text onto it. (as per Gromit's idea)
  • Adding [recall dock] to the name of a connector will make the script ignore it, but other auto-docking ships can still dock to that connector. This is useful for recalling drones onto your mothership, without the mothership seeing them as docking locations itself.
  • Putting !readonly in front of an existing argument (E.G !readonly Home1) will mean that saved location won't be overwritten if you are connected to a connector. E.G Home1 will not update to any new connector.
  • Adding [start dock] to the name of a timer on your ship will be triggered whenever a docking procedure is started.
  • Small ships by default will rotate on the connector to face the direction the home location was saved in, in case there's some cool direction you like. There's an option to make ships rotate on their approach to the connector too.
  • Using the optional home script, the docking ship can take mothership velocities and accelerations into account, so if you speed up and slow down during the docking sequence, it'll give it a jolly go. What's more, it won't get frustrated at you like a petty human would.
  • Works with small and large ships, in planetary atmosphere and in space.
  • Most importantly, this is reliable, even with unexpected thruster loss mid-way through this script is designed to cope (unless all the thrusters on one side are lost).
  • This script is fast: I've programmed in a mathematical model of ship thrusts, allowing it to look at what the maximum possible speeds are on docking approach and choose the fastest acceleration. In nearly all cases it will be much faster than a human could possibly manage. (especially in "Breakneck" speed mode)
  • There are multiple speed settings and other changeable settings if you open the script.



Speed Modes
These are changed by pressing "Edit" - it'll take you to the code. At the top of the code, there's some changeable variables you can fiddle with. The top-most one is the speed setting. It can be set to either 1, 2, or 3.
  1. "Cinematic" - This is great for larger ships, as faster speed modes can look odd when a huge ship shoots towards the connector, when normally it would be a bit more... cinematic. This limits the ship to 10m/s and the acceleration to roughly 8m/s^2 instead of 12m/s^2 - 15m/s^2 .
  2. "Classic" - Optimised to be both fast and safe for all types of ship, big or small. The ship is limited to the Top Speed variable (default: 100m/s).
  3. "Breakneck" - The ship will land as fast as it deems safe. This can be pretty quick, for example it likely won't slow down for the approach to the connector until the very last possible milisecond. This can however, be similar to "Classic" if your ship setup can't reach the maximum acceleration anyway. The ship is limited to the Top Speed variable (default: 100m/s).

User Interface Script

PSYCHO has made a great user interface script for handling many docking locations. It automatically syncs with the autodocking script's memory and allows you to save many connectors and bases without your hotbar being filled more and more.
Link to his script:
https://steamproxy.net/sharedfiles/filedetails/?id=2192527407

Extra Info
Here's a GitHub page with some more info in for you technical folks out there.[github.com] It's got the source code in too, and the readme has some exciting text for you to read.

Hier ist ein großartiges deutsches Tutorial für das Skript von FreakyMuffin: https://youtu.be/XKc65Yx33Lw

Thanks to:
- Malware for his great MDK which I used to write this code.
- Whiplash for some gyro PID controller code.
- Ares for use of his ships in the pictures and video.
Popular Discussions View All (18)
135
14 Dec, 2024 @ 11:29pm
PINNED: Spug's Bugs
Spug
2
26 Nov, 2024 @ 7:54pm
Not Returning to Player control after Docking
Ghosthaunter408
12
21 Sep, 2022 @ 3:02pm
Ship wont avoid collisions.
Syphond
855 Comments
LootGoblin 26 Nov, 2024 @ 8:02pm 
@Spug the video tut is no longer available, you might want to kick it out off from your Extra Info section, if you ever read this -.-
LootGoblin 26 Nov, 2024 @ 8:00pm 
@The_Bum_Dave
Probably the same issue like "Not Returning to Player control after Docking" in the discussion section. Unfortunately this is a thing since ages.
The_Bum_Dave 13 Nov, 2024 @ 8:25am 
When I disconnect from a connector I have to recompile the script to regain manual control.
LucaZanna 3 Nov, 2024 @ 10:20pm 
Hi, I have a connector attached to a piston. I'm either missing something or it's not possible to auto dock thought a piston>connector=connector<ship(main grid)
Gromit 31 Oct, 2024 @ 8:13pm 
@MetalGodX: it's a script, not a mod. It must not be loaded in the mods list for your world but from programmable blocks.
Hope this helps
MetalGodX 31 Oct, 2024 @ 4:45pm 
Does this mod still work? I get an error when I load into my server. Says "Some mods were not loaded because of errors"
URDADSBOYFRIEND 22 Oct, 2024 @ 4:12pm 
Does it work with gravity drive?
Martin Rayleigh 18 Oct, 2024 @ 6:15am 
Is there a command/argument to stop/cancel a docking sequence ?
Cerberusska 凸(^_^)凸 5 Oct, 2024 @ 2:28pm 
not working with modded Thursters :/
Misha 23 Aug, 2024 @ 4:03am 
does it work with Relative GPS?
I'm working on something like that. But, it's complicated script like you. It need alot time.
I using two scripts: one script send GPS by Antenna, second ready and AutoDocking.
My script can park in hig-velocity. But I have not complite yet.
I see you have done it.
So, should I continue my? can your ship dock to the moving ship?