Jump to content

[MOD] AutoDock -- v1.2.2


Shrooblord

Recommended Posts

AutoDock

Do you find docking tedious? Do you wish you could just press a button when close to a Station, and get docked, like those lazy AI traders do? Do you want to fly at a dock at 2000 m/s and still dock perfectly fine without ever having to hit the brakes?

 

Then AutoDock is for you!

 

 

Usage

This mod adds the Interaction "Auto-Dock to Station" to all Stations, which allows you to easily dock to them by flying up to a Docking Beacon that gets created when the Interaction is used. You'll get pulled into the Station dock by tractor beams like AI traders get too, and like so easily dock without having to try and manoeuvre yourself correctly or lose enough speed while approaching the dock. What's more, you can fly at the Docking Beacon at great speed (up to 2000 m/s due to, probably, engine limitations) and it will still instantly start the docking procedure for you, so you don't even have to make sure you slow down to dock anymore! Sound great? Install the mod now!

 

See the following video for an explanation:

 

 

Prerequisites

This mod requires an external resource: ShipScriptLoader

Please follow the installation instructions of ShipScriptLoader before you install AutoDock.

 

 

Installation Instructions (Client-Side)

- Download the mod ShipScriptLoader by Dirtyredz and follow its installation instructions. This is required to load AutoDock. If you are already using it you may skip this step.

 

- Open the file Avorion/mods/ShipScriptLoader/config/ShipScriptLoader.lua

- Before the last line containing return Config add this:

Config.Add("mods/AutoDock/data/scripts/player/autoDockMigrator.lua")

- Modify defaultscripts.lua in Avorion/data/scripts/lib/: in the function AddDefaultStationScripts(station) (line 14) add the following code:

station:addScriptOnce("mods/AutoDock/data/scripts/entity/autoDockInteraction.lua")

For example, add it on line 28 such that the block of code becomes:

function AddDefaultStationScripts(station)
    station:addScriptOnce("data/scripts/entity/startbuilding.lua")
    station:addScriptOnce("data/scripts/entity/entercraft.lua")
    station:addScriptOnce("data/scripts/entity/exitcraft.lua")

    station:addScriptOnce("data/scripts/entity/crewboard.lua")
    station:addScriptOnce("data/scripts/entity/backup.lua")
    station:addScriptOnce("data/scripts/entity/bulletinboard.lua")
    station:addScriptOnce("data/scripts/entity/story/bulletins.lua")
    station:addScriptOnce("data/scripts/entity/regrowdocks.lua")

    station:addScriptOnce("data/scripts/entity/craftorders.lua")
    station:addScriptOnce("data/scripts/entity/transfercrewgoods.lua")

station:addScriptOnce("mods/AutoDock/data/scripts/entity/autoDockInteraction.lua")
end

- Copy the directory mods contained in the AutoDock .zip file directly into the Steam installation directory folder for Avorion.

 

Multiplayer (Server Owners)

NOTE: This mod needs to be installed both client-side and server-side in order to work. To install on the server, copy these same instructions, but use the server's root directory folder in place of the Avorion Steam Installation folder.

 

For example: when installing for the server, if the installation instructions tell you to drop a file in the Steam installation directory for Avorion, drop it in the server's top-level folder instead.

 

Addtionally, an instruction like

- Modify defaultscripts.lua in Avorion/data/scripts/lib/

 

becomes

 

- Modify defaultscripts.lua in SERVER-TOP-LEVEL-FOLDER/data/scripts/lib/

 

 

For Modders

If you want to disable AutoDocks for a Station of yours, add the following code near the top of one of its scripts:

 

local noAutoDock = require ("mods/AutoDock/data/scripts/lib/noAutoDock")
if noAutoDock then
    noAutoDock.initialize()
end

 

This local variable is never used, but simply including it will execute the code inside the script, causing your station to be given a noAutoDock = true Entity Value which the AutoDock Migrator now checks for.

If this value is found, and its value is true, the AutoDock Migrator will skip that station and not add any AutoDocks to it.

 

If AutoDock is not installed, this value is nil, but because you're not using the value anywhere in your script, that doesn't matter. So it works with AutoDock installed, and with AutoDock not installed.

 

 

