diff --git a/components/radiator_auto.rules b/components/radiator_auto.rules index a327d9f..298ece3 100644 --- a/components/radiator_auto.rules +++ b/components/radiator_auto.rules @@ -42,25 +42,95 @@ AutoRad_ForceVentSignal AllowUncategorized = false } +// "value is not zero", written the way vanilla writes it (the thermal pump's +// UtilizationToggle). The signals are only ever 0 or 1, so this is equivalent +// to a 0.5 threshold while sticking to a form the game demonstrably honours. AutoRad_IsHolding { Type = ThresholdToggle ValueFrom = AutoRad_HoldSignal - MinAmount = 0.5 + MinAmount = 0 + MaxAmount = 0 + Invert = true } AutoRad_ThermalAmmoInUse { Type = ThresholdToggle ValueFrom = AutoRad_ThermalAmmoSignal - MinAmount = 0.5 + MinAmount = 0 + MaxAmount = 0 + Invert = true } AutoRad_ForceVent { Type = ThresholdToggle ValueFrom = AutoRad_ForceVentSignal - MinAmount = 0.5 + MinAmount = 0 + MaxAmount = 0 + Invert = true +} + +// --- Self-test probes ------------------------------------------------------- +// +// Three versions of this mod have now loaded cleanly and done nothing, each for +// a different reason, so these bisect the remaining possibilities directly. +// Each drives an indicator, and an indicator is drawn while its toggle is OFF, +// so in every case a visible icon means that probe FAILED. + +// A: does ThresholdToggle behave as expected at all? No network involved. +AutoRad_ProbeOne { Type = StaticValue; Value = 1 } +AutoRad_ProbeThresholdOK +{ + Type = ThresholdToggle + ValueFrom = AutoRad_ProbeOne + MinAmount = 0 + MaxAmount = 0 + Invert = true +} + +// B: can a mod-defined category carry a value at all? The radiator broadcasts +// and receives this one itself, so no second part is involved. +AutoRad_ProbeBroadcast +{ + Type = NetworkValue + ValueSource = AutoRad_ProbeOne + Categories = [ auto_radiator_selftest ] + IncludeInBlueprints = false +} +AutoRad_ProbeReceive +{ + Type = NetworkValueReceiver + Categories = [ auto_radiator_selftest ] + Mode = Max + AllowUncategorized = false +} +AutoRad_ProbeSelfLoopOK +{ + Type = ThresholdToggle + ValueFrom = AutoRad_ProbeReceive + MinAmount = 0 + MaxAmount = 0 + Invert = true +} + +// C: does receiving work for a category vanilla already broadcasts? The +// radiator's own NetworkedThermalDissipationLoadValue publishes this one. +AutoRad_ProbeVanillaCat +{ + Type = NetworkValueReceiver + Categories = [ thermal_load_dissipation ] + Mode = Max + AllowUncategorized = false +} +AutoRad_ProbeVanillaCatOK +{ + Type = ThresholdToggle + ValueFrom = AutoRad_ProbeVanillaCat + MinAmount = 0 + MaxAmount = 0 + Invert = true } AutoRad_VentAllowed diff --git a/mod.rules b/mod.rules index 1ee0916..2744a47 100644 --- a/mod.rules +++ b/mod.rules @@ -16,7 +16,7 @@ ID = ganter.auto_radiator Name = "Auto Radiator" -Version = 1.3.0 +Version = 1.4.0 CompatibleGameVersions = ["0.30.4c", "0.30.4"] ModifiesGameplay = true Author = "Tobias Ganter" @@ -85,6 +85,9 @@ Actions [NetworkedHeatBuffer, AutoRad_HoldSignal, 0] [NetworkedHeatBuffer, AutoRad_ThermalAmmoSignal, 0] [NetworkedHeatBuffer, AutoRad_ForceVentSignal, 0] + [NetworkedHeatBuffer, AutoRad_ProbeBroadcast, 0] + [NetworkedHeatBuffer, AutoRad_ProbeReceive, 0] + [NetworkedHeatBuffer, AutoRad_ProbeVanillaCat, 0] ] } @@ -180,6 +183,35 @@ Actions Size = [1, 1] } } + // Probe A: mine icon visible -> ThresholdToggle itself misbehaves. + { + Toggle = AutoRad_ProbeThresholdOK + AtlasSprite + { + File = &/INDICATORS/NoMines + Size = [1, 1] + } + } + // Probe B: crew icon visible -> a mod-defined category carries + // nothing, even broadcast and received on the same part. + { + Toggle = AutoRad_ProbeSelfLoopOK + AtlasSprite + { + File = &/INDICATORS/NoCrew + Size = [1, 1] + } + } + // Probe C: EMP icon visible -> receiving fails even for a category + // vanilla already broadcasts on this very part. + { + Toggle = AutoRad_ProbeVanillaCatOK + AtlasSprite + { + File = &/INDICATORS/NoEmp + Size = [1, 1] + } + } ] } ]