ECDrainViaPM¶
Adds an ElectricCharge rate that follows another PartModule’s enabled state on the same part. Used for mods that need background-aware EC drain without rewriting their module.
Source: ECDrainViaPM.cs.
| PROPERTY | DESCRIPTION | DEFAULT |
|---|---|---|
| targetModule | moduleName of the PartModule to watch on this part |
(required) |
| ec_rate | EC consumed per second while running (must be > 0 to apply a drain) | 0.0 |
| moduleTitle | Label used in planner / PAW if title is empty |
falls back to target module name |
| title | Explicit PAW / planner label | empty |
| running | Persisted run state; kept in sync with the target’s moduleIsEnabled |
false |
Behaviour¶
- Each frame (loaded),
runningis set fromtargetPM.moduleIsEnabled(not UnityBehaviour.enabled). - While
runningandec_rate > 0, Kerbalism requestsElectricChargeat-ec_rateviaIKerbalismModule(ResourceUpdate,PlannerUpdate, andBackgroundUpdate). - Current code only applies a drain when
ec_rate > 0; it does not treat negative rates as generators. - Works loaded and unloaded; shows up in the planner under the configured title.