Known Issues

 

 

  • Detected an issue where AutoDock Beacons will fail to spawn if something is in the way of the Station's "light line", i.e. Asteroids, another Ship, etc.

 

 

 

 

Changelog

==MOST RECENT VERSION: 1.2.2==

 

1.2.2

  • Fixed .zip directory structure so that it actually contains what it displays on the tin. Thanks to Amriel for notifying me of this problem!

 

1.2.1

  • Fixed a bug where the opt-out functionality would not correctly remove AutoDock functionality. Opt-out functionality should behave as expected now. See updated installation instructions.

 

1.2

  • Added functionality to opt-out your Station for AutoDocks. See the For Modders section for information.

 

1.1.1

  • Removed erroneously included developer content from release zip.

 

==OLDER VERSIONS==

 

 

1.1

  • Namespaced all scripts where applicable.
  • Added compatibility with 0.20.2 Beta Branch Security update.

 

1.0

  • Initial Release

 

 

 

Credits

- Dirtyredz for the ShipScriptLoader.

AutoDock.v1.2.2.zip

Link to comment
Share on other sites

Ive been looking for Auto Docking with the AI Tractor beams HOW Ever i Cannot get the Mod to work for me. Ive done what you said.

 

Ive added the script to ShipScriptLoader, I've Modified DefaultScripts

Ive done it to where instead of being on line 28 i put it on line 15 and still does the same thing. Am i missing something ?

 

Im not getting any Errors what so ever when in game.. so i havent a clue.

function AddDefaultStationScripts(station)
    station:addScriptOnce("data/scripts/entity/startbuilding.lua")
    station:addScriptOnce("data/scripts/entity/entercraft.lua")
    station:addScriptOnce("data/scripts/entity/exitcraft.lua")

    station:addScriptOnce("data/scripts/entity/crewboard.lua")
    station:addScriptOnce("data/scripts/entity/backup.lua")
    station:addScriptOnce("data/scripts/entity/bulletinboard.lua")
    station:addScriptOnce("data/scripts/entity/story/bulletins.lua")
    station:addScriptOnce("data/scripts/entity/regrowdocks.lua")

    station:addScriptOnce("data/scripts/entity/craftorders.lua")
    station:addScriptOnce("data/scripts/entity/transfercrewgoods.lua")

	station:addScriptOnce("mods/AutoDock/scripts/entity/autoDockInteraction.lua")
end

 

-- Example use to add a script to a players ship
-- Config.Add("mods/YourMod/scripts/entity/YourMod.lua")
Config.Add("mods/CarrierCommander/scripts/entity/CarrierCommander.lua")
Config.Add("mods/RenameShips/scripts/entity/shipRename.lua")
Config.Add("mods/RenameShips/scripts/player/shipRenameMigrator.lua")
Config.Add("mods/AutoDock/scripts/player/autoDockMigrator.lua")

return Config

 

Says its registered that i modified the DefaultScripts.lua on loading the server

Sorry in advance just showing all the modified files ive done. along with the defaultscripts

 

Detected Modified Files:
"data/scripts\sectorspecifics.lua"
"data/scripts\commands\agoods.lua"
"data/scripts\commands\consolelevel.lua"
"data/scripts\commands\crew.lua"
"data/scripts\commands\disttocore.lua"
"data/scripts\commands\fighter.lua"
"data/scripts\commands\gate.lua"
"data/scripts\commands\inv.lua"
"data/scripts\commands\inventory.lua"
"data/scripts\commands\list.lua"
"data/scripts\commands\loglevel.lua"
"data/scripts\commands\price.lua"
"data/scripts\commands\regen.lua"
"data/scripts\commands\sethome.lua"
"data/scripts\commands\tmod.lua"
"data/scripts\commands\whereis.lua"
"data/scripts\lib\defaultscripts.lua"
"data/scripts\lib\shipgenerator.lua"
"data/scripts\lib\upgradegenerator.lua"
"data/scripts\systems\universalsystem.lua"
"data/scripts\entity\merchants\turretfactory.lua"
"data/scripts\lib\cmd\common.lua"
"data/scripts\lib\cmd\materials.lua"
"data/scripts\lib\cmd\professions.lua"
"data/scripts\lib\cmd\ranks.lua"
"data/scripts\lib\cmd\rarities.lua"
"data/scripts\lib\cmd\upgrades.lua"
"data/scripts\lib\cmd\weapons.lua"
"data/scripts\player\cmd\agoods.lua"
"data/scripts\player\cmd\crew.lua"
"data/scripts\player\cmd\disttocore.lua"
"data/scripts\player\cmd\fighter.lua"
"data/scripts\player\cmd\gate.lua"
"data/scripts\player\cmd\price.lua"
"data/scripts\player\cmd\sethome.lua"
"data/scripts\player\cmd\tellposition.lua"
"data/scripts\player\cmd\whereis.lua"

