Jump to content

Multiple docking nodes on the same part?


Recommended Posts

This should be possible. When you create the .cfg, just add a second docking module and change the "referenceAttachNode" to match your new docking area. The value you enter on the right half of this line is the last part of the attach nodes defined elsewhere in the .cfg

Example, for "node_stack_top = 0.0, 0.2828832, 0.0, 0.0, 1.0, 0.0, 1" to become the docking node, make the "referenceAttachNode = top"

For "node_stack_thisismydockingport" set "referenceAttachNode = thisismydockingport"

You will encounter the problem that the right click menu will be ambiguous as to which docking port you actually are using.

Link to comment
Share on other sites

Good idea, and thx for your reply, but it doesn't seem to work.

let me show you.

this is the test part, it has two docking nodes at the top:

kX4ZXPv.jpg

CFG is like this:

node_stack_top01 = 0.0, 0.5, 0.5, 0.0, 1.0, 0.0, 1
node_stack_top02 = 0.0, 0.5, -0.5, 0.0, 1.0, 0.0, 1

and the two modules:

MODULE
{
name = ModuleDockingNode
referenceAttachNode = top01
nodeType = size1
}
MODULE
{
name = ModuleDockingNode
referenceAttachNode = top02
nodeType = size1
}

the right click menu is just like you said:

lDyLzXz.jpg

top01 docks normally

IGok8dV.jpg

top02 doesn't

pC1DnnA.jpg

What am I missing?

