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
+43 -26
View File
@@ -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
}