Jump to content

How do you add a docking port to a part?


Recommended Posts

I can't really find any explanations as to how to do this. What i can find suggests it should be very simple but i just can't get it to work.

I'm trying to add a docking port to the top of a command pod. I'm using this;

MODULE
{
name = ModuleDockingNode
referenceAttachNode = top
nodeType = size2
undockEjectionForce = 0.25
minDistanceToReEngage = 3.5
acquireForce = 3.5
acquireTorque = 3.5
acquireRange = 3.0
captureRange = 1.5
}

It shows as having a docking port in VAB but then i don't get the dock options in flight and bringing two together doesn't engage dock.

ANyone know where i am going wrong?
Link to comment
Share on other sites

[quote name='dboi88']I can't really find any explanations as to how to do this. What i can find suggests it should be very simple but i just can't get it to work.

I'm trying to add a docking port to the top of a command pod. I'm using this;

MODULE
{
name = ModuleDockingNode
referenceAttachNode = top
nodeType = size2
undockEjectionForce = 0.25
minDistanceToReEngage = 3.5
acquireForce = 3.5
acquireTorque = 3.5
acquireRange = 3.0
captureRange = 1.5
}

It shows as having a docking port in VAB but then i don't get the dock options in flight and bringing two together doesn't engage dock.

ANyone know where i am going wrong?[/QUOTE]

Did you add the node ? or are you using one already there ?
Link to comment
Share on other sites

I always add two nodes to every docking port, as outlined here:

[url]http://forum.kerbalspaceprogram.com/threads/94742[/url]

I know it's possible to do it without doing both... but... it always works for me when I do it that way... so I do!

Feel free to upload unity screenshots and/or unity and ksp files and I'll take a look!
Link to comment
Share on other sites

[quote name='artwhaley']I always add two nodes to every docking port, as outlined here:

[URL]http://forum.kerbalspaceprogram.com/threads/94742[/URL]

I know it's possible to do it without doing both... but... it always works for me when I do it that way... so I do!

Feel free to upload unity screenshots and/or unity and ksp files and I'll take a look![/QUOTE]

Ok i've never used unity or blender, I just got them installed last night and manged to import the .mu into blender (i'm not the original author of the model) and then exported the model into Unity so i'm going to have a play around tonight with the model I want to add the docking port to and some other peoples docking ports and see what i can come up with.

I was hoping to do this with the .cfg only but i suppose i will need to take the plunge into model making at some point so might as well be now.

If I'm not getting anywhere i'll take you up on your offer and i'll upload the files for you.

Cheers
Link to comment
Share on other sites

Congrats on taking that plunge! I didn't realize you were trying to do it config only before. It might be possible to do so, if you've opened the model in Blender and found the exact name of a transform (empty, in blender, game object in unity) that happens to face the right way.)

That said... learning Blender and Unity and being able to actually make parts from scratch has been one of the absolute most rewarding things this game has driven me to, so if you've got the inclination, I'd stick with that! As you go... don't be afraid to run here and post for help BEFORE you get so frustrated you want to blast your laptop all the way to the Mun! It's not hard, but there are several little steps to the process that can go wrong and leave you banging your head against the desk!

Art
Link to comment
Share on other sites

[quote name='artwhaley']Congrats on taking that plunge! I didn't realize you were trying to do it config only before. It might be possible to do so, if you've opened the model in Blender and found the exact name of a transform (empty, in blender, game object in unity) that happens to face the right way.)

That said... learning Blender and Unity and being able to actually make parts from scratch has been one of the absolute most rewarding things this game has driven me to, so if you've got the inclination, I'd stick with that! As you go... don't be afraid to run here and post for help BEFORE you get so frustrated you want to blast your laptop all the way to the Mun! It's not hard, but there are several little steps to the process that can go wrong and leave you banging your head against the desk!

Art[/QUOTE]

Cheers, i'm going for it.

Ok so i've loaded the model in unity, applied the settings and materials/textures ect. as per the tutorials (not sure if i've done them all correctly yet) and added a new object to use as the docking port but i'm stuck on exporting. My part tools dialog box is just blank, it seems frozen i can't move it or close it and it is always on top of Unity.
[IMG]http://i.imgur.com/9AuM7Zt.jpg[/IMG]


