Jump to content

[Discontinued] AdaptiveDockingNode 1.7 - Make Your Awesome Docking Port Models Universal!


toadicus

Recommended Posts

This mod has been discontinued after complete integration into stock KSP. Thanks devs! :)

AdaptiveDockingNode is a creator-targeted plugin that facilitates multi-sized docking ports via the addition of a helper module alongside Squad's ModuleDockingNode. AdaptiveDockingNode was originally developed for use with Cpt. Kipard's Universal Docking Port Set.

AdaptiveDockingNode0.png

Sarcastically Annotated Features Video

Sarcastically Annotated Features Video

Documentation

ModuleAdaptiveDockingNode currently has one configurable field:


[KSPField(isPersistant = false)]
public string ValidSizes;

ValidSizes should be a comma-delineated list of nodeType definitions ala ModuleDockingNode, describing all nodeTypes for which the adaptive docking port should be valid.


@PART[*]:HAS[!MODULE[ModuleAdaptiveDockingNode],@MODULE[ModuleDockingNode]:HAS[#nodeType[size2]]]:FOR[AdaptiveDockingNode]
{
MODULE
{
name = ModuleAdaptiveDockingNode
ValidSizes = size2, size1, size0
}
}

The patch above will add a ModuleAdaptiveDockingNode to all parts with a ModuleDockingNode module and a nodeType of size2, provided they do not already have a ModuleAdaptiveDockingNode defined, and allow them to be used with all size2, size1, and size0 docking ports.

For proper functionality, all docking ports -- even single-size docking ports -- should be made adaptive. Without this step, docking ports without a ModuleAdaptiveDockingNode module will be unable to dock with adaptive ports when the vanilla port is being controlled and the adaptive port is on another vessel.

As packaged, AdaptiveDockingNode comes with ModuleManager patches that will add single-size adaptive nodes to all stock and stock-alike docking ports, plus a 2.5m & 3.75m adaptive node to the KW Rocketry 3.75m docking ring.

Monetization

If you like what you see here, please consider donating via the PayPal button below. Thanks!

btn_donate_LG.gif

Downloads

KerbalStuff: Coming Someday!

Not KerbalStuff: [zip] [tar.gz] [tar.xz]

Changelog


v 1.7 [2015-05-25]
* Updated for KSP 1.0.x!
* Corrected a scenario where vessels with multiple parts would cause Exceptional conditions during FixedUpdates happening before Start has concluded.
* Various code optimizations behind the scenes.
v 1.6 [2014-12-15]
* Updated for KSP 0.90.
* Now supports gendered docking ports, according to laboratory tests.
v 1.5.1 [2014-10-07]
* Updated for KSP 0.25.
v 1.5 [2014-07-17]
* Updated for KSP 0.24.
v 1.4 [2014-05-30]
* Reverted change to cause FixedUpdate to run only for ports on the active vessel.
v 1.3 [2014-05-07]
* ModuleManager 2.X config update.
* Changed FixedUpdate to only run for ports on the active vessel, to improve performance.
* Changed the vessel filter distance to a flat, plugin-wide configurable value and increased the default number substantially.
v 1.2 [2014-05-05]
* No longer calling part.activate unnecessarily.
* Made support for the module database optional.
v 1.1 [2014-04-26]
* Fixed distance check to check distance rather than position.
* Integrated support for a caching module database.
v 1.0 [2014-04-10]
* Initial Release

License

AdaptiveDockingNode is copyright © 2014 toadicus, released under a Simplified BSD license.

This software uses the ModuleManager library, © 2013-2014 Ialdabaoth (who is awesome), sarbian, et al

Used under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

AdaptiveDockingNode

Copyright © 2014, toadicus

All rights reserved.

Redistribution and use in source and binary forms, with or without modification,

are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,

this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,

this list of conditions and the following disclaimer in the documentation and/or other

materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,

INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE

DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,

SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR

SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,

WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE

OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This software uses the ModuleManager library, © 2013-2014 Ialdabaoth (who is awesome), sarbian, et al

Used under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

Edited by toadicus
Discontinued
Link to comment
Share on other sites

  • 4 weeks later...

AdaptiveDockingNode has been updated to version 1.4! This version should improve behavior in certain circumstances when driving fixed-size adaptive ports, docking to variable-size adaptive ports. It's also an excuse to update now that SpacePort's bit the dust.

Changelog


v 1.4 [2014-05-30]
* Reverted change to cause FixedUpdate to run only for ports on the active vessel.

Link to comment
Share on other sites

is it possible to use this to make "male and female" style adapters? for example a later techtree part that can dock to an earlier techtree decoupler without allowing the decouplers to dock with each other? It'd be great for salvaging and repurposing spent stages that were launched before you had docking ports(and better than the claw cause I can never get that thing to attach in a way that doesn't throw off the center of mass)

Link to comment
Share on other sites

How would that work in reality? Gendered docking ports should only dock with each other. I've already proposed this idea to toadicus a while ago, and I think it's great for early in the tree, but I wouldn't make it so easy to use.

Link to comment
Share on other sites

Well in terms of IRL flavortext this would essentially be a device designed well after the fact that is purpose built to affix itself to the top end of a spent upper stage by taking advantage of the shape of the decoupler. its not meant as an early tech docking solution, but as a late tech salvage and repurposing solution for debris that was generated earlier in the tech tree.

in practice in kerbal space program a typical operation involving this would go something like this...

  1. Craft A is a spent upper stage that circularized the first mun lander's orbit around kerbin and gave it a kick in the muns direction before being exhausted and abandoned in an elliptical orbit.
  2. Craft B is a salvage tug based out of a fuel depot in LKO it is carrying with it a small amount of excess fuel and is docked with a pod that is fitted out to with everything to complete a science mission besides main propulsion instead the docked science pod is equipped with a decoupler grabber. the intention is to capture Craft A and use it as Craft B's science pod's main propulsion
  3. Craft B performs and orbital intercept maneuver matching Craft A's orbit and closes within 200 meters before targeting its spent decoupler and lining up the science pod's decoupler grabber with it as if the two were docking ports.
  4. Craft A and B dock the two parts together and Craft B transfers a small amount of fuel into Craft A so that it can return to the fuel depot under its own power before it undocks leaving behind the science pod as Craft A's new command pod, rcs system, and power source.
  5. Craft A then travels to the depot where it is fully fueled either with fuel that was bussed up from kerbin by a low debris "reusable" tanker shuttle, or with fuel that was generated by one of many resource processing mods(biofuels, asteroid cities, kethane, etc...)
  6. fully fueled and equipped Craft A sets off on a deep space adventure.

Link to comment
Share on other sites

  • 1 month later...

I will take a look at gendered requirements again after 0.24 drops and I make sure the plugin works as-is in 0.24. It should be a pretty simple change. The specifics of the implementation would be up to the creators building parts around the plugin, but I've got an idea that should make strictly gendered ports (male->female or neuter:neuter only) and more complex ports (like passinglurker's idea) possible.

