Mihara / RasterPropMonitor

Plugin for Kerbal Space Program. This repository is out of date and is primarily of historic interest. See https://github.com/JonnyOThan/RasterPropMonitor
http://forum.kerbalspaceprogram.com/threads/57603
Other
116 stars 67 forks source link

Request. Electricity production variables #540

Closed Alexustas closed 8 years ago

Alexustas commented 8 years ago

Can we get the variables for the production of energy through fuel cells, solar panels and alternator?

MOARdV commented 8 years ago

I would like to (along with fuel cell consumption rates in game units + mass). It will take some effort, which is why I didn't do it yet. :)

You want different variables for each, correct? (like ELECTRICITY_FUELCELL, ELECTRICITY_SOLARCELL, only with a better name)

Alexustas commented 8 years ago

You want different variables for each

Yes, I want to track all possible energy sources

MOARdV commented 8 years ago

ELECOUTPUTALTERNATOR and ELECOUTPUTGENERATOR both work. There is ELECOUTPUTFUELCELL for ModuleResourceConverter, but I have not found the right variables for it to work. I still need to create ELECOUTPUTSOLAR.

Alexustas commented 8 years ago

variable "ELECOUTPUTFUELCELL" always shows zero, regardless of whether the fuel cell is turned on or not

MOARdV commented 8 years ago

Yes. I have not figured out how to compute energy production yet for it, but I added the variable.

Alexustas commented 8 years ago

these variables are measured in the unit/s ?

MOARdV commented 8 years ago

Yes. They measure what the part reports, so if batteries are full, they will still report power generation, unless the part stops producing power (like fuel cells).

Alexustas commented 8 years ago

can you make so that the variables returns "-1" if the vessel does not have such devices on board?

MOARdV commented 8 years ago

can you make so that the variables returns "-1" if the vessel does not have such devices on board?

Yes.

MOARdV commented 8 years ago

On DropBox now.

Alexustas commented 8 years ago

perhaps it is not quite the correct topic, but I do not want to open a new issue.

I made a new switch for deploy / retract solar panels and recorded video how it works in the game.

VIDEO

config:

PROP
{
  name = swTumble_SOLAR_DEPLOY

// action

    MODULE
    {
        name = JSIActionGroupSwitch
        animationName = SwitchTumbleAnim
        switchTransform = SwitchColider
        actionName = plugin
        switchSound = ASET/ASET_Props/Sounds/tumbleClick01
        PLUGINACTION
        {
            name = JSIInternalRPMButtons
            actionMethod = SetDeploySolarPanels
            stateMethod = GetDeploySolarPanels  
        }
    }
MOARdV commented 8 years ago

Yes, this is difficult because the solar panel animation takes time, and GetDeploySolarPanels can only have two values (true / false), so I can use "Solar Panels can be extended", which is what I am using, or I can use "Solar Panels can be retracted", which will make the switch take a long time going from "off" to "on".

Maybe I can change it to "can be extended or is now retracting", which will make it flip immediately.

MOARdV commented 8 years ago

I changed GetDeploySolarPanels, so I think it will behave better.

I also added JSIInternalRPMButtons SolarPanelsState. Returns deployable solar panel state:

Updated on DropBox.

Alexustas commented 8 years ago

I also added JSIInternalRPMButtons

oh! it's just wonderful!

MOARdV commented 8 years ago

Update again, now have PERIODRANDOM_#