Any ideas?
Link to comment
Share on other sites

I've had this problem when I've had either
A: Massive errors in the models - stuff that Unity doesn't support. Not generally a problem, I can't remember what triggered this when I saw it, was very early in my modding career.
B: Part Tools installed incorrectly, or incorrectly configured - Generally it just won't show up at all though, so is likely either C or D
C: Empty config files. If you have a single *.cfg file with no nodes defined, this will crash PartTools (but not KSP when it loads).
D: Custom plugins in my unity setup that would not compile properly (from testing custom code outside of KSP); as soon as the first plugin fails to compile all the rest get borked as well, and subsequently PartTools fails to load (as it is just another plugin to Unity).
Link to comment
Share on other sites

I had that happen with a window in unity once too... For me closing and reopening Unity worked for me. You shouldn't need to have a part tools window open... Once you've dragged the folder into the assets window and it's done the little 'importing' popup box with progress bar for a few seconds it's installed and you're good - that popup window is not something you need.

From THERE you go to the empty game object that you've set your model under in the hierarchy and over in the Inspector panel hit the Add Component button then choose KSP Part Tools.

If restarting Unity gets that window closed we can see your hierarchy and make sure you're on the right track there! :)
Link to comment
Share on other sites

[quote name='artwhaley']Congrats on taking that plunge! I didn't realize you were trying to do it config only before. It might be possible to do so, if you've opened the model in Blender and found the exact name of a transform (empty, in blender, game object in unity) that happens to face the right way.)

That said... learning Blender and Unity and being able to actually make parts from scratch has been one of the absolute most rewarding things this game has driven me to, so if you've got the inclination, I'd stick with that! As you go... don't be afraid to run here and post for help BEFORE you get so frustrated you want to blast your laptop all the way to the Mun! It's not hard, but there are several little steps to the process that can go wrong and leave you banging your head against the desk!

Art[/QUOTE]

Ok so it just wouldn't go away and then i noticed some errors in the console window relating to loading errors of part configs as mentioned by Shadowmage. Then it occurred to me I had no reason to be loading game files into unity to create a new part so i thought maybe when it says chose your GAMEDATA folder it didn't mean your actual KSP gamedata folder. I guess that is probably a stupid mistake for you guys. Anyway i then created a fresh project and chose the folder for the part i was working on and it started working.

I managed to add a new object to the model that i thought would be invisible to use as a docking node following a tutorial but once loaded into ksp it was just a white box sat on top of my capsule and it had lost all the thrust vector information for the inbuilt rcs and engines. So i just started to play around with blender instead.

Didn't like it.

Got 3d Wings.

2 hours later, , , , ,

ta daaa i will hopefully finish this off in unity and get it in game tomorrow for some testing. This will be a perfectly matching docking port instead of in built. Should be much easier to add a docking port to a new part!
[IMG]http://i.imgur.com/nw47Cyn.jpg[/IMG] Edited by dboi88
Link to comment
Share on other sites

The part looks great! I'd throw one of those on either end of a probecore and an RCS tank and have cute little disposable tugs for getting station components into place for docking!

I tried to make myself learn blender a half dozen times before I succeeded at making myself learn blender! For the docking nodes, RCS thrusters and engines... the easiest way to do them instead of using a box from your modelling program is to do it in Unity. At the top of the Unity window under Game Objects, you just "Create Empty". An empty game object is just a point in space with the three axis's marked by arrows... You then rename these game objects and drag them to the right places for your docking nodes, rcs thrust transforms, etc.

Example of an empty set up for a docking port : (Note that the blue arrow is facing out towards where the ship that's going to dock will be. Important!)

[IMG]http://i.imgur.com/vtiTP.png[/IMG]

Engines are set up the same way... but.... (typing from several month's old memory) the blue arrow of the empty needs to point out the back, where the exhaust would exit... and RCS thrusters you would put an empty game object with the same name into every 'port' (so a 5 way thruster block like the stock rcs part would have 5 empty game objects, all with the same name) with their GREEN arrows pointing out, the direction that the exhaust would 'push'.

It's totally possible to place those empty objects in Blender, and I'm sure in Wings as well....but then you have to remember "In my 3D program, the Red arrow is the Green Arrow for Unity..." or something... so I just do it in Unity at the end.

You CAN make that box disappear if you, for some reason, really want to insert boxes in your 3d Program then turn them into the transforms to use for docking ports, rcs thrusters, etc.... What you'd do is, once they're in the unity scene, delete the 'mesh renderer' component from the inspector panel. This will make it disappear. But... again... it's easy enough, once you get the hang of it, to do them in Unity and be able to tweak them without going all the way back to your 3D program in the chain. Edited by artwhaley
Link to comment
Share on other sites

[quote name='artwhaley']I tried to make myself learn blender a half dozen times before I succeeded at making myself learn blender! For the docking nodes, RCS thrusters and engines... the easiest way to do them instead of using a box from your modelling program is to do it in Unity. At the top of the Unity window under Game Objects, you just "Create Empty". An empty game object is just a point in space with the three axis's marked by arrows... You then rename these game objects and drag them to the right places for your docking nodes, rcs thrust transforms, etc.

Example of an empty set up for a docking port : (Note that the blue arrow is facing out towards where the ship that's going to dock will be. Important!)

Engines are set up the same way... but.... (typing from several month's old memory) the blue arrow of the empty needs to point out the back, where the exhaust would exit... and RCS thrusters you would put an empty game object with the same name into every 'port' (so a 5 way thruster block like the stock rcs part would have 5 empty game objects, all with the same name) with their GREEN arrows pointing out, the direction that the exhaust would 'push'.

It's totally possible to place those empty objects in Blender, and I'm sure in Wings as well....but then you have to remember "In my 3D program, the Red arrow is the Green Arrow for Unity..." or something... so I just do it in Unity at the end.

You CAN make that box disappear if you, for some reason, really want to insert boxes in your 3d Program then turn them into the transforms to use for docking ports, rcs thrusters, etc.... What you'd do is, once they're in the unity scene, delete the 'mesh renderer' component from the inspector panel. This will make it disappear. But... again... it's easy enough, once you get the hang of it, to do them in Unity and be able to tweak them without going all the way back to your 3D program in the chain.[/QUOTE]

I had added the box in using unity rather than blender so I either didn't follow his instructions properly or he explained it wrong. I did do the whole blue arrow pointing out into space ect. but at one point he resorted to explaining things liek this, 'put the box where you would stick your chewing gum if you were stood between the two docking crafts' , , , , not exactly clear instructions!

Your explanation seems pretty simple so i'll look at making a whole new capsule model tonight as I thought adding the vectors would be really difficult. Either that or load back in the original model and add all the engine/rcs thrust vectors myself, then adding a docking port should be easy enough. But it'd be nice to have the first release of my mod using all my own models.

So one last question for you. How do i make the model the right size in Wings 3D? I managed to load the model into KSP last night and the docking port worked fine but i had to play around with the rescale to get it to be the right size. it ended up being something like 1.34 or some other equally as daft number.

I'll have to take a look at some ladder/hatch and emmisive window tutorials now! I need a way to get these Kerbals in and out of the pods.
Link to comment
Share on other sites

I don't know Wings, but I just looked at Beale's tutorial and it LOOKS like 1.25m in Wings should be 1.25m in Kerbal, with both scale and rescale factor set to 1 in the cfg file. In his tutorial he right clicks on the part and selects 'absoulute commands' then 'scale' to view and set the absolute bounds of the model? That might be something to try if you're having weird scaling issues!

And if you added the box in Unity you're almost in the right place! Empty game objects are in the same menu as the adding cubes! :)

Here's a 'thrown together in 2 minutes gif' that shows what all the empty's for a docking port with four rcs jets should look like with placement and orientation.

[IMG]https://i.gyazo.com/daafdef4830d9b87cf2886fd2a4a5156.gif[/IMG]


Ladders and hatches aren't hard but have several tiny easy to skip over steps - setting tags and layers and checkboxes, so follow the tutorial carefully. And... I never found good images of what the ladder and airlock colliders should look like, so I made them too small at first. The ladder and airlock colliders don't define the ladder and airlock themselves, they should be big enough to define all the space from which a kerbal should be able to touch the ladder and airlock. That will make more sense when you get there and read the tutorials, but it wasn't clear any of the places i looked, so I made the collider cover the ladder it self then wondered why kerbals kept bouncing off of it instead of grabbing! Edited by artwhaley
Link to comment
Share on other sites

[quote name='artwhaley']I don't know Wings, but I just looked at Beale's tutorial and it LOOKS like 1.25m in Wings should be 1.25m in Kerbal, with both scale and rescale factor set to 1 in the cfg file. In his tutorial he right clicks on the part and selects 'absoulute commands' then 'scale' to view and set the absolute bounds of the model? That might be something to try if you're having weird scaling issues!

And if you added the box in Unity you're almost in the right place! Empty game objects are in the same menu as the adding cubes! :)

Here's a 'thrown together in 2 minutes gif' that shows what all the empty's for a docking port with four rcs jets should look like with placement and orientation.[/QUOTE]

Cheers, this all makes sense to me and i'm sure i've followed all directions but i still don't get an undock option in flight and they don't dock if you bring two of them together. would you mind taking a look at my unity file? [url]https://drive.google.com/file/d/0B_nRjcqonDoUSThOeUVKVmVRLUU/view?usp=sharing[/url]
Link to comment
Share on other sites

I think I found the problem and it should be an easy fix... though I can't be certain, since I'm still on Unity 4.2.2, so it's possible that my importing the project screwed it up and you have it right in the original file.... but if not, it's an easy fix!

When I imported it, it looks like you still need to drag all of the pieces that go into your part to be underneath (parented to) the dockingport game object in the hierarchy What i see when I import it is:

[IMG]https://i.gyazo.com/00b23fcd3eeecaba1964840703d715a9.png[/IMG]
And what it should look like is:

[IMG]https://i.gyazo.com/0e65cfa4266d51c0b600ee3ba229e12f.png[/IMG]

((I just deleted the 'main camera' as it's not needed... but it doesn't hurt you by being there. Just wanted to show you an uncluttered pic to make the right hierarchy clear))

It also looks like your RCS thrusters might be in the wrong places... one is hanging sort of off into space, and remember that they will thrust out in the direction of the green arrow... with the force (and the visual effect) starting at the center of the object.

You're very close!
Link to comment
Share on other sites

[quote name='artwhaley']I think I found the problem and it should be an easy fix... though I can't be certain, since I'm still on Unity 4.2.2, so it's possible that my importing the project screwed it up and you have it right in the original file.... but if not, it's an easy fix!

When I imported it, it looks like you still need to drag all of the pieces that go into your part to be underneath (parented to) the dockingport game object in the hierarchy What i see when I import it is:

[url]https://i.gyazo.com/00b23fcd3eeecaba1964840703d715a9.png[/url]
And what it should look like is:

[url]https://i.gyazo.com/0e65cfa4266d51c0b600ee3ba229e12f.png[/url]

((I just deleted the 'main camera' as it's not needed... but it doesn't hurt you by being there. Just wanted to show you an uncluttered pic to make the right hierarchy clear))

It also looks like your RCS thrusters might be in the wrong places... one is hanging sort of off into space, and remember that they will thrust out in the direction of the green arrow... with the force (and the visual effect) starting at the center of the object.

You're very close![/QUOTE]

That's the same way it was set up on my side too. Looks like it didn't load properly. I only put the rcs thrust vectors in there to see how they worked(and they do).

Did you look at the part config? Maybe I'm going wrong there? Edited by dboi88
Link to comment
Share on other sites

Ahhhh! The 'no decouple node' should have been the clue I needed if I wasn't so sure the weird Unity import was the problem.

The reason it won't decouple is that it's not attaching by the docking node, it's attaching by the stack node. The two ways to fix it are either switching to gameobject 'node' based definitions for your stack attach points, or more simply, switching over to the old fashioned docking port code:

[QUOTE] MODULE
{
name = ModuleDockingNode
nodeType = size2
referenceAttachNode = top
}
[/QUOTE]

is all you need in this case, because your control axis and the part axis happen to line up on this part! Swapping that out allowed me to get through a launch, decouple, and redocking!
Link to comment
Share on other sites

[quote name='artwhaley']Ahhhh! The 'no decouple node' should have been the clue I needed if I wasn't so sure the weird Unity import was the problem.

The reason it won't decouple is that it's not attaching by the docking node, it's attaching by the stack node. The two ways to fix it are either switching to gameobject 'node' based definitions for your stack attach points, or more simply, switching over to the old fashioned docking port code:



is all you need in this case, because your control axis and the part axis happen to line up on this part! Swapping that out allowed me to get through a launch, decouple, and redocking![/QUOTE]

Cheers. I'm pretty much back where I started then because just adding the above module didn't work for me. I'll give it another go tonight though. I probably when wrong somewhere else last time.

It makes more sense to me to define all the nodes in unity though. So how would I go about that? I guess it would just need a top and bottom attach node to be defined in unity and then referred to in the config?
Link to comment
Share on other sites

Could i create two empty game objects called 'dockingport' and 'bottom' and then define the two nodes like this? followed by the docking port module?

[CODE]PART
{
name = Dock
module = Part
author = --dboi--

MODEL
{
model = dockingport
position = 0, 0 ,0
scale = 1, 1, 1
rotation = 0, 0, 0
}

rescaleFactor = 1

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

NODE
{
name = dockingport
transform = dockingport
size = 2.0
method = FIXED_JOINT //FIXED_JOINT, HINGE_JOINT, LOCKED_JOINT, MERGED_PHYSICS or NO_PHYSICS
}

MODULE
{
name = ModuleDockingNode
referenceAttachNode = dockingport
nodeType = size2
nodeTransformName = dockingport
}

}[/CODE]
Link to comment
Share on other sites

That looks like it ought to work, and I find it easier to define the attach nodes in unity anyway because I hate doing the math... or wriggling them and reloading a dozen times. That said, I have no idea why it's not working for you as is.... I had it working from your file! The only things I did were - redrag all the things into the right hierarchy like the screenshot I sent you, then fiddle with the .cfg file a little. I'll post the cfg file as I had it working. I... cannot remember why it was recommended... but I'm using Unity 4.2.2 because someone a while back said that was the version to stick with? I know I HAVE used unity 4.5 and it worked fine but... I'm running short on theories as to why it worked for me but not for you!


[CODE]PART{
// --- general parameters ---
name = coyotedockingport
module = Part
author = --dboi--


// --- asset parameters ---
MODEL
{
model = AxialAerospace/Parts/simplecargo/dockingport




}

scale = 1.0
rescaleFactor = 1.2


// --- node definitions ---
node_stack_top = 0.0, 0.22, 0.0, 0.0, 1.0, 0.0, 2
node_stack_bottom = 0.0, 0, 0.0, 0.0, -1.0, 0.0, 2

// --- editor parameters ---
TechRequired = metaMaterials
entryCost = 16200
cost = 1400
category = Utility
subcategory = 0
title = Coyote Senior Docking Module
manufacturer = Kerbalmax Industries
description = A large connection for constructing spacecraft and space stations. It is fully compatabile with Clamp-O-Tron Senior standard docking ports.


bulkheadProfiles = size2

// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
attachRules = 1,0,1,1,0


// --- standard part parameters ---
mass = 2.0
dragModelType = default
maximum_drag = 0.2
minimum_drag = 0.2
angularDrag = 2
crashTolerance = 15
breakingForce = 50
breakingTorque = 50
maxTemp = 2000
fuelCrossFeed = True

MODULE
{
name = ModuleDockingNode
nodeType = size2
//nodeTransformName = dockingNode
//controlTransformName = controlNode
referenceAttachNode = top
}
MODULE
{
name = ModuleRCS
thrusterTransformName = rcsthrust
thrusterPower = 4
resourceName = MonoPropellant
resourceFlowMode = STAGE_PRIORITY_FLOW
atmosphereCurve
{
key = 0 240
key = 1 100
key = 4 0.001
}
}
}


[/CODE]


And for comparison, here's the code for one of the docking ports in my little cargo bay mini mod where I defined the nodes in Unity... I'm using the dockingNode for one and the other is just another empty set up on the other side of the part, blue arrow facing out.

[CODE]PART{
name = cbdockingjunior
module = Part
author = Art
MODEL
{
model = AxialAerospace/Parts/simplecargo/cbdockingjunior
scale=1,1,1



}
rescaleFactor = 1
scale = 1








NODE
{
name = top
transform = nodeAttach
size = 1
method = FIXED_JOINT
}
NODE
{
name = bottom
transform = dockingNode
size = 0
method = FIXED_JOINT
}



TechRequired = composites
entryCost = 500
cost = 300
category = Utility
subcategory = 0
title = Cargo Bay Docking Node Junior
manufacturer = Axial Aerospace
description = When you just aren't ready to let go forever... there's a docking node.
attachRules = 1,1,1,1,0
mass = 0.02
dragModelType = default
maximum_drag = 0.2
minimum_drag = 0.2
angularDrag = 1
crashTolerance = 30
breakingForce = 50
breakingTorque = 50
maxTemp = 2600
emissiveConstant = 0.8
fuelCrossFeed = FALSE
bulkheadProfiles = size0, srf

MODULE
{
name = ModuleDockingNode
nodeType = size0
nodeTransformName = dockingNode
controlTransformName = controlNode
}

}


[/CODE]
Link to comment
Share on other sites

[quote name='artwhaley']That looks like it ought to work, and I find it easier to define the attach nodes in unity anyway because I hate doing the math... or wriggling them and reloading a dozen times. That said, I have no idea why it's not working for you as is.... I had it working from your file! The only things I did were - redrag all the things into the right hierarchy like the screenshot I sent you, then fiddle with the .cfg file a little. I'll post the cfg file as I had it working. I... cannot remember why it was recommended... but I'm using Unity 4.2.2 because someone a while back said that was the version to stick with? I know I HAVE used unity 4.5 and it worked fine but... I'm running short on theories as to why it worked for me but not for you!


[CODE]PART{
// --- general parameters ---
name = coyotedockingport
module = Part
author = --dboi--


// --- asset parameters ---
MODEL
{
model = AxialAerospace/Parts/simplecargo/dockingport




}

scale = 1.0
rescaleFactor = 1.2


// --- node definitions ---
node_stack_top = 0.0, 0.22, 0.0, 0.0, 1.0, 0.0, 2
node_stack_bottom = 0.0, 0, 0.0, 0.0, -1.0, 0.0, 2

// --- editor parameters ---
TechRequired = metaMaterials
entryCost = 16200
cost = 1400
category = Utility
subcategory = 0
title = Coyote Senior Docking Module
manufacturer = Kerbalmax Industries
description = A large connection for constructing spacecraft and space stations. It is fully compatabile with Clamp-O-Tron Senior standard docking ports.


bulkheadProfiles = size2

// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
attachRules = 1,0,1,1,0


// --- standard part parameters ---
mass = 2.0
dragModelType = default
maximum_drag = 0.2
minimum_drag = 0.2
angularDrag = 2
crashTolerance = 15
breakingForce = 50
breakingTorque = 50
maxTemp = 2000
fuelCrossFeed = True

MODULE
{
name = ModuleDockingNode
nodeType = size2
//nodeTransformName = dockingNode
//controlTransformName = controlNode
referenceAttachNode = top
}
MODULE
{
name = ModuleRCS
thrusterTransformName = rcsthrust
thrusterPower = 4
resourceName = MonoPropellant
resourceFlowMode = STAGE_PRIORITY_FLOW
atmosphereCurve
{
key = 0 240
key = 1 100
key = 4 0.001
}
}
}


[/CODE][/QUOTE]

cheers, this got it working for me but only once i uncommented the nodeTransformName and controlTransformName, until then i still didn't get the undock in menu. Thanks for all your help i really appreciate it.
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...