feat: v4.0.0 -- radiator switch picks the mode, ammo gate removed
ON vents constantly (vanilla). OFF banks heat and vents only when the network is nearly full. The gate is now PowerToggle OR MustVent. The launcher's thermal-ammo broadcast is gone: it did not follow the ammo selection live, and the switch states the player's intent directly. Only the radiator is patched now. New test_gate_is_power_or_must_vent pins the semantics. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011oLWY1G6S8U35bi2FxVWni
This commit is contained in:
@@ -1,55 +0,0 @@
|
||||
// ABOUT ME
|
||||
// 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 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.
|
||||
|
||||
AutoRad_One { Type = StaticValue; Value = 1 }
|
||||
AutoRad_Zero { Type = StaticValue; Value = 0 }
|
||||
|
||||
AutoRad_ThermalAmmoValue
|
||||
{
|
||||
Type = ToggleValueSelector
|
||||
Toggle = ThermalMissilesToggle
|
||||
ToggleOnValue = AutoRad_One
|
||||
ToggleOffValue = AutoRad_Zero
|
||||
}
|
||||
|
||||
AutoRad_NetworkedThermalAmmo
|
||||
{
|
||||
Type = NetworkValue
|
||||
ValueSource = AutoRad_ThermalAmmoValue
|
||||
Categories = [ auto_radiator_ammo_user ]
|
||||
IncludeInBlueprints = false
|
||||
}
|
||||
|
||||
// Routes the broadcast onto the heat network. NetworkHeatOutputProxy is what
|
||||
// the launcher's thermal ports anchor on. Those ports are only operational in
|
||||
// thermal missile mode, so a launcher loaded with anything else is simply not
|
||||
// on the network -- which is the behaviour we want anyway.
|
||||
AutoRad_Router
|
||||
{
|
||||
Type = NetworkRouter
|
||||
RouteGenerators
|
||||
[
|
||||
{
|
||||
Type = Bidirectional
|
||||
Routes
|
||||
[
|
||||
[NetworkHeatOutputProxy, AutoRad_NetworkedThermalAmmo, 0]
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,20 +1,18 @@
|
||||
// ABOUT ME
|
||||
// Components merged into the Radiator. They decide whether this radiator should
|
||||
// vent or hold, and combine that into a single gate, AutoPowerToggle, which
|
||||
// mod.rules substitutes for the radiator's vanilla PowerToggle on the parts of
|
||||
// the radiator that actually dissipate heat.
|
||||
// Components merged into the Radiator. They decide whether this radiator must
|
||||
// vent right now, and combine that with the player's switch into a single gate,
|
||||
// AutoPowerToggle, which mod.rules substitutes for the vanilla PowerToggle on
|
||||
// the parts of the radiator that actually dissipate heat.
|
||||
//
|
||||
// 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.
|
||||
// The player's on/off switch (PowerToggle) chooses the mode:
|
||||
// ON -> vanilla. Vent constantly; the player wants the heat gone.
|
||||
// OFF -> bank heat for Thermal Canister Missiles. The radiator idles while
|
||||
// the heat network has room, and vents only when it is nearly full,
|
||||
// so the ship never overflows heat onto its own parts.
|
||||
//
|
||||
// A radiator vents when EITHER:
|
||||
// - the heat network is running out of room, or
|
||||
// - no launcher on the network is using thermal ammunition
|
||||
//
|
||||
// The design is fail-safe: holding requires positive evidence that the network
|
||||
// has room to spare. Anything missing, disconnected or unmeasurable results in
|
||||
// venting, which is vanilla behaviour.
|
||||
// The gate is therefore PowerToggle OR MustVent. Fail-safe: idling requires
|
||||
// positive evidence that the network has room to spare. Anything missing,
|
||||
// disconnected or unmeasurable results in venting.
|
||||
|
||||
// --- Is the heat network running out of room? -------------------------------
|
||||
//
|
||||
@@ -88,48 +86,14 @@ AutoRad_MustVent
|
||||
Mode = Any
|
||||
}
|
||||
|
||||
// --- Is anything actually spending heat as ammunition? ----------------------
|
||||
//
|
||||
// Broadcast by the missile launcher over the heat network. Confirmed working in
|
||||
// game: with a launcher on Thermal Canister ammo this reads 1, and with the
|
||||
// launcher on anything else it reads 0 and radiators behave exactly as vanilla.
|
||||
|
||||
AutoRad_ThermalAmmoSignal
|
||||
{
|
||||
Type = NetworkValueReceiver
|
||||
Categories = [ auto_radiator_ammo_user ]
|
||||
Mode = Max
|
||||
AllowUncategorized = false
|
||||
}
|
||||
|
||||
AutoRad_ThermalAmmoInUse
|
||||
{
|
||||
Type = ThresholdToggle
|
||||
ValueFrom = AutoRad_ThermalAmmoSignal
|
||||
MinAmount = 0
|
||||
MaxAmount = 0
|
||||
Invert = true
|
||||
}
|
||||
|
||||
// --- The gate ---------------------------------------------------------------
|
||||
|
||||
AutoRad_VentAllowed
|
||||
{
|
||||
Type = MultiToggle
|
||||
Toggles
|
||||
[
|
||||
AutoRad_MustVent
|
||||
{ Toggle = AutoRad_ThermalAmmoInUse; Invert = true }
|
||||
]
|
||||
Mode = Any
|
||||
}
|
||||
|
||||
// PowerToggle is the radiator's vanilla UIToggle, so the player's switch remains
|
||||
// the master control: it can turn a radiator off, and the automation can only
|
||||
// idle one the player has left on.
|
||||
//
|
||||
// ON always vents (vanilla). OFF vents only while MustVent says the network is
|
||||
// nearly full. Indicators and the steam plume follow this gate, so a radiator
|
||||
// that is OFF but venting looks like a working radiator.
|
||||
AutoPowerToggle
|
||||
{
|
||||
Type = MultiToggle
|
||||
Toggles = [ PowerToggle, AutoRad_VentAllowed ]
|
||||
Mode = All
|
||||
Toggles = [ PowerToggle, AutoRad_MustVent ]
|
||||
Mode = Any
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user