Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // A Series of patches for the Kerbonov parts pack, including the Kn-2, the Kn-7, the passenber cabin, and if all goes well, the antenna.
- // Descriptions, headers, format, etc. gratuitously lifted from other examples in the Indicator Lights mod by Snark.
- //Add an indicator (replace one of the bulbs) on the VHF antenna. The other bulb is left as a static "light" element on the model that does not function. Possibly cover that with an additional indicator for available data to transmit? whether it has power?
- @PART[VHFTransceiver]:NEEDS[kerbonov]
- {
- //-------------------------------------------------------------------------
- // INDICATOR MESHES
- //-------------------------------------------------------------------------
- MODEL
- {
- model = IndicatorLights/Meshes/z100lamp
- scale = 0.4, 0.4, 0.4
- position = 0.0297, 0.0518, -0.0779
- rotation = 0, 0, 0
- }
- //-------------------------------------------------------------------------
- // CONTROLLABLE EMISSIVES
- //-------------------------------------------------------------------------
- MODULE {
- name = ModuleControllableEmissive
- target = IndicatorLights/Meshes/z100lamp
- emissiveName = indicator
- }
- //-------------------------------------------------------------------------
- // CONTROLLERS
- //-------------------------------------------------------------------------
- MODULE {
- name = ModuleDataTransmitterIndicator
- emissiveName = indicator
- // Get really fancy with busy color. This module type exposes one static
- // field, dataRate. We'll use a random flicker for the animation (like
- // an old-time modem), and we'll plug the data rate both into the flicker
- // period (so higher-speed antennas flicker faster), and into the bias
- // (so higher-speed antennas spend a greater percentage of their time
- // in the "on" state rather than "off").
- //
- // We don't actually have to use the static syntax here (we could just
- // take the data rate for this antenna, do the math, and plug in the
- // literal numbers here). However, using the actual static expression
- // comes with a few benefits. First, it's more maintainable: we
- // can just use the same static expression for all the antennas, rather
- // than having to come up with a different expression with different math
- // for each one. Second, it's more explicit to anyone reading this just
- // *why* the number is what it is. Third, it's more robust: if Squad ever
- // tinkers with the data rates, or someone uses ModuleManager to tweak
- // them, this will automatically follow suit. Fourth, it's friendlier
- // to modders: if you have your own antenna and you want to set it up
- // for IndicatorLights compatibility, you can just copy the following
- // line verbatim and you'll get behavior that's consistent with what
- // IndicatorLights does with the stock antennas.
- busyColor = random($ToggleLED, $Off, divide(400, static(dataRate)), between(subtract(multiply(sqrt(static(dataRate)), 1.1), 2.3), -0.4, 0.5))
- }
- }
- // Add a single crew indicator to the KPM-1 Small Inline Passenger Compartment
- @PART[InlinePassengerCan]:NEEDS[Kerbonov]
- {
- //-------------------------------------------------------------------------
- // INDICATOR MESHES
- //-------------------------------------------------------------------------
- MODEL
- {
- model = IndicatorLights/Meshes/squareLamp
- scale = 0.230, 1.0, 0.5
- position = -0.5544, 0, 0.27555
- rotation = 0, -67.5, 0
- }
- //-------------------------------------------------------------------------
- // CONTROLLABLE EMISSIVES
- //-------------------------------------------------------------------------
- MODULE {
- name = ModuleControllableEmissive
- target = IndicatorLights/Meshes/squareLamp:0
- emissiveName = indicator0
- }
- //-------------------------------------------------------------------------
- // CONTROLLERS
- //-------------------------------------------------------------------------
- MODULE {
- name = ModuleCrewIndicatorToggle
- toggleName = indicatorToggle
- }
- MODULE {
- name = ModuleCrewIndicator
- controllerName = crewController0
- toggleName = indicatorToggle
- }
- MODULE
- {
- name = ModuleScienceAvailabilityIndicator
- controllerName = availability0
- experimentID = crewReport
- lowValueColor = crewController0
- mediumValueColor = highValueColor
- highValueColor = blink(lowValueColor, 200, $Off, 200)
- }
- MODULE {
- name = ModuleScienceDataIndicator
- experimentID = crewReport
- emissiveName = indicator0
- dataColor = crewController0
- emptyColor = availability0
- }
- //-------------------------------------------------------------------------
- // TWEAKS
- //-------------------------------------------------------------------------
- // This pod uses a ModuleColorChanger to handle its ablator, set up
- // so that by default it takes control of *all* emissives on the part.
- // Need to tell it not to tinker with the meshes that we're adding here;
- // otherwise, the crew indicator will end up getting colored with the
- // ablator instead of actually working as a crew indicator.
- @MODULE[ModuleColorChanger] {
- excludedRenderer = IndicatorLights/Meshes/squareLamp(Clone)
- }
- }
- // Add crew indicators (3) to the Kn-7 Cabin
- @PART[KN7Cabin]:NEEDS[Kerbonov]
- {
- //-------------------------------------------------------------------------
- // INDICATOR MESHES
- //-------------------------------------------------------------------------
- MODEL
- {
- model = IndicatorLights/Meshes/nubbinLamp
- scale = 0.7, 0.7, 0.5
- position = -0.6057, -1.1668, 0.4582
- rotation = 0, -60, 0
- }
- MODEL
- {
- model = IndicatorLights/Meshes/nubbinLamp
- scale = 0.7, 0.7, 0.5
- position = -0.6057, -1.2668, 0.4582
- rotation = 0, -60, 0
- }
- MODEL
- {
- model = IndicatorLights/Meshes/nubbinLamp
- scale = 0.7, 0.7, 0.5
- position = -0.6057, -1.3668, 0.4582
- rotation = 0, -60, 0
- }
- //-------------------------------------------------------------------------
- // CONTROLLABLE EMISSIVES
- //-------------------------------------------------------------------------
- MODULE {
- name = ModuleControllableEmissive
- target = IndicatorLights/Meshes/nubbinLamp:0
- emissiveName = indicator0
- }
- MODULE {
- name = ModuleControllableEmissive
- target = IndicatorLights/Meshes/nubbinLamp:1
- emissiveName = indicator1
- }
- MODULE {
- name = ModuleControllableEmissive
- target = IndicatorLights/Meshes/nubbinLamp:2
- emissiveName = indicator2
- }
- //-------------------------------------------------------------------------
- // CONTROLLERS
- //-------------------------------------------------------------------------
- MODULE {
- name = ModuleCrewIndicatorToggle
- toggleName = indicatorToggle
- }
- MODULE {
- name = ModuleCrewIndicator
- controllerName = crewController0
- toggleName = indicatorToggle
- }
- MODULE {
- name = ModuleCrewIndicator
- controllerName = crewController1
- toggleName = indicatorToggle
- }
- MODULE {
- name = ModuleCrewIndicator
- controllerName = crewController2
- toggleName = indicatorToggle
- }
- MODULE
- {
- name = ModuleScienceAvailabilityIndicator
- controllerName = availability0
- experimentID = crewReport
- lowValueColor = crewController0
- mediumValueColor = highValueColor
- highValueColor = blink(lowValueColor, 200, $Off, 200)
- }
- MODULE
- {
- name = ModuleScienceAvailabilityIndicator
- controllerName = availability1
- experimentID = crewReport
- lowValueColor = crewController1
- mediumValueColor = highValueColor
- highValueColor = blink(lowValueColor, 200, $Off, 200)
- }
- MODULE
- {
- name = ModuleScienceAvailabilityIndicator
- controllerName = availability2
- experimentID = crewReport
- lowValueColor = crewController2
- mediumValueColor = highValueColor
- highValueColor = blink(lowValueColor, 200, $Off, 200)
- }
- MODULE {
- name = ModuleScienceDataIndicator
- experimentID = crewReport
- emissiveName = indicator0
- dataColor = crewController0
- emptyColor = availability0
- }
- MODULE {
- name = ModuleScienceDataIndicator
- experimentID = crewReport
- emissiveName = indicator1
- dataColor = crewController1
- emptyColor = availability1
- }
- MODULE {
- name = ModuleScienceDataIndicator
- experimentID = crewReport
- emissiveName = indicator2
- dataColor = crewController2
- emptyColor = availability2
- }
- //-------------------------------------------------------------------------
- // TWEAKS
- //-------------------------------------------------------------------------
- // This pod uses a ModuleColorChanger to handle its ablator, set up
- // so that by default it takes control of *all* emissives on the part.
- // Need to tell it not to tinker with the meshes that we're adding here;
- // otherwise, the crew indicator will end up getting colored with the
- // ablator instead of actually working as a crew indicator.
- @MODULE[ModuleColorChanger] {
- excludedRenderer = IndicatorLights/Meshes/nubbinLamp(Clone)
- }
- }
- // Add crew indicators (3) to the Kn-2 Cabin
- @PART[KN2Cabin]:NEEDS[Kerbonov]
- {
- //-------------------------------------------------------------------------
- // INDICATOR MESHES
- //-------------------------------------------------------------------------
- MODEL
- {
- model = IndicatorLights/Meshes/nubbinLamp
- scale = 0.7, 0.7, 0.5
- position = -0.5594, -0.3261, -0.2687
- rotation = 0, -110, 0
- }
- MODEL
- {
- model = IndicatorLights/Meshes/nubbinLamp
- scale = 0.7, 0.7, 0.5
- position = -0.5594, -0.4261, -0.2687
- rotation = 0, -110, 0
- }
- MODEL
- {
- model = IndicatorLights/Meshes/nubbinLamp
- scale = 0.7, 0.7, 0.5
- position = -0.5594, -0.5261, -0.2687
- rotation = 0, -110, 0
- }
- //-------------------------------------------------------------------------
- // CONTROLLABLE EMISSIVES
- //-------------------------------------------------------------------------
- MODULE {
- name = ModuleControllableEmissive
- target = IndicatorLights/Meshes/nubbinLamp:0
- emissiveName = indicator0
- }
- MODULE {
- name = ModuleControllableEmissive
- target = IndicatorLights/Meshes/nubbinLamp:1
- emissiveName = indicator1
- }
- MODULE {
- name = ModuleControllableEmissive
- target = IndicatorLights/Meshes/nubbinLamp:2
- emissiveName = indicator2
- }
- //-------------------------------------------------------------------------
- // CONTROLLERS
- //-------------------------------------------------------------------------
- MODULE {
- name = ModuleCrewIndicatorToggle
- toggleName = indicatorToggle
- }
- MODULE {
- name = ModuleCrewIndicator
- controllerName = crewController0
- toggleName = indicatorToggle
- }
- MODULE {
- name = ModuleCrewIndicator
- controllerName = crewController1
- toggleName = indicatorToggle
- }
- MODULE {
- name = ModuleCrewIndicator
- controllerName = crewController2
- toggleName = indicatorToggle
- }
- MODULE
- {
- name = ModuleScienceAvailabilityIndicator
- controllerName = availability0
- experimentID = crewReport
- lowValueColor = crewController0
- mediumValueColor = highValueColor
- highValueColor = blink(lowValueColor, 200, $Off, 200)
- }
- MODULE
- {
- name = ModuleScienceAvailabilityIndicator
- controllerName = availability1
- experimentID = crewReport
- lowValueColor = crewController1
- mediumValueColor = highValueColor
- highValueColor = blink(lowValueColor, 200, $Off, 200)
- }
- MODULE
- {
- name = ModuleScienceAvailabilityIndicator
- controllerName = availability2
- experimentID = crewReport
- lowValueColor = crewController2
- mediumValueColor = highValueColor
- highValueColor = blink(lowValueColor, 200, $Off, 200)
- }
- MODULE {
- name = ModuleScienceDataIndicator
- experimentID = crewReport
- emissiveName = indicator0
- dataColor = crewController0
- emptyColor = availability0
- }
- MODULE {
- name = ModuleScienceDataIndicator
- experimentID = crewReport
- emissiveName = indicator1
- dataColor = crewController1
- emptyColor = availability1
- }
- MODULE {
- name = ModuleScienceDataIndicator
- experimentID = crewReport
- emissiveName = indicator2
- dataColor = crewController2
- emptyColor = availability2
- }
- //-------------------------------------------------------------------------
- // TWEAKS
- //-------------------------------------------------------------------------
- // This pod uses a ModuleColorChanger to handle its ablator, set up
- // so that by default it takes control of *all* emissives on the part.
- // Need to tell it not to tinker with the meshes that we're adding here;
- // otherwise, the crew indicator will end up getting colored with the
- // ablator instead of actually working as a crew indicator.
- @MODULE[ModuleColorChanger] {
- excludedRenderer = IndicatorLights/Meshes/nubbinLamp(Clone)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement