KSP-KOS / KOS

Fully programmable autopilot mod for KSP. Originally By Nivekk
Other
689 stars 228 forks source link

ModuleManager config to fix RT "no home connection" when you really have one. #2328

Open Dunbaratu opened 5 years ago

Dunbaratu commented 5 years ago

The longstanding bug that we can't do anything about because it's how RemoteTech works where it won't find the (defintely existing) homeconnection when the craft has a manned crew but no probe core is annoying. It is caused by the fact that RemoteTech cannot query the connection without one of its ModuleSPU Partmodules on the ship, and the ModuleSPU isn't added to the manned craft.

We could (should) see if making the KOS computer part itself into a ModuleSPU (with a ModuleManager config file we ship with) fixes this bug.

@lucaelin says she has a config that does this - can she post it here.

lucaelin commented 5 years ago

What I have is a working setup where I added the ModuleSPU to each (manned) command module part. This was sufficient for me because I was using kos4all at that time. The same thing should be applicable to KOS parts as well, but I cannot confirm that that's working. GameData/RemoteTech/RemoteTech_Squad_Probes.cfg shows how RemoteTech handles stock probe cores. PS. If those modules would be added to the KOS parts, they should also be added to all kos4all enabled parts in order to maintain consistent behavior..

Dunbaratu commented 5 years ago

Example of a module manager config section that fixes it:

@PART[kOSMachine1m]:FOR[RemoteTech]
{
    %MODULE[ModuleSPU] {
    }
}

@PART[kOSMachine0m]:FOR[RemoteTech]
{
    %MODULE[ModuleSPU] {
    }
}

@PART[kOSMachine0mLegacy]:FOR[RemoteTech]
{
    %MODULE[ModuleSPU] {
    }
}

@PART[kOSMachineRad]:FOR[RemoteTech]
{
    %MODULE[ModuleSPU] {
    }
}

@PART[kOSkal9000]:FOR[RemoteTech]
{
    %MODULE[ModuleSPU] {
    }
}
Dunbaratu commented 5 years ago

WARNING - this has a big problem I discovered.

The Remote Tech code contains a few places with a hardcoded assumption that all ModuleSPU's will be contained inside Parts that also contain a ModuleCommand (the stock module that lets you control a ship like exists in Command pods and probe cores). When a ModuleSPU is inside a part that does NOT contain such a command module, then it incorrectly sets a flag that presumes the ship is out of power and RT should behave accordingly. This is why the controls don't work sometimes and it pretends its out of power when it's not.

So this fix isn't this simple.

MaraRinn commented 5 years ago

To clarify: if we built a ship with a crew capsule but no kOS module, does RemoteTech work or does RemoteTech require that vessel to also have a probe core?

If the latter, perhaps we could provide a workaround in AddOns:Available(“RT”) to check the vessel for ModuleSPU contained in a part that also has ModuleCommand, and returning false if this condition is not met?

Can we alter the engineering report in the VAB/SPH to point out the dependency?

There could be an error emitted too, but what is the current practise for continuing operation while emitting an error? In my limited experience, most error reports in KOS are accompanied by a crash/termination of the running program.