Link to comment
Share on other sites

Hi,

 

has anybody tried this mod on 0.18.2?

 

The Goodshauler-Mod has problems with docking to stations now... Question is: Is it docking or the new brake-behavior of AI-controlled ships?

 

That's probably due to the new brake behaviour yeah.

 

 

Thank you Shroob for this mod, even with larger docking ranges it can still be very tedious and dangerous to dock bigger ships so will definately give it a try :)

Link to comment
Share on other sites

  • 2 weeks later...

NOTE: This mod needs to be installed both client-side and server-side in order to work.

 

Following your instructions, did I install it on the client or the server? And how do I install it on the one that it wasn't installed on? Did what you said and it's not working.

Link to comment
Share on other sites

I've followed the instructions twice now trying to get this to work. I have installed both shipscript and this without success. I am not getting any UI or additional station options. I have Turret Editor, ext Turret Factory and CCBasic Commands installed. Do you think there could be a conflict? I am running non beta current version of the game. Any help getting this to work would be greatly appreciated! This game desperately needs built in docking for players.

Link to comment
Share on other sites

  • 1 month later...

 

I noticed that, unsurprisingly, this does not retroactively apply the docking script to stations in existing sectors. In case anyone finds it useful, you can manually add the script to enable auto-docking by targeting a station and running:

/run Entity().selectedObject:addScriptOnce("mods/AutoDock/scripts/entity/autoDockInteraction.lua")

Also, when you inevitably accidentally run that on the same station twice and end up with duplicate options, you can fix that with:

/run Entity().selectedObject:removeScript("mods/AutoDock/scripts/entity/autoDockInteraction.lua")

 

Disregard that; I spent the time to debug this properly and found that the note about "There is an issue in the installation instructions of ShipScriptLoader." etc is incorrect, at least for my installation, and that the correct lines to add to server.lua are the ones provided by the author of ShipScriptLoader:

local s, b = pcall(require, 'mods/ShipScriptLoader/scripts/server/server')
if s then if b.onPlayerLogIn then local a = onPlayerLogIn; onPlayerLogIn = function(c) a(c); b.onPlayerLogIn(c); end end end

With the extra "Avorion/" appended to the beginning of the argument passed to require(), the pcall fails and so ShipScriptLoader does not load, which of course means that the retroactive script loader does not run.

Link to comment
Share on other sites

  • 3 months later...

Version 1.1 released! Now compatible with the 0.20.2 Beta Branch security update. Running smoothly with no problems detected so far.

 

------

 

Sorry folks; haven't been on the forums in a while to answer your questions. I will address them now!

 

I spent the time to debug this properly and found that the note about "There is an issue in the installation instructions of ShipScriptLoader." etc is incorrect, at least for my installation
Indeed. There used to be a problem with ShipScriptLoader -- at least, that was my experience --, but it seems to have been resolved at this time.

 

With a clean installation of the current 0.20.2 Beta Branch (uninstall Avorion > Install Avorion > Patch to Beta 0.20.2), the installation instructions now no longer require you to modify your ShipScriptLoader installation. See the first post in this thread for more information on how to install AutoDock v1.1.

 

I've followed the instructions twice now trying to get this to work. I have installed both shipscript and this without success. I am not getting any UI or additional station options.
I don't think you're running into a conflict. Rather, follow the updated installation instructions as I detailed in my answer to the previous question.

 

Following your instructions, did I install it on the client or the server? And how do I install it on the one that it wasn't installed on? Did what you said and it's not working.
I'm sorry to hear that! I will update the installation instructions to make it more clear. See the first post in this thread for details.

 