Link to comment
Share on other sites

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

bug report

NullReferenceException: Object reference not set to an instance of an object

at AdaptiveDockingNode.ModuleAdaptiveDockingNode.FixedUpdate () [0x00000] in <filename unknown>:0

(Filename: Line: -1)

happend when docking 2 vessels using KSO Docking Ports

Link to comment
Share on other sites

Just to be sure I'm not crazy: dtoxic, you are talking about KSO, the Kerbin Shuttle Orbiter system, and the docking ports provided therein, e.g. "Docking Port, Standard" included in the space stations pack?

yes thats right (KSO, the Kerbin Shuttle Orbiter) it only happed once tried to replicate the problem by undocking and then docking again with no error, i also tried using mechjeb autodock and manually again no error

Link to comment
Share on other sites

Let's make sure I'm understanding the whole situation:

  • Most of the time, docking works normally and no errors are reported.
  • One or more times, you have encountered an issue docking (i.e. docking didn't work), and encountered the NullReferenceException reported in your first post.
  • After these events (following a restart? same session?) docking worked again, and no errors were reported.

Please correct me where I'm wrong. :) Also, any detail you can provide on the error would be great, e.g. were you in a heavily-modded, module-heavy scene (like at a large, complex station or ship)?

Thanks!

Link to comment
Share on other sites

Let's make sure I'm understanding the whole situation:

  • Most of the time, docking works normally and no errors are reported.
  • One or more times, you have encountered an issue docking (i.e. docking didn't work), and encountered the NullReferenceException reported in your first post.
  • After these events (following a restart? same session?) docking worked again, and no errors were reported.

Please correct me where I'm wrong. :) Also, any detail you can provide on the error would be great, e.g. were you in a heavily-modded, module-heavy scene (like at a large, complex station or ship)?

Thanks!

docking did work it just threw that error and everything continued as normal no issues with docking whatsoever and yes heavily moded ksp and the station was not big at all 3x habs from kso 1x service tug 1x mk1-2 pod 6 docking ports on the 6 x hub part from kso and docking ports on all vessels like i said i tried to replicate the error with no success but i thought i post it here non the less if it occurs again ill be shure to post the whole log

Here are logs and this time i attached a docking port (KSO again) to an adapter witch doesn't have a docking port + the situation written above

hope it helps

https://www.dropbox.com/s/bbanbc2z8ad3jer/AdaptiveDN.rar?dl=0

Edited by dtoxic
added link
Link to comment
Share on other sites

So, having looked at the log, I don't think the error is much to worry about. It is being thrown by FixedUpdate, but it is being triggered during the Start phase. In the MonoBehaviour lifecycle, that means that Start has taken so long that Unity has given up waiting and is trying to run physics while some parts of the game are still loading up. This is an unfortunate symptom of heavily modded installs, and the most I could do is improve my null checking and quiet down ADN in such scenarios. But, since ADN doesn't do any setup in FixedUpdate, it shouldn't hurt the functionality at all.

Keep me posted. If this causes trouble, I'll dig deeper.

Link to comment
Share on other sites

So, having looked at the log, I don't think the error is much to worry about. It is being thrown by FixedUpdate, but it is being triggered during the Start phase. In the MonoBehaviour lifecycle, that means that Start has taken so long that Unity has given up waiting and is trying to run physics while some parts of the game are still loading up. This is an unfortunate symptom of heavily modded installs, and the most I could do is improve my null checking and quiet down ADN in such scenarios. But, since ADN doesn't do any setup in FixedUpdate, it shouldn't hurt the functionality at all.

Keep me posted. If this causes trouble, I'll dig deeper.

no problem there where no problems will let you know if it does start to make some thx for the support :)

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...