Skip to content

CFG documentation

JonnyOThan edited this page Sep 6, 2023 · 12 revisions

ModuleFreeIva

This is a module that must be placed in any part that can be traversed in FreeIva, or for customizing some behavior relating to FreeIva.

PART
{
    MODULE
    {
        name = ModuleFreeIva
        passThroughNodeA = top
        passThroughNodeB = bottom
        doesNotBlockEVA = true
    }
}
Name Type Default Notes
passThroughNodeA passThroughNodeB string (attachment node name) If not empty, specifies a pair of attachment nodes that hatches on either side should treat as a passthrough. This should be used for thin parts that should not obstruct a kerbal's movement but do not have internal models or hatches of their own. For example, a stack of batteries between two crewed parts. The hatches in the crewed parts will connect directly to each other, passing through the batteries. Do not include any prefixes (e.g. node_stack_top should just be top). Passthroughs are symmetric, it doesn't matter which one is A and which is B.
doesNotBlockEVA boolean false When true, specifies that this part should not obstruct going EVA from a hatch on the part that it is connected to. This should be used for hollow parts like cargo bays that don't have internal models of their own.

InternalModuleFreeIva

This is an internal module that should be placed inside the INTERNAL node of spaces that can be traversed in FreeIva.

INTERNAL
{
	MODULE
	{
		name = InternalModuleFreeIva
		shellColliderName = FreeIvaShell
		deployAnimationName = SomeAnimation
		internalDepthMaskName = depthMaskName
		externalDepthMaskName = depthMaskName
		externalDepthMaskFile = path/to/model
		windowName = someWindowName

		DisableCollider
		{
			colliderName = someCollider
		}

		Reparent
		{
			childTransformName = childName
			parentTransformName = parentName
			localPosition = 0,0,0
			localRotation = 0,0,0 // quaternions also acceptable here
			localScale = 1,1,1
		}

		DeleteInternalObject
		{
			objectName = someObject
		}

		Shadows
		{
			InteriorMain = TwoSided
			Glass_TestTube = Off
		}

		Cut
		{
			target = shell
			type = ProceduralCylinder
			radius = 0.45
			height = 1.89
			slices = 24
			position = 0, 0, -0.937
			rotation = 0, 0, 0
			scale = 1, 1, 1
		}
	}
}
Name Type Default Notes
shellColliderName string (transform name) If not empty, specifies a transform in the model that should be used as the collider shell for the internal space. Every MeshCollider in that transform and its children will have convex set to false, allowing arbitrary meshes to be used as shells. Colliders used for this purpose should have their layer set to 16. This key may be specified multiple times.
deployAnimationName string (animation name) Specifies the animation name from a ModuleAnimateGeneric on the PART config that should be used to control whether the part is deployed. This is used in conjunction with the requireDeploy field on the HatchConfig module.
internalDepthMaskName string (transform name) If not empty, specifies a transform in the model that will be activated when IVA mode is active and disabled when not in IVA mode. See Depth Masks for details. FreeIva will emit a warning if an internal space is missing detectable window shaders or an internal depth mask; you can specify this field with an empty string to silence the warning if the part doesn't have any windows.
externalDepthMaskName string (transform name) Specifies the external depth mask transform (the one used when IVA overlay mode is on). If not specified, FreeIva attempts to find this transform automatically by looking for meshes with the DepthMask shader. Only a single gameobject and its children can be the external depth mask. Therefore if some mesh has the depth mask shader and its children have other non-depthmask shaders, a warning will be emitted and the depth mask won't work. This transform will be deactivated when in IVA mode and activated when not in IVA mode. See Depth Masks for details.
externalDepthMaskFile string (model path) For internal spaces that have their external depth masks in a separate model file, use this to specify that the entire model file should be used as the external depth mask. See Depth Masks for details.
windowName string (transform name) See Depth Masks for details. This field can be specified multiple times.

DisableCollider

Specifies a set of collider names to disable permanently. The collider component is removed without removing the gameobject itself. Both this node and the colliderName field can be specified multiple times.

Reparent

Reparents a transform to somewhere else in the hierarchy. The localPosition, localRotation, and localScale fields are optional. If not specified then the object keeps its original transform. The Reparent node can be specified multiple times.

DeleteInternalObject

Specifies transform names to permanently remove from the internal space. Both the DeleteInternalObject node and the objectName field can be specified multiple times.

Shadows

Alters the shadow-casting properties of mesh renderers. Possible shadow values are Off, On, TwoSided, ShadowsOnly.

Cut

Specifies a section of the internal model to cut out. Usually used to remove baked-in geometry so that a hatch can be placed there.

Possible configurations:
Cut
{	
    target = target_object
    type = Mesh
    tool = tool_object
}
			    
Cut
{
    target = target_object
    type = Cube
    position = 0, 0, 0
    rotation = 0, 0, 0
    scale = 1, 1, 1
}	
			    
Cut
{
    target = target_object
    type = Cylinder
    position = 0, 0, 0
    rotation = 0, 0, 0
    scale = 1, 1, 1
}	
			    
Cut
{	
    target = target_object
    type = ProceduralCylinder
    radius = 0.5
    height = 1
    slices = 8
    position = 0, 0, 0
    rotation = 0, 0, 0
    scale = 1, 1, 1
}	
Name Type Notes
target string (transform name) Specifies the name of the transform that contains the mesh to cut
type string (Mesh, Cube, Cylinder, ProceduralCylinder) Specifies the type of geometry to cut with
position Vector3 The location of the cut
rotation Vector3 (euler) The orientation of the cut
scale Vector3 The scale of the cut
tool string (transform name) type = Mesh only. This is the name of a transform inside the model to use as a cutting tool. Note that this can be from a different MODEL node than the transform being cut out. The cutting mesh should be completely closed with normals facing outwards. The tool mesh will be removed afterwards.
radius height float type = ProceduralCylinder only. The dimensions of the cylinder
slices float type = ProceduralCylinder only. The number of slices in the cylinder. The default Unity cylinder primitive has 20 slices, but most KSP parts use 24.

