Skip to content

SEP: match parts by their loaded names (SEP.PSE) and keep SWS out of atmospheres - #79

Merged
siimav merged 3 commits into
KSP-RO:masterfrom
celino:sep-sws-no-atmosphere
Sep 29, 2026
Merged

siimav merged 3 commits into
KSP-RO:masterfrom
celino:sep-sws-no-atmosphere

Conversation

@celino

@celino celino commented Sep 24, 2026

Copy link
Copy Markdown

Follow-up to #78, which I found broken once I started writing contracts against it.

Part names never matched. KSP replaces _ with . when it loads a part (SEP_PSE becomes AvailablePart.name == "SEP.PSE"), and the science rules compare the configured part = as a raw string. None of the SEP mappings from #78 ever matched, so AvailableExperiments() never returned a SEP experiment. The config now uses the dotted names, and Science.AvailableExperiments() accepts either spelling, so configs written with _ keep working.

Solar Wind Spectrometer. SEP_SWS.cfg has excludeAtmosphere = True, like SEP_CCIG.cfg. I missed it in #78; SEP_SWS_* now gets the same no-atmosphere rule as SEP_CCIDscan_*.

Verified on KSP 1.12.5 with CC 2.13.4 and SEP 2.7.1: AvailableExperiments(Kerbin) now lists the SEP experiments the tech tree has unlocked, and a contract pack using them (tier 0 and tier 1) completes in game with no [ContractConfigurator] errors in the log.

SEP_SWS.cfg has excludeAtmosphere = True like SEP_CCIG.cfg; it was missed in KSP-RO#78.
KSP replaces '_' with '.' in AvailablePart.name, and the science rules compare
the configured part name as a raw string, so none of the SEP part mappings
from KSP-RO#78 ever matched and AvailableExperiments() never returned a SEP
experiment. Use the dotted names in the config and accept either spelling in
Science.AvailableExperiments().
AvailablePart.name never contains '_' (craft and save files use it to
separate the flight ID, so KSP swaps it for '.' on load), which made the
raw pname comparison dead code. Same normalization as
ConfigNodeUtil.ParsePartValue; configs written with '_' still match.
@siimav
siimav merged commit 9fb551d into KSP-RO:master Sep 29, 2026
3 checks passed
@celino
celino deleted the sep-sws-no-atmosphere branch September 30, 2026 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants