UmbraSpaceIndustries / USITools

Shared components for KSP mods
Other
39 stars 38 forks source link

[Feature] module config option for on-rails only #12

Closed Deadpan110 closed 9 years ago

Deadpan110 commented 9 years ago

Hiya, although I have a background in some coding languages (and may attempt to learn C# one day) - I had a quick browse through the code to see if the following is implemented or indeed can be done.

Please forgive me if this is not possible or I have missed something.

The idea is for the USI_Converter to have a config option for 'on-rails' only so people like myself and perhaps other mod developers can make use of USI_Converters when available.

As an example (due to myself playing with Near Future Electrical and MKS/OKS of course), could it be possible to achieve the following (using NFE MX-1 Fission Reactor to explain).

MODULE
{
    name = FissionGenerator 
    UseStagingIcon = true
    UseForcedActivation = true
    PowerGenerationMaximum = 2000
    ThermalPower = 5000
    ThermalPowerResponseRate = 35
    BurnRate = 0.0000070
    MinPowerPercent = 0.2
    CurrentPowerPercent = 0.2
    MaxCoreTemperature = 400
    MeltdownCoreTemperature = 2100
    CoreTemperatureResponseRate = 3
    CurrentCoreTemperature = 0
    PressureCurve
    {
        key = 0 0
        key = 1 10
    }
    VelocityCurve
    {
        key = 0 10
        key = 500 75
        key = 1500 5
    }       
}

// - - - SNIP - - -

RESOURCE
{
     name = ElectricCharge
     amount = 2000
     maxAmount = 2000
}
RESOURCE
{
     name = EnrichedUranium
     amount = 320
     maxAmount = 320
}
RESOURCE
{
     name = DepletedUranium
     amount = 0
     maxAmount = 320
}

A player or another mod developer could add a cut down 'on-rails' functionality (as all part modules are different, there is no way to support everything possible - but could perhaps add some values to run the reactor at its lowest setting when the craft is not in focus - thus ignoring if radiators are deployed, what power level the reactor is running at, etc.).

// Fission Reactor - 2.5m (adjusted to 20% power on-rails)

@PART[reactor-25]:NEEDS[USI_Converter]
{
     MODULE
     {
         name = USI_Converter
         onRailsOnly = true
         converterName = reactor-25
         conversionRate = 1
         inputResources = EnrichedUranium,0.0000014
         outputResources = DepletedUranium,0.0000014,True,ElectricCharge,400,True
     }
}

I hope that makes sense ;)

BobPalmer commented 9 years ago

Not sure what it is you are looking to achieve tbh - closest thing I can think of would be to remove whatever converter the other mod uses and add in a USI_converter all via MM?