HideInternalMesh

Used to make a given MeshRenderer in an IVA invisible.

Name Type Notes
meshIndex int The index of the MeshRenderer, which can be found using the UI. Required field.
meshName string The name of the MeshRenderer, which can be found using the UI. Required field.

FreeIvaHatch

This is an internal module that should be placed inside PROP configs.

PROP
{
    MODULE
    {
        name = FreeIvaHatch
        hatchOpenSoundFile = "FreeIva/Sounds/HatchOpen"
        hatchCloseSoundFile = "FreeIva/Sounds/HatchClose"
        handleTransformName = handle_interior
        doorTransformName = Hatch_Size1_Door
        tubeTransformName = tube
        cutoutTransformName = cutout
    }
}
Name Type Default Notes
hatchOpenSoundFile string (sound path) FreeIva/Sounds/HatchOpen The sound to play when the hatch is opened.
hatchCloseSoundFile string (sound path) FreeIva/Sounds/HatchClose The sound to play when the hatch is closed.
handleTransformName string (transform name) The name of a collider that can be clicked to open or close the hatch.
doorTransformName string (transform name) The name of the transform that represents the door part of the hatch. This transform and all of its children will be deactivated when the hatch is open and reactivated when it is closed.
tubeTransformName string (transform name) The name of a transform that contains the tube geometry for the hatch. Tubes are used to connect hatches that have separation between them. Often a hatch is placed some distance on the "inside" of where the part's attachment node is. To prevent a kerbal from slipping or seeing out of that gap between the hatches, the tube is scaled to reach from the hatch to the attachment node. Tubes should start at Y=0 and extend to Y=-1 in order to be scaled propery. They should be surrounded by colliders and have a flange on the bottom side so that there is no gap if they meet a larger tube. image
cutoutTransformName string (transform name) If not empty, specifies a mesh in the prop's model to use to cut out geometry from the internal shell. Must be configured per prop placement (see HatchConfig below). This mesh is removed regardless if it was used for cutting.

HatchConfig

This node can be placed inside PROP nodes inside INTERNAL nodes (i.e. per placement of a prop) to configure aspects of that hatch.

INTERNAL
{
    PROP
    {
        MODULE
        {
            name = HatchConfig
            attachNodeId = top
            airlockName = airlock
            tubeExtent = 2
            hideDoorWhenConnected = false
            dockingPortNodeName = dockingNode
            cutoutTargetTransformName = shell
            requireDeploy = true
            isEvaHatch = true
            HideWhenOpen
            {
                name = rung
                position = -0.162, 0.839, -0.011
            }
	}
    }
}
Name Type Default Notes
attachNodeId string (attach node) If not empty, specifies the attachment node that this hatch is associated with for this part. Do not include prefixes (e.g. use top instead of node_stack_top). This is used to connect hatches between parts that are connected at nodes. If not specified, this hatch can only be used to go EVA. The position of the attachment node is also used to automatically scale the hatch's tube length.
airlockName string (external model transform) If not empty, specifies the airlock transform on the part model to spawn the kerbal at when going EVA
tubeExtent float 0 When non-zero, scales the hatch's tube so that it reaches this distance from the center of the internal model. If not specified, the position of the attachNode is used instead.
hideDoorWhenConnected boolean false If true, this hatch will automatically and permanently open if there is another hatch connected to it. This can be useful for small parts like docking ports which are really just extensions of another part's hatch.
dockingPortNodeName string (part transform name) If not empty, specifies the docking node that is associated with this hatch. This should be set to the nodeTransformName field of a ModuleDockingNode on the PART config; this defaults to "dockingNode" if not included in the MODULE config. Note that many docking ports have both a docking node (used when docking in flight) and an attachnode (used when attaching things in the editor) and you need to hook up both in the hatch config.
cutoutTargetTransformName string (transform name) If not empty, specifies the name of a mesh inside the internal model to cut out using this prop's cutoutTransformName as a cutting tool.
requireDeploy boolean false If true, then this hatch will be locked unless the part is deployed. The following modules can support deployment: ModuleAnimateGeneric (Squad, requires deployAnimationName to be set in the InternalModuleFreeIva config), ModuleDeployableHabitat (SSPX), PlanetaryModule (KPBS), Habitat (Kerbalism).
isEvaHatch boolean false If true, interacting with this hatch will try to EVA from the part's primary airlock.
HideWhenOpen Specifies transforms in the internal model that should be hidden when the hatch is opened. The position must be included to disambiguate potential transforms of the same name.

PropBuckleButton

This is an internal module that can be placed inside a prop to make it clickable for interacting with seats. Clicking a buckle button while seated will unbuckle, and clicking one while unbuckled will enter a seat within a certain range of the buckle button.

PROP
{
	MODULE
	{
		name = PropBuckleButton
		transformName = ExtHandle6
		Collider
		{
			shape = Capsule
			center = 0,0,0
			radius = 0.01
			height = 0.26
			axis = Y
		}
	}
}
Name Type Default Notes
transformName string (transform name) The name of the transform that contains a collider for the user to click. This may be baked into the model or procedurally generated (see below).

Collider

Generates a collider on the named transform.

Name Type Default Notes
shape string (Capsule, Box, Sphere) Determines the shape of the collider
center Vector3 The center of the collider
radius float Capsule and Sphere only
height float Capsule only
axis string (X, Y, Z) Capsule only
dimensions Vector3 Box only