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

Add variables for fuels used by currently active engines #135

Closed
JonnyOThan opened this issue Jul 1, 2024 · 1 comment
Closed

Add variables for fuels used by currently active engines #135

JonnyOThan opened this issue Jul 1, 2024 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@JonnyOThan
Copy link
Collaborator

JonnyOThan commented Jul 1, 2024

Inspired by https://forum.kerbalspaceprogram.com/topic/190737-18x-112x-rasterpropmonitor-adopted/?do=findComment&comment=4403207

specifically for RealFuels support.

Copying messages from the forum here since the forum is unreliable:

Nyxilo:
I am currently using KSA IVA Upgrade alongside RealFuels and, as the latter replaces LiquidFuel with Kerosene for the engines, the fuel and flow gauges do not display the correct amount / flow of fuel.
This is a minor detail, as the KSP's own HUD is minimal in the IVA and can be left on to display fuel values and stuff, but I was wondering if this could be an easy compatibility fix or not.
If it's out of place and only related to KSA, let me know and I'll ask there.

JonnyOThan:
Interesting...I think this would need to be fixed in either RealFuels or ASET props. If RealFuels has blanket patches to convert every engine to Kerosene then it seems like it would be appropriate to change there. I'm not very familiar with RealFuels though - is it possible to have some engines that still use LiquidFuel when it's installed? If so then any kind of blanket switch is probably not great because really you'd want it to depend on which engine the current craft is using. Perhaps this should be a new feature in RPM that provides variables for the current engines rather than a fixed, named resource.

Nyxilo:
LiquidFuel is replaced by Kerosene for all the airbreathing engines - excluding the RAPIER which uses LiquidMethane instead - however for the rocket engines it depends on their configs, some use Kerosene, others Aerozine50 and so on.
Oxidizer also is replaced by LiquidOxygen for most of the engines (including the RAPIER).
Stock ressources are still available for fuels tank though.

@JonnyOThan JonnyOThan added the enhancement New feature or request label Jul 1, 2024
@JonnyOThan JonnyOThan added this to the 1.0.0 milestone Aug 5, 2024
@JonnyOThan
Copy link
Collaborator Author

Currently, most of the fuel-related props use things like SYSR_LIQUIDFUELDELTA or SYSR_LIQUIDFUELSTAGE or SYSR_LIQUIDFUEL or MASSPROPELLANTSTAGE.

MASSPROPELLANT is interesting, it does indeed use the resource types that engines are using - although I'm not sure if it only looks at active ones.

SYSR_ has 3 components: the resource name, a STAGE flag (whether to show total or the current stage), and a property accessor. If the property accessor is missing then it displays the amount.

There are several property accessors:

        public enum ResourceProperty
        {
            VAL,
            DENSITY,
            DELTA,
            DELTAINV,
            MAXMASS,
            MASS,
            MAX,
            PERCENT,
            DEPLETED
        }

My first thought was that I could make a different fake resource for aggregating "propellants" but not I'm not so sure now because some of these properties don't make a lot of sense if you combine two different resources - you can't really show a good aggregate for DENSITY for example.

So, a refinement of that idea: We need several abstract resources, where each one maps to ONE resource that is being used by currently active engines. something like:

PROPR_1VAL - maps to liquidfuel assuming the first propellant is LF (or whatever the first engine's first resource is)
PROPR_2VAL - maps to oxidizer
PROPR_3VAL - likely maps to solidfuel or monoprop, and so on

This is actually kind of handy because now instead of having props that directly reference liquidfuel, you can have them reference whatever your first active propellant is, etc.

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

No branches or pull requests

1 participant