fix: carry signals as NetworkValue, not NetworkToggle
v1.0.0 loaded cleanly and did nothing in game. Every vanilla use of NetworkToggle and NetworkToggleReceiver -- all three of them -- sets IncludeInPhysical = false. They are blueprint stat-display plumbing and carry no signal on a real ship, so the receivers always read off, the vent gate stayed open, and radiators behaved exactly as in vanilla. Broadcast 1/0 through NetworkValue and threshold it back into a toggle on the receiving side. That is what the thermal amplification pump uses to drive physical behaviour, and vanilla never sets IncludeInPhysical on it anywhere. Also repoint the radiator's power indicator at the gate, so an auto-idled radiator is visibly idle instead of looking identical to a working one. Tests grow a guard against the blueprint-only types, plus a check that re-verifies that premise against the installed game data so the guard cannot go stale, and a name-collision check against vanilla components. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011oLWY1G6S8U35bi2FxVWni
This commit is contained in:
@@ -1,23 +1,36 @@
|
||||
// ABOUT ME
|
||||
// A single component merged into the Missile Launcher. It broadcasts, over the
|
||||
// heat network, whether this launcher is currently set to Thermal Canister
|
||||
// Missiles.
|
||||
// Components merged into the Missile Launcher. They broadcast, over the heat
|
||||
// network, whether this launcher is currently set to Thermal Canister Missiles.
|
||||
//
|
||||
// Why it exists: banking heat is only worth anything if something on the ship
|
||||
// actually spends heat as ammunition. On a ship with no thermal launchers,
|
||||
// holding the heat network near full buys nothing, so the radiators should just
|
||||
// behave as they do in vanilla. Radiators treat the absence of this broadcast
|
||||
// as permission to vent freely.
|
||||
// behave as they do in vanilla. Radiators treat a received 0 as permission to
|
||||
// vent freely.
|
||||
//
|
||||
// ThermalMissilesToggle is the launcher's own vanilla mode toggle
|
||||
// (ModeToggle, Mode = MissileType, OnMode = 4), so this signal follows the
|
||||
// player's ammunition selection live, including mid-battle switches.
|
||||
//
|
||||
// Carried as a NetworkValue rather than a NetworkToggle: vanilla marks every
|
||||
// NetworkToggle IncludeInPhysical = false, so they do not carry a signal on a
|
||||
// real ship.
|
||||
|
||||
NetworkedThermalAmmoUser
|
||||
AutoRad_One { Type = StaticValue; Value = 1 }
|
||||
AutoRad_Zero { Type = StaticValue; Value = 0 }
|
||||
|
||||
AutoRad_ThermalAmmoValue
|
||||
{
|
||||
Type = NetworkToggle
|
||||
ToggleSource = ThermalMissilesToggle
|
||||
Type = ToggleValueSelector
|
||||
Toggle = ThermalMissilesToggle
|
||||
ToggleOnValue = AutoRad_One
|
||||
ToggleOffValue = AutoRad_Zero
|
||||
}
|
||||
|
||||
AutoRad_NetworkedThermalAmmo
|
||||
{
|
||||
Type = NetworkValue
|
||||
ValueSource = AutoRad_ThermalAmmoValue
|
||||
Categories = [ auto_radiator_ammo_user ]
|
||||
IncludeInPhysical = true
|
||||
IncludeInBlueprints = false
|
||||
}
|
||||
|
||||
@@ -14,8 +14,12 @@
|
||||
//
|
||||
// The timer holds the signal for a few seconds so a stream of per-tick overflow
|
||||
// events becomes one steady "vent now" rather than a flicker.
|
||||
//
|
||||
// Carried as a NetworkValue rather than a NetworkToggle: vanilla marks every
|
||||
// NetworkToggle IncludeInPhysical = false, so they do not carry a signal on a
|
||||
// real ship.
|
||||
|
||||
Overflow_VentTimer
|
||||
AutoRad_OverflowTimer
|
||||
{
|
||||
Type = Timer
|
||||
Duration = 3
|
||||
@@ -24,11 +28,21 @@ Overflow_VentTimer
|
||||
ResetTrigger = OverflowHeatStorage
|
||||
}
|
||||
|
||||
Overflow_NetworkedForceVent
|
||||
AutoRad_One { Type = StaticValue; Value = 1 }
|
||||
AutoRad_Zero { Type = StaticValue; Value = 0 }
|
||||
|
||||
AutoRad_OverflowValue
|
||||
{
|
||||
Type = NetworkToggle
|
||||
ToggleSource = Overflow_VentTimer
|
||||
Type = ToggleValueSelector
|
||||
Toggle = AutoRad_OverflowTimer
|
||||
ToggleOnValue = AutoRad_One
|
||||
ToggleOffValue = AutoRad_Zero
|
||||
}
|
||||
|
||||
AutoRad_NetworkedForceVent
|
||||
{
|
||||
Type = NetworkValue
|
||||
ValueSource = AutoRad_OverflowValue
|
||||
Categories = [ auto_radiator_force_vent ]
|
||||
IncludeInPhysical = true
|
||||
IncludeInBlueprints = false
|
||||
}
|
||||
|
||||
@@ -1,60 +1,77 @@
|
||||
// ABOUT ME
|
||||
// Components merged into the Radiator. They combine the three network signals
|
||||
// this mod broadcasts into a single gate, AutoPowerToggle, which mod.rules then
|
||||
// substitutes for the radiator's vanilla PowerToggle on the parts of the
|
||||
// radiator that actually dissipate heat.
|
||||
// Components merged into the Radiator. They receive the three network values
|
||||
// this mod broadcasts and combine them into a single gate, AutoPowerToggle,
|
||||
// which mod.rules then substitutes for the radiator's vanilla PowerToggle on
|
||||
// the parts of the radiator that actually dissipate heat.
|
||||
//
|
||||
// Each broadcast arrives as a number, 1 or 0, summarised across the network by
|
||||
// a NetworkValueReceiver and turned back into a toggle by a threshold at 0.5.
|
||||
// A network with no broadcaster at all yields 0, which is why a ship without
|
||||
// thermal batteries or thermal launchers keeps vanilla behaviour.
|
||||
//
|
||||
// The player's manual on/off switch (PowerToggle) is preserved and still wins:
|
||||
// a radiator the player has switched off stays off. The automation can only
|
||||
// idle a radiator the player has left on.
|
||||
//
|
||||
// A radiator vents when ANY of these hold:
|
||||
// - the heat network is not asking it to hold (no battery, or battery full)
|
||||
// - the network is not asking it to hold (no battery, or battery full)
|
||||
// - no launcher on the network is using thermal ammunition
|
||||
// - some part is overflowing heat right now (safety net, overrides all)
|
||||
// - some part is overflowing heat right now (safety net, overrides all)
|
||||
|
||||
HoldVentReceiver
|
||||
AutoRad_HoldSignal
|
||||
{
|
||||
Type = NetworkToggleReceiver
|
||||
Type = NetworkValueReceiver
|
||||
Categories = [ auto_radiator_hold ]
|
||||
Mode = Any
|
||||
Mode = Max
|
||||
AllowUncategorized = false
|
||||
}
|
||||
|
||||
ThermalAmmoReceiver
|
||||
AutoRad_ThermalAmmoSignal
|
||||
{
|
||||
Type = NetworkToggleReceiver
|
||||
Type = NetworkValueReceiver
|
||||
Categories = [ auto_radiator_ammo_user ]
|
||||
Mode = Any
|
||||
Mode = Max
|
||||
AllowUncategorized = false
|
||||
}
|
||||
|
||||
ForceVentReceiver
|
||||
AutoRad_ForceVentSignal
|
||||
{
|
||||
Type = NetworkToggleReceiver
|
||||
Type = NetworkValueReceiver
|
||||
Categories = [ auto_radiator_force_vent ]
|
||||
Mode = Any
|
||||
Mode = Max
|
||||
AllowUncategorized = false
|
||||
}
|
||||
|
||||
NotHolding
|
||||
AutoRad_IsHolding
|
||||
{
|
||||
Type = MultiToggle
|
||||
Toggles = [ HoldVentReceiver ]
|
||||
Mode = None
|
||||
Type = ThresholdToggle
|
||||
ValueFrom = AutoRad_HoldSignal
|
||||
MinAmount = 0.5
|
||||
}
|
||||
|
||||
NoThermalAmmo
|
||||
AutoRad_ThermalAmmoInUse
|
||||
{
|
||||
Type = MultiToggle
|
||||
Toggles = [ ThermalAmmoReceiver ]
|
||||
Mode = None
|
||||
Type = ThresholdToggle
|
||||
ValueFrom = AutoRad_ThermalAmmoSignal
|
||||
MinAmount = 0.5
|
||||
}
|
||||
|
||||
VentAllowed
|
||||
AutoRad_ForceVent
|
||||
{
|
||||
Type = ThresholdToggle
|
||||
ValueFrom = AutoRad_ForceVentSignal
|
||||
MinAmount = 0.5
|
||||
}
|
||||
|
||||
AutoRad_VentAllowed
|
||||
{
|
||||
Type = MultiToggle
|
||||
Toggles = [ NotHolding, NoThermalAmmo, ForceVentReceiver ]
|
||||
Toggles
|
||||
[
|
||||
{ Toggle = AutoRad_IsHolding; Invert = true }
|
||||
{ Toggle = AutoRad_ThermalAmmoInUse; Invert = true }
|
||||
AutoRad_ForceVent
|
||||
]
|
||||
Mode = Any
|
||||
}
|
||||
|
||||
@@ -63,6 +80,6 @@ VentAllowed
|
||||
AutoPowerToggle
|
||||
{
|
||||
Type = MultiToggle
|
||||
Toggles = [ PowerToggle, VentAllowed ]
|
||||
Toggles = [ PowerToggle, AutoRad_VentAllowed ]
|
||||
Mode = All
|
||||
}
|
||||
|
||||
@@ -3,18 +3,26 @@
|
||||
// gauge, so it is what decides whether the heat network has surplus worth
|
||||
// venting, and broadcasts that decision to every radiator on the network.
|
||||
//
|
||||
// Polarity is deliberate: the battery broadcasts "HOLD" (do not vent), not
|
||||
// "vent". A ship with no thermal battery therefore has no broadcaster, every
|
||||
// radiator's receiver reads off, and radiators behave exactly as in vanilla.
|
||||
// The broadcast is a NetworkValue carrying 1 (hold) or 0 (vent), not a
|
||||
// NetworkToggle. Every NetworkToggle in vanilla sets IncludeInPhysical = false
|
||||
// -- they exist only for blueprint stat display and do not carry a signal on a
|
||||
// real ship. NetworkValue has no such restriction and is what the thermal
|
||||
// amplification pump uses to drive actual physical behaviour.
|
||||
//
|
||||
// Polarity is deliberate: the battery broadcasts "HOLD", not "vent". A ship
|
||||
// with no thermal battery has no broadcaster, every radiator reads 0, and
|
||||
// radiators behave exactly as in vanilla.
|
||||
//
|
||||
// Heat storage fullness causes no damage on its own -- damage only occurs when
|
||||
// the network refuses heat and it overflows onto the producing part
|
||||
// (base_part_overclock.rules: HeatDistributionStorage adds InOrder, network
|
||||
// first, OverflowHeatStorage second). So the band sits high on purpose, keeping
|
||||
// the network full as a deep ammunition reserve for Thermal Canister Missiles.
|
||||
//
|
||||
// All names are prefixed to avoid colliding with vanilla component names.
|
||||
|
||||
// Vent when the battery is essentially full.
|
||||
VentCeiling
|
||||
AutoRad_VentCeiling
|
||||
{
|
||||
Type = ThresholdToggle
|
||||
ValueFrom = HeatStorage
|
||||
@@ -22,59 +30,63 @@ VentCeiling
|
||||
}
|
||||
|
||||
// Stop venting once there is real headroom again.
|
||||
VentFloor
|
||||
AutoRad_VentFloor
|
||||
{
|
||||
Type = ThresholdToggle
|
||||
ValueFrom = HeatStorage
|
||||
MaxAmount = 94%
|
||||
}
|
||||
|
||||
VentCeilingTrigger
|
||||
AutoRad_CeilingTrigger
|
||||
{
|
||||
Type = ToggleTrigger
|
||||
Toggle = VentCeiling
|
||||
Toggle = AutoRad_VentCeiling
|
||||
TriggerWhenOn = true
|
||||
TriggerWhenOff = false
|
||||
}
|
||||
|
||||
VentFloorTrigger
|
||||
AutoRad_FloorTrigger
|
||||
{
|
||||
Type = ToggleTrigger
|
||||
Toggle = VentFloor
|
||||
Toggle = AutoRad_VentFloor
|
||||
TriggerWhenOn = true
|
||||
TriggerWhenOff = false
|
||||
}
|
||||
|
||||
// The deadband: latches on at the ceiling, stays on until the floor is reached.
|
||||
// Without this the radiators would chatter on and off at the threshold.
|
||||
VentLatch
|
||||
AutoRad_VentLatch
|
||||
{
|
||||
Type = TriggeredToggle
|
||||
OnTrigger = VentCeilingTrigger
|
||||
OffTrigger = VentFloorTrigger
|
||||
OnTrigger = AutoRad_CeilingTrigger
|
||||
OffTrigger = AutoRad_FloorTrigger
|
||||
}
|
||||
|
||||
// OR the raw ceiling back in, so a ship that loads already above the ceiling
|
||||
// vents immediately instead of waiting for a threshold crossing that never comes.
|
||||
VentActive
|
||||
AutoRad_VentActive
|
||||
{
|
||||
Type = MultiToggle
|
||||
Toggles = [ VentLatch, VentCeiling ]
|
||||
Toggles = [ AutoRad_VentLatch, AutoRad_VentCeiling ]
|
||||
Mode = Any
|
||||
}
|
||||
|
||||
HoldVent
|
||||
AutoRad_One { Type = StaticValue; Value = 1 }
|
||||
AutoRad_Zero { Type = StaticValue; Value = 0 }
|
||||
|
||||
// 1 while the network should hold its heat, 0 while it should vent.
|
||||
AutoRad_HoldValue
|
||||
{
|
||||
Type = MultiToggle
|
||||
Toggles = [ VentActive ]
|
||||
Mode = None
|
||||
Type = ToggleValueSelector
|
||||
Toggle = AutoRad_VentActive
|
||||
ToggleOnValue = AutoRad_Zero
|
||||
ToggleOffValue = AutoRad_One
|
||||
}
|
||||
|
||||
NetworkedHoldVent
|
||||
AutoRad_NetworkedHold
|
||||
{
|
||||
Type = NetworkToggle
|
||||
ToggleSource = HoldVent
|
||||
Type = NetworkValue
|
||||
ValueSource = AutoRad_HoldValue
|
||||
Categories = [ auto_radiator_hold ]
|
||||
IncludeInPhysical = true
|
||||
IncludeInBlueprints = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user