Skip to content

3.0 Module Manager Configuration

Joseph Korinek edited this page May 20, 2015 · 15 revisions

Module Manager Configuration

CLS uses Module Manager, a plugin that allows adding to a part's configuration. Using Module manager, CLS adds a module named ModuleConnectedLivingSpace, to provide CLS with information on whether or not a part can contain crew, or is internally passable by a crew member.

Habitability/Passability Detection

When no MM config file exists for a part, CLS will attempt to determine if a part is habitable or passable based on existing information in the part.cfg file. Often it can properly determine what is needed and add the cls module. Sometimes it cannot. To correct this issue a config file can be created to provide the needed information.

MM Config file structure

Module Manager uses a JSON style file containing many wildcards and options for creating additional info for parts. it is beyond the scope of this wiki to describe all these features. It is essentially a language in and of itself, and is very powerful. For the purposes of this Wiki, some samples will be provided to help in understanding what CLS needs/expects to support its operations.

Here is a sample part configuration for a part in KW Rocketry:

@PART[KWFlatadapter2x1]:HAS[!MODULE[ModuleConnectedLivingSpace]] 
{
    MODULE
    {
	    name = ModuleConnectedLivingSpace
	    passable = true
    }
}

This config adds a module to a KW flat adpter. It checks to see if the module already exists and adds it if needed. Note the module name: ModuleConnectedLivingSpace. This module will be handled inside the CLS code to look for the properties listed in the module.

This part is an adapter, so Kerbals can pass through the part to another part. Therefore, the Passable flag exists and is set to true.

@PART[B9_Cockpit_S2]:HAS[!MODULE[ModuleConnectedLivingSpace]]
{
    MODULE
    {
	    name = ModuleConnectedLivingSpace
	    passable = true
	    impassablenodes = top
    }
}

This part, from B9, is a cockpit so it is passable, but the top node is not. So, an attribute named "impassablenodes" is set to "top". You can look at the samples provided by the many configs that come with CLS for clues on how to create your own config files. All attributes are detailed below.

Module Attributes

  • name = ModuleConnectedLivingSpace The Name of the Module will always stay the same. This is used to identify the module to CLS
  • passable = true/false This flag determine whether or not crew can pass through the part.
  • passableWhenSurfaceAttached = true/false This flag tells CLS when the part is surface attached (usually radially), that it is or is not passable.
  • surfaceAttachmentsPassable = true/false This flag tells CLS when a part has other parts attached to its surface if they are passable or not. So, you can have a part that is passable connected to a part that does not accept passable connections and therefore the passability would end up as false.

Clone this wiki locally