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

Compatibility request: Kerbalism science #727

Open trijemusk opened 11 months ago

trijemusk commented 11 months ago

Bug: I tried to use some science contract packs (Field Research and RAD) in combination with Kerbalism, and found out that they do not work together: the contracts never show up, and every contract type fails the requirement: "must have a valid experiment to perform". I believe that this problem is caused by the fact that Kerbalism replaces all science experiments with their own version, which causes Contract Configurator to not find any experiment that can be performed.

Solution idea: Looking into the source code it seems like all science related expressions boil down to the Science.getSubjects() method which is referenced multiple times in ExpressionParser/Parsers/Classes/Science. I propose to add a check whether Kerbalism (and its FeatureScience) is installed, and if so to instead use the method GetSubjectData() (located in the namespace KERBALISM, class ScienceDB, with this source code file) which seems to do the exact same things but instead with Kerbalism's science.

trijemusk commented 11 months ago

Small addendum: we should not remove the call to Science.getSubjects() since that would remove compatibility with other mods that still use stock science. Instead, we should just append the data from Kerbalism.