Closed dgfl-gh closed 4 years ago
Because Contract Configurator is built on top of the stock contract system, some of the same limitations apply - including needing to generate a contract first. The problem is that the config defines a CONTRACT_TYPE (like a class), and the player interacts with a CONTRACT (like an object). You have have contracts like the First Launch which are very fixed in the requirements and parameters (kind of like a singleton) and contracts where the type only very loosely defines what it is (see mods like Field Research).
So to answer the question, you'd first have to generate the contract (not trivial). If you really want to get into that I'd suggest taking a look at ContractPreLoader.
But if you have a generated contract, it's pretty trivial - just Contract.SetState(Contract.State.Completed).
For a Contract Configurator specific option, you may want to look at messing around with REQUIREMENT nodes instead (doable via Module Manager, or via playing with ContractType.Requirements at run-time). You may be able disable specific requirements on a contract, like the CompleteContract Requirement to achieve a similar result to what you're looking for.
Assuming the question has been answered - closing this issue.
Analog to https://github.com/KSP-RO/TestFlight/issues/212; This is not actually a CC issue, it's just the only place where I could put my issue. I'm trying to understand if it is possible to automatically complete or remove specific progression contracts (First Launch or First Orbit, for example) for my CustomScenarioManager mod. I'm relatively sure that this is achievable through a purpose-built MM structure, but a simple "insert contract name and press play" solution in the mod would be better.
It's my impression that this goal isn't (at least easily) achievable in stock due to the need for contracts to be generated first, and my lack of understanding about how to force generation of a certain contract. But since CC expands a lot on stock contracts, perhaps at least one of these (as in, either completion or removal) is possible. So the question is: Is this possible? And if it is possible, how?