shadowmage45 / SSTULabs

Dev repository for testing/unfinished KSP parts/plugins/etc.
Other
62 stars 41 forks source link

Solar Panels are not Recognized in Engineers Report as Providing Power #707

Open Joker58th opened 6 years ago

Joker58th commented 6 years ago

The solar panels work fine, however, they do not show as providing power in the engineers report in the VAB.

Steps to recreate:

  1. Clean 1.3.1 install
  2. Add SSTU 7.39.149 and dependencies
  3. In VAB build a pod with a battery ,EC consumer part and an SSTU solar panel
  4. Engineers report shows "ElectricCharge required but not generated" and "Electric charge stored but not generated"

I confirmed that stock solar panels do update the report as expected.

I installed Fusebox for a test and it does show correctly there. I saw in the forum that Linuxgurugamer made changes specifically for SSTU.


Dev Notes

This is a 'bug' caused by stock code only checking for stock part-modules, and not offering any method or interface for custom part-modules to register themselves as being a power provide/generator/etc.

Not a problem that can be solved by SSTU -- Please file a report on the stock bug-tracker if you want this to be solved.

shadowmage45 commented 6 years ago

AFAIK this is caused by stock code not giving any method for me to say 'yes, this is a solar panel, it generates EC'. Stock code has special handling for their own solar panels, but do not expose such methods for mods to use (at least not last I looked at it).

Likely not solvable, but I'll take a look at it (maybe).

Jimbodiah commented 6 years ago

As a side not, sstu panels are not recognised by mods like mechjeb to deploy automatically either (other mod panels do react). Any relation? Not sure if they all use the stock module or not.

Joker58th commented 6 years ago

I don't know if this helps but I installed Near Future Solar and US and Soviet Solar Panels and they both work with the stock system as well as Kerbalism.

Jimbodiah commented 6 years ago

ok, that explains it.

shadowmage45 commented 6 years ago

I don't know if this helps but I installed Near Future Solar and US and Soviet Solar Panels and they both work with the stock system as well as Kerbalism.

It might. I'm not sure if any of those mods use custom part-modules or not (which is what SSTU does); likely that they use the stock module.

Will take a look at NF to see how Nertea is handling it, but again, no guarantees that this is solvable.

Jimbodiah commented 6 years ago

From one of NF-Solar's panels

MODULE
{
    name = ModuleDeployableSolarPanel

    animationName = ExtendPanels

    sunTracking = true
    raycastTransformName = Panel003
    pivotName = pivot
    isBreakable = true

    resourceName = ElectricCharge

    chargeRate = 5
    extendActionName = #autoLOC_6001805 //#autoLOC_6001805 = Extend <<1>>
    retractActionName = #autoLOC_6001806 //#autoLOC_6001806 = Retract <<1>>
    extendpanelsActionName = #autoLOC_6001807 //#autoLOC_6001807 = Toggle <<1>>
}
shadowmage45 commented 6 years ago

Yeah, as I was afraid, that is the stock solar-panel part-module. Which means it gets special treatment from stock code, which is why it 'works' while the SSTU ones don't.

Chances are that I will not be able to solve this for SSTU solar panels, as stock code really doesn't play nicely with custom classes/modules (they expect everyone to use theirs, regardless of if their modules are crap and unsuited for anything but the most simplistic of parts).

Joker58th commented 6 years ago

Well, that is disappointing for me. I really really like your work in this mod and your endeavor to create fantastic looking parts with low part counts. I also want to try out Kerbalism for a realistic'ish type career. So my next question is, respectfully, is there a way or a MM config that I could just remove the solar panels off the stationcore parts for example? I guess I could just leave them on and add more solar panels from other mods but that might be a bit to cluttered.

Or, do I have to beg the Kerbalism guys to add support for your panels? As I mentioned before, Linuxgurugamer did for Fusebox.

shadowmage45 commented 6 years ago

Quick question -- do the stand alone SSTU solar panels get recognized properly? If it is just a problem with the StationCore parts, then it may already have been solved for the stand-alones, and I can find and re-use the solution. (I remember that I did solve this issue for stock satellite/etc contracts at one point, but apparently the VAB report/etc doesn't use that information)

In the current versions, yes, you should be able to remove the solar panels. The parts already have a 'none' option, so simply remove all options but that, and change the 'default' or 'current' specification in the config to the 'none' option as well.

Otherwise, yes, the only way those modules will be recognized is if those other mods add specific code for it. The stock API does not expose any sort of proper 'I'm a generator' interface for modules, so there is no way to tell without special handling on a per-module basis.

Joker58th commented 6 years ago

I totally missed the "none" option. Thanks for mentioning that!

To answer your question, I'm afraid it is all solar panels whether they be integrated or stand alone. I verified the probecore, shipcore and stationcore as well as stand alone panels do not report to stock engineer or Kerbalism.

And thanks again for your time and efforts!

Joker58th commented 6 years ago

Ok, I think I got it. Here is what is working for all parts that have integrated panels except the Station Service Module. It appears to not be configurable.

@PART[]:HAS[@MODULE[]]:NEEDS[SSTU] { @MODULE[*] { @currentSolarSolar = Solar-DOS-None @currentSolar = Solar-DOS-None } }

shadowmage45 commented 6 years ago

To answer your question, I'm afraid it is all solar panels whether they be integrated or stand alone. I verified the probecore, shipcore and stationcore as well as stand alone panels do not report to stock engineer or Kerbalism.

That is what I was afraid of. Apparently those mods/functions don't respect the same interfaces that the stock contracts use. The contracts -should- recognize SSTU solar panels as valid 'power generation', but it seems that doesn't carry over to elsewhere. I guess its just too much to ask for consistency from stock code =\

blowfishpro commented 6 years ago

Did a quick look, it seems to be tied specifically to ModuleDeployableSolarPanel and ModuleGenerator

Jimbodiah commented 6 years ago

Perhaps the best option is to ask the other modmakers if they can add support for the sstu modules?

shadowmage45 commented 6 years ago

Sure. Only I don't use those mods though, and have zero compulsion to bug them about it. Should also wait until after the 1.4 update, as all of the code will be changing, and they would need to adapt to the changes anyway.

I also don't use the stock 'engineer report', for exactly this reason -- it is most often simply wrong. And nothing other mods can do to fix that one -- the solution must come from stock code. Good luck there...

Jimbodiah commented 6 years ago

I was refering more to mechjeb deploying your panels like it does stock panels ;)