Difference between revisions of "Tutorial: Adding Airlocks and Ladders to Parts"

From Kerbal Space Program Wiki
Jump to: navigation, search
(Step 4 - Adding airlocks and ladders)
 
(15 intermediate revisions by 12 users not shown)
Line 1: Line 1:
== Adding Airlocks and Ladders to Parts ==
+
This [[tutorials|tutorial]] will teach you how to add airlocks for your [[Kerbonaut]]s to access, and [[ladder]]s for them to climb, directly to parts like how it is done with the current [[command module]]s.
This tutorial will teach you how to add airlocks your your Kerbonauts to access, and ladders for them to climb, directly to parts like what is done with the current command modules.
 
 
This will work for any part, not just command pods.
 
This will work for any part, not just command pods.
  
 
===Specifications===
 
===Specifications===
*'''Length:''' 10-15 minutes
+
*'''Length:''' 10–15 minutes
 
*'''Difficulty:''' Moderate
 
*'''Difficulty:''' Moderate
 
*'''For version:''' 0.16 and above
 
*'''For version:''' 0.16 and above
  
 
==Steps==
 
==Steps==
 
 
===Step 1 - Create Ladder and Airlock Boxes===
 
===Step 1 - Create Ladder and Airlock Boxes===
 
 
 
Add a simple box for your Ladders and/or airlocks in a modeling software of your choice.
 
Add a simple box for your Ladders and/or airlocks in a modeling software of your choice.
 
  
 
===Step 2 - Set up Unity===
 
===Step 2 - Set up Unity===
 
+
[[File:Import parttools.jpg|550px|thumb|center|Importing the new 0.16 parttools]]
 
 
[[File:Import_parttools.jpg|550px|thumb|center|Importing the new 0.16 parttools]]
 
  
 
Load up the unity editor and import the new parttools, then import your model and textures.
 
Load up the unity editor and import the new parttools, then import your model and textures.
 
After this, parent your model to a Gameobject with the KSP parttools components.
 
After this, parent your model to a Gameobject with the KSP parttools components.
  
 +
An important thing to remember with your model once imported, is that the origin of the model MUST be inside the model area that acts as a physics collider, ideally in its center. If this isn't so, you will find later on a problem ingame of "Hatch Obstructed, Cannot exit" Fiddling the center generally fixes this.
  
 
===Step 3 - Identifying airlocks and ladders===
 
===Step 3 - Identifying airlocks and ladders===
 +
[[File:identify airlockladders.jpg|550px|thumb|center|Adding new tags]]
  
 
+
Select your ladder or airlock mesh and add new tags by going into the TagManager and choosing "Ladder" and "Airlock" tags. In the same menu name one of the User Layers "Part Triggers".
[[File:identify_airlockladders.jpg|550px|thumb|center|Adding new tags]]
 
 
 
 
 
Select your ladder or airlock mesh and add new tags by going into the TagManager and choosing "Ladder" and "Airlock" tags. In the same menu name one of the User Layers "Part Triggers".  
 
  
 
====Note on ladders====
 
====Note on ladders====
 
+
It seems that ''"Part Triggers"'' name '''must''' be given to the '''layer #21''' (as shown in the picture). Otherwise ladders don't work.
It seems that ''"Part Triggers"'' name '''must''' be given to the '''layer #21''' (not the #8 shown in the picture below!). Otherwise ladders don't work.
 
  
 
Also, when placing ladders in ''Unity Editor'', keep in mind that Kerbal climbs up the ladder's <span style="color:green">'''local Y'''</span> (green) axis, facing <span style="color:blue">'''local Z'''</span> (blue). Note that ''Unity's'' "green" and "blue" axes may differ from those in your 3D modelling program.
 
Also, when placing ladders in ''Unity Editor'', keep in mind that Kerbal climbs up the ladder's <span style="color:green">'''local Y'''</span> (green) axis, facing <span style="color:blue">'''local Z'''</span> (blue). Note that ''Unity's'' "green" and "blue" axes may differ from those in your 3D modelling program.
  
 
===Step 4 - Adding airlocks and ladders===
 
===Step 4 - Adding airlocks and ladders===
 +
[[File:Unity Layereditor.png|300px|thumb|right|Setting tags]]
  
 
+
Select your airlock/ladder mesh and set the Tag to Airlock/Ladder and Layer to Part Triggers. Afterwards, delete the meshrender and make it a mesh collider, just like you would make a node_collider. Remember: airlock and ladder pivots must have same coordinates! And they should have some intersect with main collider.
[[File:Unity_Layereditor.png|300px|thumb|right|Setting tags]]
 
 
 
 
 
Select your airlock/ladder mesh and set the Tag to Airlock/Ladder and Layer to Part Triggers. Afterwards, delete the meshrender and make it a mesh collider, just like you would make a node_collider.
 
 
 
  
 
[[File:IsTrigger.jpg|400px|thumb|center|Setting tags]]
 
[[File:IsTrigger.jpg|400px|thumb|center|Setting tags]]
 
  
 
Tick the "Is Trigger" tickbox, and write with the parttools component as usual.
 
Tick the "Is Trigger" tickbox, and write with the parttools component as usual.
  
 
===Step 5 - Final Touches===
 
===Step 5 - Final Touches===
 
 
 
Add "CrewCapacity = # to your .cfg to define the total number of crew members that may enter.
 
Add "CrewCapacity = # to your .cfg to define the total number of crew members that may enter.
  
Line 62: Line 45:
  
 
Tutorial created by DYJ.
 
Tutorial created by DYJ.
[[Category:Tutorials]]
+
[[Category:Modding Tutorials]]

Latest revision as of 11:00, 13 March 2020

This tutorial will teach you how to add airlocks for your Kerbonauts to access, and ladders for them to climb, directly to parts like how it is done with the current command modules. This will work for any part, not just command pods.

Specifications

  • Length: 10–15 minutes
  • Difficulty: Moderate
  • For version: 0.16 and above

Steps

Step 1 - Create Ladder and Airlock Boxes

Add a simple box for your Ladders and/or airlocks in a modeling software of your choice.

Step 2 - Set up Unity

Importing the new 0.16 parttools

Load up the unity editor and import the new parttools, then import your model and textures. After this, parent your model to a Gameobject with the KSP parttools components.

An important thing to remember with your model once imported, is that the origin of the model MUST be inside the model area that acts as a physics collider, ideally in its center. If this isn't so, you will find later on a problem ingame of "Hatch Obstructed, Cannot exit" Fiddling the center generally fixes this.

Step 3 - Identifying airlocks and ladders

Adding new tags

Select your ladder or airlock mesh and add new tags by going into the TagManager and choosing "Ladder" and "Airlock" tags. In the same menu name one of the User Layers "Part Triggers".

Note on ladders

It seems that "Part Triggers" name must be given to the layer #21 (as shown in the picture). Otherwise ladders don't work.

Also, when placing ladders in Unity Editor, keep in mind that Kerbal climbs up the ladder's local Y (green) axis, facing local Z (blue). Note that Unity's "green" and "blue" axes may differ from those in your 3D modelling program.

Step 4 - Adding airlocks and ladders

Setting tags

Select your airlock/ladder mesh and set the Tag to Airlock/Ladder and Layer to Part Triggers. Afterwards, delete the meshrender and make it a mesh collider, just like you would make a node_collider. Remember: airlock and ladder pivots must have same coordinates! And they should have some intersect with main collider.

Setting tags

Tick the "Is Trigger" tickbox, and write with the parttools component as usual.

Step 5 - Final Touches

Add "CrewCapacity = # to your .cfg to define the total number of crew members that may enter.

And all done!

Now you should be able to use your ladders and airlocks in-game!

Tutorial created by DYJ.