-
Notifications
You must be signed in to change notification settings - Fork 19
Controllers
Controllers define the way your effects interact with the game, for example by changing with engine throttle or atmospheric effects.
There are two ways to create and edit Controllers.
You can add Controllers by adding them in the ingame Editor UI. See the UI Page for more details.
You can add Controllers by adding CONTROLLER
nodes in the body of the ModuleWaterfallEffect
config, which look like this:
CONTROLLER
{
// The name of the controller, which should be unique
name = atmosphereDepth
// The ingame variable to link to. Only a few values are possible
linkedTo = atmosphere_density
}
These variables work as follows:
- Name: The name variable lets you give the controller a name. This will allow Effect Modifiers to link to a controller, so make sure it is something you like writing and not too long.
-
linkedTo: The ingame field that controls how it behaves. Valid values are currently
throttle
,atmosphere_density
,random
,custom
When configuring your effect module, it is usually enough to have a throttle controller and an atmospheric depth controller. However, you can add other controllers, each type is detailed below
A throttle controller links to the engine throttle. It has a value of linkedTo
of throttle
and the following paramaters
-
engineID
, which is a field used to link the controller to a specific instance of ModuleEngines on a part. -
responseRateUp
, which is a field used to control the response rate as the engine spools up -
responseRateDown
, which is a field used to control the response rate as the engines spools down
CONTROLLER
{
// The name of the controller, which should be unique
name = throttle
// The ingame variable to link to. Only a few values are possible
linkedTo = throttle
// The ModuleEngines engineID to follow
engineID = none
// The response rate as the engine spools up
responseRateUp = 1
// The response rate as the engines spools down
responseRateDown = 1
}
A thrust controller links to the engine normalized thrust. It has a value of linkedTo
of thrust
and the following parameters
-
engineID
, which is a field used to link the controller to a specific instance of ModuleEngines on a part.
CONTROLLER
{
// The name of the controller, which should be unique
name = thrust
// The ingame variable to link to. Only a few values are possible
linkedTo = thrust
// The ModuleEngines engineID to follow
engineID = none
}
This controller links to the atmospheric depth. It has no special parameters beyond a value of linkedTo
of atmosphere_depth
CONTROLLER
{
// The name of the controller, which should be unique
name = atmosphereDepth
// The ingame variable to link to. Only a few values are possible
linkedTo = atmosphere_depth
}
This controller creates randomness that can be used in effects. It has a value of linkedTo
of random
. It can be configured with different random distributions, these can be Uniform or Perlin.
Uniform noise generates random values between two numbers. It is specified by a noiseType
of random
. It has an additional parameter of range
, which is a field used to specify the minimum and maximum of the randomness generated.
CONTROLLER
{
// The name of the controller, which should be unique
name = random
// The ingame variable to link to. Only a few values are possible
linkedTo = random
// The noise distribution type
noiseType = random
// distribution parameters
range = -1,1
}
Perlin noise generates scrolling predictable values between two numbers. It is specified by a noiseType
of perlin
. It has additional parameters:
-
seed
, which is a field used to specify the noise starting point -
speed
, which is a field used to specify the rate at which values change -
minimum
, which is a field used to specify the minimum value of the noise -
scale
, which is a field used to specify the maximum value of the noise
CONTROLLER
{
// The name of the controller, which should be unique
name = random
// The ingame variable to link to. Only a few values are possible
linkedTo = random
// The noise distribution type
noiseType = perlin
// distribution parameters
minimum = 0
scale = 1
speed = 2
seed = 0
}
This controller links the effects to RCS thrust. It has a value of linkedTo
of rcs
.
-
thrusterTransformName
, the name of the thruster transforms in the ModuleRCSFX you want to control
IMPORTANT: When linking to RCS, it is essential that the number and order of effect transforms specified in the effect match the ones the RCS uses to generate thrust.
CONTROLLER
{
// The name of the controller, which should be unique
name = rcs
// The ingame variable to link to. Only a few values are possible
linkedTo = rcs
thrusterTransformName = thruster
}
This controller links the effects to the engine's gimbal, outputting a value of 1 when the gimbal is fully actuated along the axis and -1 along the reverse. It has a value of linkedTo
of gimbal
. It requires the specification of an additional axis
parameter.
CONTROLLER
{
// The name of the controller, which should be unique
name = gimbal
// The ingame variable to link to. Only a few values are possible
linkedTo = gimbal
// axis to link to
axis = x
}
This controller links to the mach number. It has no special parameters beyond a value of linkedTo
of mach
CONTROLLER
{
// The name of the controller, which should be unique
name = mach
// The ingame variable to link to. Only a few values are possible
linkedTo = mach
}
This controller is designed to allow effects to be controlled by specific engine events, like startup, shutdown It has a value of linkedTo
of engineEvent
.
Using this controller requires additional configuration depending on the event, which is specified in the eventName
field
This event plays when the engine is ignited from an off state.
CONTROLLER
{
// The name of the controller, which should be unique
name = ignition
// The ingame variable to link to. Only a few values are possible
linkedTo = engineEvent
// The event
eventName = ignition
// The duration of the event in seconds
eventDuration = 2
// The values supplied by the controller during the event. keys are time, values are output values
eventCurve
{
key = 0 0
key = 0.2 1
key = 2 0
}
}
This event plays when the engine is disabled from an on state.
CONTROLLER
{
// The name of the controller, which should be unique
name = flameout
// The ingame variable to link to. Only a few values are possible
linkedTo = engineEvent
// The event
eventName = flameout
// The duration of the event in seconds
eventDuration = 2
// The values supplied by the controller during the event. keys are time, values are output values
eventCurve
{
key = 0 0
key = 0.2 1
key = 2 0
}
}
This controller is a blank slate that can be operated on by other modules to drive effects. It has a value of linkedTo
of custom
.
CONTROLLER
{
// The name of the controller, which should be unique
name = custom1
// The ingame variable to link to. Only a few values are possible
linkedTo = custom
}