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:
2026-08-28 23:37:21 +02:00
co-authored by Claude Opus 5
parent 831a628b53
commit 3ad03d7964
7 changed files with 250 additions and 73 deletions
+34 -22
View File
@@ -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
}