sumghai / SDHI_StrobeOMatic

Parts pack for Kerbal Space Program, consisting of rotating warning lights in various colors.
Other
0 stars 2 forks source link

ElectricCharge consumption #2

Closed sumghai closed 8 years ago

sumghai commented 10 years ago

Ideally, these rotating warning lights should consume ElectricCharge while active, and if ElectricCharge has been depleted, should automatically shut down.

sumghai commented 9 years ago

RoverDude (@BobPalmer) pointed out that the stock ISRU is an example of a part with resource consumption and looping animation.

I've pushed a rudimentary implementation for the white strobe, but based on feedback by beta testers Bomoo and diomedea, none of the strobes are running (the white one is, in fact, no longer toggleable).

Will need to investigate.

sumghai commented 8 years ago

EC consumption works (mostly), with one small issue - if the vessel's batteries run dry, the lights will continue to flash and cannot be switched off.

Will continue to investigate.

sumghai commented 8 years ago

nli2work provided the ultimate working solution, which concurrently offers a better way to handle #1 as well:

The Amber Strobe-O-Matic was modified as per the procedure outlined above, and tested successfully in KSP 1.1 prerelease - the strobe is automatically added to the Lights Action Group, ElectricCharge is consumed while the strobe is active, and the strobe shuts off automatically once it runs out of EC.

Much easier and more robust than futzing around with bizarre part modules or being reliant on a third-party plugin!