Space Engineers

Space Engineers

Spug's Easy Auto-Docking 2
869 Comments
Gromit Oct 19 @ 1:30am 
@Chookie: you should recompile, the timers will then be taken into account :se:
Chookie Oct 18 @ 5:05pm 
The timer block does not work after docking. ive added [dock] to the name of the timer block
abud Oct 9 @ 10:50pm 
@matthew
For anyone who use small inset connector, you can make it work by reducing size of connector in the script. Find this
CubeGrid.GridSize*0.5
change into this
CubeGrid.GridSize*0.5-0.15
This will have implications to other connectors too, I believe. I only test vanilla normal connector and inset connector, any modded connector might not work properly if you change this. Or maybe now works where previously not. I believe correct method should be checking from connector models or something, not just guessing from grid size. But hey, this way simpler and works.
Try other values, 0.1 sometimes fail and 0.2 on large connector little too much bump for me. You will need to re-record your dock after editing, automatically overriding previous saved calculation.
Upscale135 Sep 8 @ 9:20am 
does this script auto drain ship cargo when docked ?
matthew Aug 18 @ 11:55am 
Hi there, I have a small grid with a small inset connector on the back trying to dock inside a hangar of a large ship, also using a small inset connector. The script works amazing! Only thing though, it aligns perfectly to the connector but doesn't go yellow... I am trying to make a drone carrier, so I would love it if i can get it to get within lock range. any ideas how?
Cor Blimey Aug 6 @ 9:06am 
A workaround is event controller that disables override (for thrusters and gyros) when connector connects
Cor Blimey Aug 6 @ 9:05am 
@reigdaer - yup I'm now having this issue too. I think may be related to using Flatmos - I don't recall having it on my old designs, but since I started rebuilding with flatmos i have it..
Reigdaer Jun 24 @ 8:35pm 
hi there i notice that some of my ships keeps the thruster overwrite from the script after they dock, it does not happens to al ships, but those ships who has that "bug", always have the same issue
Sined May 23 @ 10:57pm 
Hello!
Strange... I installed two programmable blocks, loaded the script twice into each. I wrote down the ToBase route for the first one, and the ToMine route for the second one.
I launch ToBase or ToMine, the ship flies to the last recorded dock. Apparently something broke in the game.
HeWhoTypes May 14 @ 9:58pm 
Question. I got this to work on a small grid ship, can't get it to work on the large grid ship, set it up the same as i did on the small grid. not sure what i am doing wrong. Does this work on large grid ships?
Zac May 11 @ 1:49pm 
When I run this on a PB on the ship it says docking location saved, but as soon as I unlock the connector "run" on the PB is greyed out?
(_KsR_) Mar 10 @ 2:19am 
Это выглядит очень мило
Gromit Mar 5 @ 8:22am 
Hi @Spug, I noticed an incompatibility problem with the newly released AQD - Airlock Connectors . I recreated an empty world with only this mod and used your script to record the docking location and when I try to auto-dock the 2 large 3x3 connectors won't connect, there's a gap of a little bit less than a block between them. It's however possible to complete the docking operation manually, just giving the last "punch" to dock. Any idea where this could come from and what could be adjusted to make it work (if possible) ?
Thanks :se:
MERLIN Feb 10 @ 8:19am 
Tell me, please, does this script only work for docking pads in open terrain? I have a hangar on my mothership, and the drone should fly into its entrance. However, the drone rests against the wall of the hangar.
LootGoblin Nov 26, 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 Nov 26, 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 Nov 13, 2024 @ 8:25am 
When I disconnect from a connector I have to recompile the script to regain manual control.
LucaZanna Nov 3, 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 Oct 31, 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 Oct 31, 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 Oct 22, 2024 @ 4:12pm 
Does it work with gravity drive?
Martin Rayleigh Oct 18, 2024 @ 6:15am 
Is there a command/argument to stop/cancel a docking sequence ?
Cerberusska 凸(^_^)凸 Oct 5, 2024 @ 2:28pm 
not working with modded Thursters :/
Misha Aug 23, 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?
phfor Aug 12, 2024 @ 11:38pm 
That's because it's a script, not a mod, Barz
Barz Aug 8, 2024 @ 4:58pm 
The mod does not appear in the mod selection in the main menu
Grog Jul 24, 2024 @ 2:55pm 
Should look at PAM (path auto miner) which is also a cargo automation between 2 connectors.
Rage Jul 23, 2024 @ 8:10pm 
Is there a way to automate this with timer blocks? I was looking to make an auto cargo drone to ferry ice from my mining rig to my base, but whenever I trigger the programable block via a timer block, it doesn't run, and I then have to recompile the script before I can trigger it manually.
Reigdaer Jul 2, 2024 @ 8:30pm 
just to let you know, if you use event blocks, not set them to auto charge batteries, the thruster dont get reset after you connect and the next time you disconect, you are going to fly away randomly
HaVoCxCoBrA May 25, 2024 @ 12:49pm 
Hey, just downloaded the program, heard good things about it. But I can't get it to work with ships that have modded thrusters.
Come and See May 8, 2024 @ 2:55pm 
I figured it out. You just run the same argument twice. So I run basedock into the argument field and it saves it then I run it again. Also, make sure the custom data is completely wiped out on the program block. The script wasn't working properly for me because my PB had custom data from another script.
Come and See May 6, 2024 @ 7:17pm 
How do you even use this script? There's literally no videos/tutorials and it just says "press Run with a particular argument" ... what is the particular argument?
nalog_15 Apr 12, 2024 @ 9:23pm 
Gods bless you! After whole night fighting with AI blocks Ive found holy grail🖤 thank you🤗
Darth Porgus Mar 11, 2024 @ 4:20pm 
Can you use this script in conjunction with PAM to create faster and more reliable docking, while still using the PAM script or a other script to automate the mining process? If so, how can you achieve that?
Jogador Pedrão Mar 9, 2024 @ 4:07pm 
Does this still work?
DigitalContent Feb 11, 2024 @ 10:06pm 
*FIXED*
To Remove known locations , run an argument "clear" + name of location

