Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with BackupPower: generators do not set DesiredPowerOutput properly. #10

Closed
FluffierThanThou opened this issue Aug 9, 2020 · 0 comments

Comments

@FluffierThanThou
Copy link

Description;

In your FuelPowerPlant, you retrurn cachedPowerOutput for DesiredPowerOutput. The problem is that cachedPowerOutput only gets set when the generator is running, which means that if backup power is applied to a generator that is not currently running, it thinks the generator cannot produce anything. Manually toggling the generator once populates cachedPowerOutput, and fixes the problem.

Solution:

I think you're overcomplicating DesiredPowerOutput. Vanilla uses this for power plants with varying outputs, e.g. wind/solar/water, and updates them per tick. For generators that have a constant output (when on) it simply sets it to that;
image

I don't think you're using variable outputs, so I don't see why you need to override DesiredPowerOutput at all. If you do want to use variable outputs, please update DesiredPowerOutput to reflect the current possible maximum, and use PowerOutput to reflect what is actually generated. This would bring your values in line with vanilla logic, and allow BackupPower to function with your generators, without altering how your generators function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants