rsparkyc / ProceduralFairings

Procedural Fairings mod for Kerbal Space Program
Creative Commons Attribution 4.0 International
11 stars 4 forks source link

1.4.5.5 Fairing Base Decoupler Staging Not Available in VAB #10

Open DRVeyl opened 5 years ago

DRVeyl commented 5 years ago

KSP 1.4.5, with Procedural Fairings 1.4.5.5 (via CKAN)

(Technical: Unable to set KzResizableFairingBase 's MODULE[ModuleDecouple].stagingEnabled to True. It is unset in KzInterstageAdapter2 but set to False in KzResizableFairingBase)

The Payload Fairing - Base (Extended) does not show a staging icon when added in VAB. The fairing staging works as expected, the payload base is the issue. Right-clicking the part gives the expected menu items (Extra radius, strut/size toggles, fairing nodes, interstage toggle, size tweakable, mass, cost, decoupler force percent, crossfeed toggle) but nothing to enable staging. The decoupler can be activated by action group or right-click menu on the payload base during flight. Seems the toggle got lost from the GUI?

Non-scripting workaround is add a separate decoupler part above the payload base.

Scripting workaround (assuming you will ALWAYS want to use the decoupler?): @PART[KzResizableFairingBase]:AFTER[ProceduralFairings] { @MODULE[ModuleDecouple] { %stagingEnabled = True } }

PhineasFreak commented 5 years ago

Although the most probable reason for this is the incompatibility between the newer PF versions and RO, can you try and set a "stagingIcon = DECOUPLER_HOR" definition in the KzResizableFairingBase config?

DRVeyl commented 5 years ago

Removing my patch and applying stagingIcon = DECOUPLER_HOR results in the same incorrect behavior. Confirmed the change was applied in ModuleManager.ConfigCache. The interstage adapter doesn't appear to have a field for stagingIcon, so there is probably some defaulting to DECOUPLER_HOR. The fairings themselves have stagingIcon = FUEL_TANK.

The same fix should also be applied to KzResizableFairingBaseRing.

If setting stagingEnabled=true, then the value for stagingIcon will be applied. (I set stagingEnabled=true and stagingIcon=FUEL_TANK on the KzResizableFairingBaseRing and got the FUEL_TANK icon instead of DECOUPLER_HOR in the staging list.)

Would something in RO interfere with the GUI element/KSPfield for setting stagingEnabled? The behavior seems correct when stagingEnabled=True, I just don't see a way to interact with that field in the VAB. I remember it -used- to be there [some many versions ago?]

PhineasFreak commented 5 years ago

OK, here's what happens: since the fairing bases by default do not have the decoupler enabled then the icon is not going to appear. And that's to be expected, the part is not going to have any payload decoupling effect since its functionality is disabled. The fact that you can activate it in-flight via the PAW is actually the bug (and it is a stock KSP one, as i can make it happen with just the stock decouplers).

Edit: one would expect that when a decoupler is disabled then it would be really disabled. But, apparently, KSP just hides the decoupler staging icon, leaving the action group and PAW options visible.

I was thinking about RO since it has custom PF patches that are now redundant (and may cause issues) but, as it seems, it is not the cause of that.

DRVeyl commented 5 years ago

If I understand you correctly, there are two bugs: 1) Asserting stagingEnabled=False does not disable the ModuleDecouple 2) There is no in-editor way to toggle the decoupler staging state.

Can you programmatically add/remove from a part's module list in the VAB [through PF's .dll]? (I naively assume that you can since it is part of a craft's information in a save file, so not all instances of the same part must have the same modules?) Would adding/removing ModuleDecouple through a toggle button on the GUI work?

I'm being adamant that the fairing bases should have a way to stage an integrated decoupler -- else the solution would just have been to remove ModuleDecouple from the config and be done with it.

PhineasFreak commented 5 years ago

Correct. The "stagingEnabled" parameter does not fully disable the decoupler (Squad did their "magic" again, it this just removes the button from the staging list). Must talk to Squad about the fact that ModuleDecouple preserves the action group/in-flight PAW option and make sure that decouplers get really disabled.

I am sure that you can enable/disable the decouplers via C# (i did so for the fairing sides) but this is not something that PF should care about. The ModuleDecouple functionality is stock so any issues with it should be filed in the Squad bug tracker, not here.

Edit: and once again i realize that i have been thinking about it the wrong way: the fact that you can access the decoupler via action groups/PAW is not a bug. The staging option wording of the ModuleDecouple is not 100% clear but it is correct: "enable/disable staging" does toggle the staging of the decoupler but does not mean "enable/disable decoupler". You just cannot stage the fairing base decoupler if you fat-finger the Space button.

kurgut commented 5 years ago

I had the same, just figured out it needed advanced tweakables to be enabled.. Maybe reworking it, so it doesn't require it to work..

PhineasFreak commented 5 years ago

You will have to ask Squad to move the decoupler staging option out of the Advanced Tweakables list for that. But built-in PF decouplers were always targeted for RO, and RO has many other things that depend upon Advanced Tweakables being enabled (example: RCS per-axis thrust options).