jrossignol / ContractConfigurator

A config file based solution for creating new contracts for Kerbal Space Program.
https://forum.kerbalspaceprogram.com/index.php?/topic/91625-1
Other
64 stars 67 forks source link

HasCrewCapacity doesn't work with Kerbalism #717

Open quetschke opened 2 years ago

quetschke commented 2 years ago

I'm having a contract from https://github.com/linuxgurugamer/KerbinSpaceStation (Launch the BODY Space Station! ) from StationCoreCombined.cfg and in there it requires the station to support 4 Kerbals with this:

        PARAMETER
        {
            name = HabModuleChild
            type = HasCrewCapacity
            title = Support 4 Kerbals

            minCapacity = 4

        } 

The picture below shows that Kerbalism is able to support the Kerbals with everything, oxygen, radiation shielding, pressure, etc., but once you the launching station crosses 2490m (corrected: 2344m, see video below) the contract turns "Support for 4 Kerbals" to red, before that it is satisfied (green).

Not sure where the problem lies, but it would be nice to get this working.

station_contract2

caerfinon commented 2 years ago

IF the condition is satisfied on the launch pad, but then changes after launch, then the vessel parameter group that this is part of may no longer reference your ship correctly for some reason. You would need to look at the detailed information in the persistent.sfs file for the game and look at all the data of the contract to determine why the parameter is being evaluated as false.

Again IF the parameter is green on the launch pad, then a simple solution would be to add a "disableOnStateChange = true" statement on the line following "minCapacity = 4". This will casue the parameter to be set green on the launch pad and remail green permanently as CC will stop trying to evaluate it further. This would be for future contracts of this type as the active one can only be altered by the complex editing the data in the persistent.sfs file.

An even easier solution is to complete the mission as close as you can without satisfying the CC conditions and then use the debug menu to complete the contract.

quetschke commented 2 years ago

@caerfinon here is the parameter group for the contract from within the save file:

                    PARAM
                    {
                        name = HasCrewCapacity
                        id = HabModuleChild
                        state = Failed
                        disableOnStateChange = False
                        values = 0,0,0,0,0
                        ContractIdentifier = unknown
                        title = Support 4 Kerbals
                        notes = 
                        completedMessage = 
                        fakeFailures = True
                        allowStateReset = True
                        failWhenUnmet = True
                        minCapacity = 4
                        maxCapacity = 2147483647
                    }

Looks good to me. I also just filed a Kerbalism issue, maybe someone has an idea over there.

quetschke commented 2 years ago

The original test used two mk2 pods, but I just redid the launch with a Hitchhiker module and a PPD-12 cupola. All life support is enabled and provided. Kerbals are enjoying it. Same problem. See this recording for when the contract switches to red at 2344m altitude: https://youtu.be/Tk4AlBALAcY

quetschke commented 2 years ago

OK, not sure who to blame, I just forced the station to re-render by switching to another ship and back, and voila! Now it supports 4 Kerbals in space. contract3 Maybe CC needs to add some delays somewhere? Or maybe it's a feature ...

siimav commented 1 year ago

A bit of a long shot but could be that this change fixes the issue: https://github.com/KSP-RO/ContractConfigurator/pull/5