Thank you Shroob for this mod, even with larger docking ranges it can still be very tedious and dangerous to dock bigger ships so will definately give it a try :)
Oh, indeed. And the bigger the ship, the better this works, I have found. But big and small ships alike, it feels amazingly fun to fly at a docking beacon at 2 km/s and dock no problem.

 

If you've tried bigger ships, you should notice the docking beacon sticks further out from the dock than with smaller ships, making the approach to the beacon (and thus, the station) safe for both.

 

has anybody tried this mod on 0.18.2?
I've tested on the current 0.20.2 Beta Branch and it's working without a hitch. Please tell me if you run into any further problems.

 

Ive been looking for Auto Docking with the AI Tractor beams HOW Ever i Cannot get the Mod to work for me. Ive done what you said.

 

Ive added the script to ShipScriptLoader, I've Modified DefaultScripts

Ive done it to where instead of being on line 28 i put it on line 15 and still does the same thing. Am i missing something ?

Most likely it's the ShipScriptLoader instructions that have now been updated. See the first post (same answer as to the previous two questions regarding failure of installation).

 

------

 

If you run into any problems running this on 0.20.2 Beta Branch, please let me know -- I'll try and respond quicker this time.

Link to comment
Share on other sites

Version 1.2 released! Now includes opt-out functionality for modders.

 

This version update contains opt-out functionality so that modders creating custom Stations can make sure their Station doesn't get any AutoDocks added to it if they don't want AutoDocks on their Station. See the main post for more details.

 

=======

 

1.2.1

  • Fixed a bug where the opt-out functionality would not correctly remove AutoDock functionality. Opt-out functionality should behave as expected now. See updated installation instructions.

Link to comment
Share on other sites

