MechJeb2

MechJeb2

4M Downloads

Add MechJeb Embedded Universal functionality directly to MJ

lamont-granquist opened this issue · 10 comments

commented

Not entirely certain how to implement this, but one possibility is to create a very thin class MechJebEmbeddedCore which inherts from MechJebCore and have a MM patch which wires that
up to every ModuleCommand. Then have a boolean which determines if those are either enabled or disabled, and then wire that up to KSP's main Settings UI.

The functionality to unlock all the techs at the start and bypass career mode would likely be even easier to implement as a checkbox in the Settings UI.

For bonus points, I think the default should be that the embedded cores are enabled by default and user's don't have to place the part (possibly even fully deprecating the part).

commented

closed mostly by #1087

need to take a dep on MM in CKAN and maybe think about writing some docs.

commented

I guess a long term change would be to turn MJ into a vesselmodule and add some code to check for a dummy module for the mod like RO

commented

Do VesselModules decorate every Vessel instance?

commented

That seems to be the right thing to do, but seems involved:

FWIW, I used VesselModule for MAS to start with, but I got rid of that approach. Every single "vessel" ends up with a vessel module. The current ship, the SRBs you jettisoned, the launch clamps, and so on. And it's instantiated in multiple scenes, so you have to make sure to check the scene and suppress various behaviors if it's not Flight.

For MAS, I changed MASVesselComputer to a MonoBehaviour, and I have a static method to retrieve (and create) the MAS VC on the current vessel if it doesn't already exist:

https://github.com/MOARdV/AvionicsSystems/blob/ed612f2cc819db103e9e16bf558c3495789c12b6/Source/MASPersistent.cs#L240-L257

It might be that a VesselModule would work better for MJ, since it is functional in the Editor as well, but it wasn't the right approach for RPM (or MAS), since I only ever need functionality during Flight.

commented

Is it possible to have this feature enabled, without all my .craft files getting infected by MechJeb, making them impossible to share with non-modded installs without manual editing? Failing that, how do I disable it?

Previously I could just remove the AR202 and save to create a stock-compatible .craft file.

I don't particularly want to use AR202s if I don't need to. But I definitely don't want to have to manually edit .craft files in order to share them.

commented

just create an empty "GameData/MechJebUseCommandPod" directory to disable it.

commented

How is a missing module preventing the sharing of ship files ? A missing module did not prevent a craft loading previously. Did something change in KSP recently ?

commented

@sarbian: Oh, maybe I am mistaken. I think I saw that craft with missing parts (e.g. AR202) won't load, and assumed it would be the same for modules. TIL.

commented

just create an empty "GameData/MechJebUseCommandPod" directory to disable it.

That appears to disable it entirely, which is an acceptable solution. It really would be great if we could have the functionality (MechJeb everywhere) without it affecting the .craft files—but perhaps there's no way to do that.