*scratches head* :(

Link to comment
Share on other sites

In Unity go to the menu where it says game object and select create empty. Rename game object to dockingNode (check the tutorial links that are sticky for the correct name) and note the direction of the arrow(I think it's the blue one). Then just change the coordinates to where you want it to be. Then in the CFG skip the attach nodes and just define your docking node.

Link to comment
Share on other sites

Try moving the docking locations further apart from one another. What may be happening is that because you're in close proximity to both ports when docking, both are magnetizing. When you successfully dock, the game resaves the craft. If a docking port saves in the magnetizing mode (I don't recall what it is actually called) it gets stuck in that mode and will no longer function.

Good luck

Link to comment
Share on other sites

Ok, I did that but still no luck. I've moved them further apart like kujuman said too, which makes sense, but it doesn't help either.

Using the dockingNode transforms gave the same result: only one node works, the other doesn't.

Then I renamed the dockingNode's to top01 and top02 and referenced them in cfg accordingly, but that made both not work.

(on the bright side, at least I've learned that transforms could be used for docking nodes tho)

here's a pic of what I did in case I made a mistake:

kJt8ytk.jpg



//node_stack_top01 = -0.7, 0.7, 0., 0.0, 1.0, 0.0, 1
//node_stack_top02 = 0.7, 0.7, 0., 0.0, 1.0, 0.0, 1

commented these out^

---------------------------

MODULE
{
name = ModuleDockingNode
referenceAttachNode = dockingNode
nodeType = size1
}
MODULE
{
name = ModuleDockingNode
referenceAttachNode = dockingNode
nodeType = size1
}

It seems to me that there's a dilemma because if both nodes have the same name, the game can't tell them apart but I also can't rename them because the nodes only work when exactly named "dockingNode".

Edit: I just tried to be a smart-ass and name them dockingNode01 and dockingNode02, but that resulted in both not working again.

Edited by Porkjet
Link to comment
Share on other sites

You might be able to do this with the (somewhat) new part combining functionality with the CFG files.

http://forum.kerbalspaceprogram.com/threads/34013?p=454874&viewfull=1#post454874

I don't have experience using that though so I wouldn't know for sure if it will let you maintain the individual functionality of the parts being combined. As far as I know they are treated as a single entity in the engine (clicking any part in the "cluster" will result in a click on the whole rather than the individual parts). I hope it does work for you.

If it doesnt, your best bet is to make a single part that has good symmetry with itself and just use that. It means two parts each time, but it also saves you headache!

Link to comment
Share on other sites

  • 3 weeks later...

Not sure if you've figured it out yourself yet, but this is definitely possible. The docking ports included in my mod have 4 points of contact for a stronger connection. Take a look at the .cfg files to see how the transforms are used. It might be as simple as a naming issue. Warning my mod is very RAM hungry at the moment, so you may want to delete out the non-relevant parts. If you need I can get some screenshots of my Unity workspace as well.

Link to comment
Share on other sites

Wow! You really got it to work!

I have failed to replicate it tho, I don't understand what the controlTransformName parameter is for and what kind of transform it requires.

A screenshot of your unity workspace would be much appreciated.

May I ask how you learned about this? Cos it allways seems to me that you guys were all just born with all this knowledge :o

Link to comment
Share on other sites

May I ask how you learned about this? Cos it allways seems to me that you guys were all just born with all this knowledge :o

This makes me laugh because I feel the same way trying to understand how to write plugins for this game. I'm still getting things put back together from my last big burst of activity. When I have a screenshot I'll post it here. I think you're 99% of the way there and probably have issues with the names of the nodes.

Your transforms in Unity have two different names, which correspond to two different names in the .cfg file? Are you defining the transform with a node and a module code section in your .cfg? If all else fails copy my .cfg file and change the appropriate file names, transforms and such. See if that fixes it.

Link to comment
Share on other sites

I have only one transform per docking node, the actual NODE transform. In your CFG I see another parameter calling for a transform, "controlTransformName = HSH" What is this "HSH" transform and where do I put it? I can not find any information on this parameter.

Link to comment
Share on other sites

PART
{
name = Dock
module = Part
author = Alskari

MODEL
{
model = HSH/Parts/Dock
position = 0, 0 ,0
scale = 1, 1, 1
rotation = 0, 0, 0
}

rescaleFactor = 1

NODE
{
name = top
transform = TF5
size = 1.0
method = FIXED_JOINT //FIXED_JOINT, HINGE_JOINT, LOCKED_JOINT, MERGED_PHYSICS or NO_PHYSICS
}

NODE
{
name = CONNECT1
transform = TF1
size = 1.0
method = FIXED_JOINT //FIXED_JOINT, HINGE_JOINT, LOCKED_JOINT, MERGED_PHYSICS or NO_PHYSICS
}

NODE
{
name = CONNECT2
transform = TF2
size = 1.0
method = FIXED_JOINT //FIXED_JOINT, HINGE_JOINT, LOCKED_JOINT, MERGED_PHYSICS or NO_PHYSICS
}

NODE
{
name = CONNECT3
transform = TF3
size = 1.0
method = FIXED_JOINT //FIXED_JOINT, HINGE_JOINT, LOCKED_JOINT, MERGED_PHYSICS or NO_PHYSICS
}

NODE
{
name = CONNECT4
transform = TF4
size = 1.0
method = FIXED_JOINT //FIXED_JOINT, HINGE_JOINT, LOCKED_JOINT, MERGED_PHYSICS or NO_PHYSICS
}

MODULE
{
name = ModuleDockingNode
referenceAttachNode = CONNECT1
nodeType = size1
nodeTransformName = TF1
controlTransformName = HSH
}

MODULE
{
name = ModuleDockingNode
referenceAttachNode = CONNECT2
nodeType = size1
nodeTransformName = TF2
controlTransformName = HSH
}

MODULE
{
name = ModuleDockingNode
referenceAttachNode = CONNECT3
nodeType = size1
nodeTransformName = TF3
controlTransformName = HSH
}

MODULE
{
name = ModuleDockingNode
referenceAttachNode = CONNECT4
nodeType = size1
nodeTransformName = TF4
controlTransformName = HSH
}

cost = 5000
category = Structural
subcategory = 0
title = Docking Port 4m
manufacturer = W.E.R.I.
description = Docks to other HSH ports.
attachRules = 1,0,1,1,0

// --- standard part parameters ---
mass = 1
dragModelType = default
maximum_drag = 0.2
minimum_drag = 0.2
angularDrag = 1
crashTolerance = 100
breakingForce = 2500
breakingTorque = 2500
maxTemp = 5000
fuelCrossFeed=True

}

Unity Object:

oWRlpdC.png

Door1-6 are the segmented collision meshes which allow for the part to be hollow.

TF1-4 are located roughly where the triangular warning signs are. These are the docking nodes.

TF5 is the bottom node for connecting back to the structure.

Link to comment
Share on other sites

I have only one transform per docking node, the actual NODE transform. In your CFG I see another parameter calling for a transform, "controlTransformName = HSH" What is this "HSH" transform and where do I put it? I can not find any information on this parameter.

I found out about that when I was looking at the ModuleDockingNode definition in Visual Studios. You can learn a lot that way though it's not always apparent what some things do. There's another parameter for the actual docking node which as near as I can tell lets you reference a transform that is named something other than 'dockingNode'. I was unable to get that one to work but I did use the controlTransformName to tell my drop tank part that its control transform is different than its forward (up? I forget actually) transform. For instance, it's oriented one way but its docking node is oriented 90 degrees off axis so its was necessary to add a second transform and set controlTransformName to that transform name. That apparently affects everything queries the part about its transforms because prior to doing that, MechJeb would not properly dock, and would give a status message saying that I needed to control from an actual docking node.. (or something to that effect)

Link to comment
Share on other sites

Thx for the answers guys, I still can't make it work tho, and I still don't understand what exactly I'm supposed to do with controlTransformName.

Alskari, nowhere in your hierarchy do I see a gameobject named 'HSH' that your controlTransformName is referencing, which utterly confuses me.

I've experimented with several things now, no matter what I put in the controlTransformName, I allways get the same result that the first docking port connects and the second doesn't.

Link to comment
Share on other sites

I just got it to work!!!!!!

I've wildly changed around a lot of things, but I'm 90% sure the fault was a bracket { error... very embarrassing. I checked everything, again, and again, and again but apparently never noticed this one...

Thanks for your help, this opens a lot of new possibilities.

Link to comment
Share on other sites

  • 2 weeks later...
Just delete that line about controlTransformName. I have no idea what it does, or how it got there. Post your .cfg file and another screenshot of your workspace.

Sorry about the delayed reply, just FYI, especially for anyone who consults this thread in the future looking for modeling docking ports.

controlTransformName is for when the port's desired control vector does not match the part's transform. A good example (indeed the only example of which I am aware) is the stock 'Inline Clamp-o-Tron', the docking port that is retractable, stackable and points to the side.


// Indentation by Starwaster who is OCD about indentation because [I]Squad never indents![/I] Bad Squad!
MODULE
{
name = ModuleDockingNode
deployAnimationController = 1
nodeType = size1
controlTransformName = controlNode
}

Link to comment
Share on other sites

  • 2 months later...

Sorry for the necro on this...

I'm trying to add docking ports to a part I'm building using MODEL nodes. Do the Unity objects have be to named separately for the CFG to call them (using nodeTransformName)?

I'm building a part with multiple ports using existing models, so I can't change the name of objects for them in Unity. Not sure if this would work.

Link to comment
Share on other sites

Each transform needs a unique name. In the Unity example I posted above TF1, TF2, TF3.... are all individual game objects oriented with the z axis pointing in the docking direction.

Thanks. That's what I was afraid of. I looked at yours and Porkjet's cfgs for the parts you're using multiple nodes in and figured the references had to be to named objects in Unity.

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...