Bit of confusion with the directory structure of the 1.2.1 zip file: it unzips to /AutoDock.v1.2.1/data/*  instead of the expected /mods/Autodock/data/* ,  so it can't be directly dropped into the steamapps/Avorion folder without manually creating the path chain.

Link to comment
Share on other sites

Oh fk I messed up the directory inside the zip folder sorry about that. I'll fix it so it's more obvious.

 

The top-level folder is just the container; what's inside *should* have been a clear /mods/ folder so you just drop the contents of the container folder onto your Steam installation dir.

 

Fixing it now. Thanks for letting me know!

 

EDIT:

Oh, in fact the whole zip file seems to be for an older version of the mod. Wtf. I'll have it updated properly within a couple of minutes.

Link to comment
Share on other sites

So I had this installed along with MoveUI on my own personal server I run. It was working fine over the holidays, but now none of us on the server get the option to autodock anymore.  Any ideas on what could have broken between then and now? I have tried fully deleting and reinstalling the mods but it is still broken.  MoveUI still works fine for me though.  Note that I am not running my server on the beta branch, just the normal branch.

Link to comment
Share on other sites

Hmmm I have MoveUI and this mod installed both on my Beta Branch 0.20.3 server and it's working fine for us. I don't expect to have broken backwards compatibility with any upates performed, but to be sure, let's make sure of a couple of things. For clarification: absolutely no AutoDocks are spawning?

 

You don't get the option -- does this mean the interaction is missing from the UI when you try and interact with stations? Are you flying player vessels, or Alliance vessels? When you press the quote key ( ' " ) to open the console in-game, does it display any error messages?

 

EDIT:

Another possibility: did you by accident only update the mod locally, and not both in the local and server installations?

Link to comment
Share on other sites

  • 2 weeks later...

I followed the instructions to the letter, yet I'm unable to see the interaction.

According to the console Autodock migrator registered, and no error messages are displayed.

 

Any idea what's going on?

 

EDIT: Nevermind, I apparently had to jump to a different sector before the interaction appeared.

It works like a charm now!

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
  • 1 month later...

Version 1.1 released! Now compatible with the 0.20.2 Beta Branch security update. Running smoothly with no problems detected so far.

 

------

 

Sorry folks; haven't been on the forums in a while to answer your questions. I will address them now!

 

I spent the time to debug this properly and found that the note about "There is an issue in the installation instructions of ShipScriptLoader." etc is incorrect, at least for my installation
Indeed. There used to be a problem with ShipScriptLoader -- at least, that was my experience --, but it seems to have been resolved at this time.

 

With a clean installation of the current 0.20.2 Beta Branch (uninstall Avorion > Install Avorion > Patch to Beta 0.20.2), the installation instructions now no longer require you to modify your ShipScriptLoader installation. See the first post in this thread for more information on how to install AutoDock v1.1.

 

I've followed the instructions twice now trying to get this to work. I have installed both shipscript and this without success. I am not getting any UI or additional station options.
I don't think you're running into a conflict. Rather, follow the updated installation instructions as I detailed in my answer to the previous question.

 

Following your instructions, did I install it on the client or the server? And how do I install it on the one that it wasn't installed on? Did what you said and it's not working.
I'm sorry to hear that! I will update the installation instructions to make it more clear. See the first post in this thread for details.

 

Thank you Shroob for this mod, even with larger docking ranges it can still be very tedious and dangerous to dock bigger ships so will definately give it a try :)
Oh, indeed. And the bigger the ship, the better this works, I have found. But big and small ships alike, it feels amazingly fun to fly at a docking beacon at 2 km/s and dock no problem.

 

If you've tried bigger ships, you should notice the docking beacon sticks further out from the dock than with smaller ships, making the approach to the beacon (and thus, the station) safe for both.

 

has anybody tried this mod on 0.18.2?
I've tested on the current 0.20.2 Beta Branch and it's working without a hitch. Please tell me if you run into any further problems.

 

Ive been looking for Auto Docking with the AI Tractor beams HOW Ever i Cannot get the Mod to work for me. Ive done what you said.

 

Ive added the script to ShipScriptLoader, I've Modified DefaultScripts

Ive done it to where instead of being on line 28 i put it on line 15 and still does the same thing. Am i missing something ?

Most likely it's the ShipScriptLoader instructions that have now been updated. See the first post (same answer as to the previous two questions regarding failure of installation).

 

------

 

If you run into any problems running this on 0.20.2 Beta Branch, please let me know -- I'll try and respond quicker this time.

 

I cannot get this to work either. Although, I am a bit confused regarding the instructions. I read that I should delete "Avorion" where it appears within the 2 lines added to server.lua. Then I read that the autodock folder should not be copied into mods, but rather what sounds like its own subdirectory  in the Avorion folder. Although the post refers to the director name as AutoDock.v1.2.1/data whereas the folder is actually just named AutoDock so I'm not sure if I need to change the folder name to AutoDockv1.2.1 or not. Amazingly complex instructions. Too bad. I built a behemoth and this mod looks fantastic.

Link to comment
Share on other sites

I cannot get this to work either. Although, I am a bit confused regarding the instructions. I read that I should delete "Avorion" where it appears within the 2 lines added to server.lua. Then I read that the autodock folder should not be copied into mods, but rather what sounds like its own subdirectory  in the Avorion folder. Although the post refers to the director name as AutoDock.v1.2.1/data whereas the folder is actually just named AutoDock so I'm not sure if I need to change the folder name to AutoDockv1.2.1 or not. Amazingly complex instructions. Too bad. I built a behemoth and this mod looks fantastic.

 

I am also unsure if I need to modify ShipScriptLoader.lua or not? One post says that modifying the installation is no longer necessary but every other post talks about modifying the file.

 

Link to comment
Share on other sites

I cannot get this to work either. Although, I am a bit confused regarding the instructions.

 

I followed the instructions in the first post of this thread exactly, loaded it, jumped 1 sector away, then back a sector, saved and exited the game, relaunched it and it's working flawlessly.

 

If you run into trouble with it not auto docking after hailing the station and choosing auto dock,  make sure to aim for the flashing green square of docking guidance, since just flying by the station won't do any good unless you're within 1-2 km of the docking icon that spawn in space.

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 months later...

Hey you said just change which directory you put all the jazzy codes in. But they dont exist there? There is no defaultscripts for example in my servers save location. I have successfully installed it for singleplayer and it works mostly (huge ship didnt dock properly but I have a transport chip so it doesn't matter.

 

But yeah how on Earth do I install so me and my friend can enjoy it?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...