i had to look that the source code as it's not stated anywhere
DigitalContent Feb 11, 2024 @ 9:08pm 
Is there a way to clear all docking locations ?
Stollie Jan 12, 2024 @ 8:00am 
@Gromit, Thanks mate, its all good, I ended up writing my own code to fly to a waypoint above the connector with collision avoidance on and precision mode using the remote control then calling this script from that script once it arrives to land, works pretty well :)
Gromit Jan 3, 2024 @ 10:53am 
@Stollie: try editing the script and change the value of "connector_clearance" (don't forget to recompile). This should solve your problem :se:
Stollie Jan 3, 2024 @ 9:30am 
Hey Spug, is there a way to make them go to a certain point above the connector before descending without waypoints?

I'm finding when I move the carrier ship they can end up ramming into it before getting to the connector.
Stollie Jan 2, 2024 @ 8:11am 
Oh never mind I figured it out, you need to recompile AFTER adding the tags, it doesn't do a dynamic search?
Stollie Jan 2, 2024 @ 7:26am 
Hi Spug, I'm having issues with [start dock], I have a timer on my ship called "[start dock] - Drone1" and its not triggering when I start docking, otherwise ship docks just fine.

Anything obvious I'm doing wrong?
Merii Dec 5, 2023 @ 7:21pm 
Is there a way to handle the connectors by name instead of entity ID? I'm on a server and hangaring/unhangaring a grid means that the entity ID or something changes which means I need to set the docking location up every single time I log on.
Axlion Dec 3, 2023 @ 4:25am 
Instructions unclear, block just keeps saving the location to dock at by the argument name. Might be partly because the docking instructions say "press Run with a particular argument" without saying what the particular argument is. Also I have multiple connectors but am trying to use just one with this, the program maybe mistaking the small ship I have docked as the one I'm trying to save the location of.
:D Nov 29, 2023 @ 7:25pm 
Bro i love you thx alot!!!!!!!!!!!!!!
Unruly Sep 28, 2023 @ 10:55am 
So, spug seems to lose the recorded parking spots every time a server reboots? The custom data still has that inscrutable large integer, but when I hit the shortcut for a previously recorded connector, it records the current position as a new spot.
Unruly Sep 24, 2023 @ 2:25pm 
@R3p1c: is it possible the ship you are trying to make dock has a smaller ship currently docked to it? I was having the same thing, then remembered I have a miner docked inside. I added '[recall dock]' to the connector it (the small miner) uses and recompiled spug and it started acting properly.
BlazingImp77151 Sep 14, 2023 @ 1:28pm 
Thanks, folks!
SileniusFF Sep 14, 2023 @ 7:38am 
@BlazingImp77151 I also recommend using this script for docking instead of AI blocks. Easier to set up, flexible and very reliable. I usually let AI blocks handle "return to base flight" and then run Docking PB.
Gromit Sep 14, 2023 @ 7:07am 
@BlazingImp77151: I confirm it still works and is easier to use than the AI blocks. It has also much more options you can easily configure. Try it and you'll see you can't play anymore without it :se: