nightingale

[1.5.x] Contract Configurator [v1.26.0] [2018-12-05]

Recommended Posts

Contract Configurator - A config-file based solution for creating new contracts!

EHE5dYd.png

kmskTMK.png CZWV3ul.png xmwqOxH.png

How it Works

Contract Configurator exposes various hooks into KSP's contract system through a standard config file syntax. This means that modders using Contract Configurator can create new contracts without writing any code. The config file format has 5 basic sections:

  1. Contract Summary - This contains all the summary text, expiry/deadline dates, and reward information.
  2. Parameters - These are mappings to the stock ContractParameter classes which specify what the player has to do to complete the contract.
  3. Requirements - This is what is required before the contract will show up. Most of the ProgressTracking information is supported, along with a few other things.
  4. Behaviours - These are behaviours that are applied at the contract level. A behaviour can create additional objects related to the contract (such as spawning Kerbals), be used to store persistent data or any number of other things.
  5. Data nodes - These define new data for use within the contract using Contract Configurator's powerful expression language.

And if the provided parameters and requirements aren't enough, Contract Configurator is extensible. New parameters and requirements can be added in as little as a dozen lines of code.

Download

Contract Configurator can be downloaded from GitHub.

Source

The full source and test configuration is available on GitHub.

Documentation

The user guide is hosted on the GitHub wiki.

Change Log

Spoiler

Contract Configurator 1.26.0

  • Recompile for KSP 1.5.1
  • Updated to work with RemoteTech 1.8.13+ (thanks PiezPiedPy).
  • Added trig functions to expression language (thanks VaPal).
  • Invalid Celestial Bodies constants no longer throw an error on parsing (improves overall support for planet packs that remove/rename planets).
  • Fixed a bug that prevented casting from string to ExperienceTrait.
  • Fixed an issue affecting CollectScience and biomes with spaces (thanks mpharoah).

Contract Configurator 1.25.0

  • Added ExperienceTrait to parser.
  • Kerbal.ExperienceTrait now returns an ExperienceTrait instead of a localised string.
  • Increased max active contract multiplier slider maximum from 2.0 to 8.0.
  • Support for RemoteTech 1.8.10.3 (thanks wraithan).

Contract Configurator 1.24.4

  • Properly work around stock bug.

Contract Configurator 1.24.3

  • Proper fix for last release (thanks Warezcrawler).

Contract Configurator 1.24.2

  • Workaround for stock bug #18267 (contract parameters creating extra messages on completion).

Contract Configurator 1.24.1

  • Recompile against KSP 1.4.2
  • Re-enabled RemoteTech and Kerbal Konstructs integration for KSP 1.4.x.
  • Fix error message when despawning spawned Kerbals (thanks steve_v).
  • Added a warning message when validation errors prevent a DATA_EXPAND node from being parsed (thanks gyf1214).
  • Fixed NRE when checking progress nodes (thanks DocMop).
  • Fixed issue with duplicate assembly warning showing up when it shouldn't (thanks Gordon Dry).
  • Fixed some issues with handling of newlines in config nodes (thanks inigma).
  • Use case insensitive string comparison when loading celestial bodies in saved expressions (thanks gyf214).

Contract Configurator 1.24.0

  • Recompile for KSP 1.4.0
  • Added back MODULE checks in simple version of PartValidation (thanks chrisl).
  • Support RemoteTech 1.8.9 (thanks vader111).
  • Read date/time information from dateTimeFormatter (thanks Aelfhe1m).

Contract Configurator 1.23.3

  • Recompile for KSP 1.3.1
  • Improved display of HasAntenna parameter ratings (thanks Kerbas-ad-astra).
  • Fixed logic for determining contract prestige (thanks sopindm).
  • Fixed previously unlocked parts being re-locked if player tries to buy a science node they don't have sufficient funds for (thanks inigma).
  • Fixed issue using DATA_EXPAND with values that had special characters in them.  Fixes interop issues between CatEye and Other Worlds Planet pack (thanks Chemox).

Contract Configurator 1.23.2

  • Clarified wording of ActiveVesselRangeRequirement for RemoteTech (thanks Alshain).
  • Added check for old usage of partModuleType=Power (thanks muppet9876).
  • Prevent Rendezvous parameter from completing when doing an EVA (thanks pap1723).
  • Don't allow main menu to continue while still loading (prevents issues on slower systems).
  • Made RemoteTech distance function (for coverage system) more generous (thanks NathanKell).
  • Fixed issue with Kerbals spawned at KSC starting an extra ~60 meters in the air (thanks Keniamin).
  • Fixed error when cancelling a contract with spawned Kerbals.
  • Fixed exception with FlyBy and ReturnFromFlyBy requirements.
  • Properly fixed Facility requirement in the tracking station (thanks Kerbas_ad_astra).
  • Fixed NRE from struts breaking (thanks Alshain).
  • Fixed multiple exceptions when using Sigma Binary (thanks Rodger).

Contract Configurator 1.23.1

  • Fixed major bug with VisitWaypoint not properly setting waypoint distances (thanks Keniamin and others).
  • Fixed issue with FacilityRequirement in tracking station (thanks JPLRepo).
  • Fixed issue where some requirement details weren't being saved in contracts.
  • Fixed localisation issue with character names in dialog boxes.
  • Fixed exception when pressing orbit buttons in tracking station (thanks doktorstick).

Contract Configurator 1.23.0

  • Support for KSP 1.3.0
  • Fix issue with contract item sizes not always being set correctly in mission control when switching tabs.
  • Fixed "input is null" error in Docking parameter (thanks linuxgurugamer).
  • Fixed to not generate contracts without parameters (thanks severedsolo).
  • Fixed Sigma Dimensions compatibility issue with atmosphere height (thanks pap1723 and Sigma88).

Contract Configurator 1.22.2

  • Fix argumentOfPeriapsis issue (thanks Intrepidrd).

Contract Configurator 1.22.1

  • Fixed issue with vessel identifier parsing introduced in 1.22.0 (thanks Li0n).

Contract Configurator 1.22.0

  • Added HasAntenna parameter (thanks Kerbas-ad-astra).
  • Added Vessel.AntennaTransmitPower() and Vesse.AntennaRelayPower() (thanks Kerbas-ad-astra).
  • Contract weights for celestial bodies are now set by Contract Configurator (affecting the likelihood of stock contracts generating for the given body).
  • Added minArgumentOfPeriapsis and maxArgumentOfPeriapsis to Orbit parameter.
  • Added horizontalDistance to VisitWaypoint.
  • Make references to 'Sun' generic in SolarScience.cfg to fix Galileo compatibility (thanks SirBriguy).
  • Added Sun() function to get the Sun in a non-name specific way.  Assumes a single star.
  • Change enum parsing to be case insensitive.
  • Change Vessel Identifier parsing to allow a wider range of characters.
  • Fixed format text for funding message in mission control (thanks JPLRepo).
  • Fixed issue with NextUnreachedBody() call caching results (thanks severedsolo).

Contract Configurator 1.21.0

  • Found new workaround for GetExportedTypes reflection issue (the "toolbar" issue).
  • Added NextUnreachedBody() and NextUnreachedBodies() methods.
  • Added Part.MassDry() and Part.MassWet() methods.
  • Added CelestialBody.CanHaveSynchronousOrbit() method.
  • Recompile Kerbal Konstructs integration.
  • Fixed contract window text not updating for dynamic text (duration timers, etc.).

Contract Configurator 1.20.3

  • Regenerate biome data for KSP 1.2 biomes (fixes Field Research "Rare Science" contracts, thanks FlatEric).
  • Added RemoteTech integration back in.
  • Fixed issue with nested contract groups not working (thanks jeisen).

Contract Configurator 1.20.2

  • Support for KSP 1.2
  • Allow contract title in mission control to span two lines.
  • Moved settings into stock settings screen.
  • Fixed NRE when vessel's Landed At string is null (thanks SamLex).
  • Check for sufficient funds when there are negative contract advances (thanks 5thHorseman).
  • Fixed display issue with partially complete CollectScience parameters.

Contract Configurator 1.19.0

  • Added Part.UnlockCost().
  • Added Part.Resources().
  • Added Part.ResourceCapacity().
  • Reworked ParameterDelegate - worst source of in-flight LINQ (ie. garbage).
  • Check contract requirements before displaying them in mission control in case something has changed.
  • Fixed issues with part parser (thanks 5thHorseman).
  • Fixed exception in Mission Control (thanks Conventia & AccidentalDisassembly).
  • Fixed a NullReferenceException in PartValidation.
  • Fixed an incorrect condition on the ReseachBodies check which caused heaps of garbage to be created (thanks xEvilReeperx).
  • Fixed issue with Duration parameter not kicking off correctly in some circumstances (thanks 5thHorseman).

Contract Configurator 1.18.1

  • Fixed NRE on contract save (thanks CecilFF4).

Contract Configurator 1.18.0

  • New Base and ISRU agent icons from Enceos.
  • Added Resource.Density() method.
  • Added partModule and partModuleType to TechResearchedRequirement.
  • Fixed problem with requirement data for offered data not getting fixed until contract save (thanks severedsolo).
  • Fixed sorting of contract groups (thanks pap1723).
  • Fixed Resource parsing limitations (thanks hargn).
  • Fixed issue with DATA nodes and child contract groups (thanks hargn).
  • Disallow DMOS Seismic Impact Hammer at KSC in science subsystem (thanks BeafSalad).
  • Remove short-circuit in Any/All requirement texts for players aren't given incorrect information (thanks inigma).
  • Fixed an issue that prevented expressions from working in resource loading (thanks hargn).
  • Cycle through new contracts to generate in a random order to prevent certain contracts from getting preference.
  • Fixed issue where contract expiries were never getting set (thanks DarkonZ).
  • Fixed issue with some parameters combined with the All parameter causing incorrect contract failure (thanks tomf).
  • Fixed issue with selected contract in mission control getting unselected when a new contract is generated (thanks AccidentalDisassembly).

Contract Configurator 1.17.0

  • Mission Control remembers the last visited tab when you open it, and takes you there.
  • Added Tracking Station buttons for filtering orbits/waypoints from contracts.
  • Added support for adding loading tool tips.
  • Better support for Kolniya/Tundra orbits - will error if the orbit would exit the SOI.  Also added CelestialBody methods to determine if the body is allowed to have Kolniya/Tundra orbits.
  • Fix for contracts not being offered on a brand new save until at least one stock contract is offered (thanks to all the RP-0 users who reported this).
  • Fixed issue where parameter completion data wasn't correctly copied to newly created vessel on undock/decouple (thanks linuxgurugamer).
  • Fixed DraftTwitchViewers support.
  • Fixed issue with using Enter button to go to Mission Control (thanks Deimos Rast).
  • Fixed agent for stock satellite contracts.
  • Fixed issue with sortKey in child contract groups (thanks pap1723).

Contract Configurator 1.16.2

  • Fix exception error messaging.

Contract Configurator 1.16.1

  • Silence Research Bodies error (thanks Liondrome).
  • Fixed problems with ResearchBodies support (it was offering some contracts that it shouldn't have).

Contract Configurator 1.16.0

  • Support for ResearchBodies - contracts won't be offered until the appropriate body has been researched (thanks JPLRepo).
  • Integrated support for Kerbal Konstructs directly into Contract Configurator.
  • New NoStaging parameter.
  • Agent data for stock contracts is now defined in a cfg file, instead of hardcoded (see CONTRACT_DEFINITION in documentation).
  • Properly factor in autoAccept contracts when deciding whether to enable the accept button in Mission Control (thanks ETM, Nightside & Aelfhe1m).
  • Fixed issue with contract generation process starting up before the stock contract system was done loading.  This would cause contracts to be offered that weren't supposed to be offered, which could cause other issues (like a contract that can be accepted but is then removed, or an active contract that gets removed unexpectedly).  Thanks to everyone who's been very patient on this nasty & hard to track down bug.
  • Fixed contracts that didn't properly expire once the expiry date hit.
  • Increased default expiry dates (since long expiries no longer prevent other contracts from generating).

Contract Configurator 1.15.5

  • Updated agent icons from Enceos.
  • Fixed issue introduced in 1.15.x with Prestige() function that incorrectly treated all contracts as Trivial.
  • Fixed issue with text for Funds/Science/Reputation requirements.
  • Fixed issue with sorting in Available tab of Mission Control.
  • Fixed exception when declining/cancelling contracts in Mission Control.

Contract Configurator 1.15.4

  • Increased base contract limits.
  • Increased contract limits based on building level.
  • Increased contract limits even more based on building level.
  • Fixed issue where contract limits could be exceeded in the Available tab of Mission Control (thanks severedsolo).
  • Fixed possible exception in HasCrew (thanks cpottinger).
  • Fixed issue with "ghost" contracts showing up as offered (thanks vardicd & severedsolo).
  • Fixed issue with MaxTechLevelUnlocked function (thanks hargn).
  • Removed MiniAVC.

Contract Configurator 1.15.3

  • New Mission Control layout. Now all contracts that are eligible are available all the time (players are no longer at the mercy of the RNG to get the contracts they want).  Also, can view the details of what contracts are *not yet* available, and what it takes to make them available.
  • New contract art (special thanks to Enceos)!
  • Contract generation overhaul.  Overhaul to the contract generation system for massive performance improvements.  Contracts are no longer generated in-flight (no garbage, no stutters).
  • Added title and related attributes for REQUIREMENT nodes.
  • Added title and related attributes for DATA nodes.
  • Added sortKey for CONTRACT_TYPE and CONTRACT_GROUP nodes.
  • New List.SelectUnique() method for selecting unique values (replaces selecting a random value and hoping that it hasn't been used before).
  • New DATA_EXPAND node allows a CONTRACT_TYPE to be duplicated across a list of values (eg. duplicated for each Celestial Body).
  • New CelestialBody.Index() method to get the global index of a body (for sorting).
  • More warnings to steer contract authors towards more performant and more player-friendly ways of writing contracts.
  • New ResourceConsumption parameter.
  • Fixed issue where the state of some parameters wasn't immediately reset when switching vessels, allowing erroneous contract completion (thanks NathanKell & leudaimon).
  • Fixed bug in uniqueness checks when vessels are involved which caused the uniquness check not to work (thanks severedsolo).
  • Fixed issue where CollectScience parameters weren't always showing the checkmarks when partially completed (thanks jlcarneiro & severedsolo).

Contract Configurator 1.14.0

  • Added suppport for partModuleType in PartValidation.
  • Added AtMost and AtLeast set requirements.
  • Fixed issue where HasCrew was counting tourists.
  • Fixed issue where partModuleType = Wheel wasn't picking up the LY-01 fixed landing gear (or any wheel part without a motor).
  • Fixed issue with VisitWaypoing and WaypointGenerator not correctly update waypoint names when expressions are used.
  • Reduced LINQ and reflection calls in expression parser for performance/garbage collection improvements.

Contract Configurator 1.13.0

  • KSP 1.1.3 compatibility.
  • Integrated Wider Contracts App into Contract Configurator.
  • Fixed isuse with SpawnVessels spawning vessels with incorrect rotation (thanks severedsolo).
  • Prevent Rendenzvous parameter from triggering when a vessel performs a rendezvous with itself (thanks danielguo).
  • Fixed NRE on contract accept when using SpawnVessel's craftPart method of spawning.
  • Fixed PartModuleUnlocked and PartUnlocked requirements to check for part purchase and not just tech unlock (thanks inigma).
  • Always set the CollectScience targetBody to the one from the biome if a biome is used (thanks severedsolo & enceos).
  • Fixed exception in RecoverKerbal (thanks palleon).
  • Fixed incorrect handling of waypoints with negative altitude on non-ocean worlds in VisitWaypoint (thanks Galenmacil).
  • Removed extra ConfiguredContract entries from settings menu (thanks Deimos Rast).

Contract Configurator 1.12.1

  • Fixed backwards compatibility for Wheel PartModuleType (thanks TheReadPanda).

Contract Configurator 1.12.0

  • Added support for NextKerbalHireCost() expression function.
  • Added HasCrew.excludeKerbal.
  • Fixed exception in the Expression behaviour (thanks severedsolo).
  • Fixed deriving primary situation for biomes with a space in the name.
  • Fixed exception in science util functions (thanks Chippy the Space Dog).
  • Fixed exception when docking (thanks Lennartos and others).
  • Fixed logic for setting contract weights that was broken by 1.1.x changes (thanks severedsolo).
  • Removed some broken validation (thanks linuxgurugamer).
  • Fixed exception when removing certain contract packs (thanks rasta013).
  • Fixed edge case where AwardExperience was late awarding the experience (thanks severedsolo).
  • Fixed exception with Contracts Window + (thanks sidfu).
  • Improved accuracy of VesselNotDestroyed checks (thanks inigma).
  • Fixed bug in barycenter logic when using Sigma Binary (thanks sentania).
  • Improved backwards compatibility with contract packs using the old Wheel module name (thanks galenmacil).
  • Re-generate PQS offset coordinates when flight begins (workaround for Kopernicus waypoint offset issue).

Contract Configurator 1.11.5

  • Fixed exception when recovering vessel (thanks BluK).
  • Recompile to RemoteTech 1.7.0.

Contract Configurator 1.11.4

  • Clean up some "Input is null" errors/warnings.
  • Deprecated VesselParameterDelegator.
  • Remove support for ancient versions of Module Manager.

Contract Configurator 1.11.3

  • Revert additional check added in 1.11.0 that broke PartModuleTypeUnlocked (thanks KnotaiG).
  • Work around upgrade issue with ReachSpecificOrbit (thansk Tossy64).

Contract Configurator 1.11.2

  • Recompile against KSP 1.1.2.
  • Possible fix to PartModuleUnlockedRequirement (thanks AccidentalDisassembly).
  • Fixed exception when generating autoAccept contracts.

Contract Configurator 1.11.1

  • Update to KSP 1.1.1 (release to make CKAN happy).
  • Compile to latest *dev* RemoteTech.

Contract Configurator 1.11.0

  • Performance fixes and improved caching of biome data.
  • Duration values can now be used in arithmetic and comparisons in expressions.
  • Added Duration.ToDouble() and Duration().
  • Added Vessel.MET().
  • Fixed issue with vessel re-assignment on undock (thanks chrisl).
  • Improved contract window text when tracking vessels in a VesselParameterGroup.
  • Improved API for requirement saving/loading.
  • Add proper error handling to PartModuleTypeUnlocked.
  • Added ReachSpecificOrbit.displayNotes back in (thanks severedsolo).
  • Fixed so orbits for offered contract show up in the tracking station and NOT in flight.
  • Minor bug fixes.

Contract Configurator 1.10.4

  • Fixed RemoteTech exceptions (thanks HaArLiNsH, Dtgnoome and Sidelia).

Contract Configurator 1.10.3

  • Fixed contract "flickering" on RemoteTech contracts (thanks Razorfang).
  • Fixed problems with SCANsat contracts (thanks Torih).
  • Fixed issues with child requirements not getting properly propagated to offered contracts.
  • Fixed disabling of contract requirements in debug menu (the contract would appear then immediately disappear).

Contract Configurator 1.10.2

  • Re-enabled RemoteTech support.
  • Fixed exception on requirement load of SCANsatLocationCoverage (thanks wizisi2k).
  • Properly fixed contract "flickering" in mission control.

Contract Configurator 1.10.1

  • Fixed exception on requirement load of FundsRequirement (thanks EldrinFal).

Contract Configurator 1.10.0

  • Support for KSP 1.1.
  • Contract requirements are now saved to persistence file (fixes issues with "flickering" contracts in mission control).
  • Added VesselValidRequirement to check if a vessel identifier is valid throughout the life of a contract.
  • Added support for PQSCity in expressions.
  • Added CelestialBody.PQSCities().
  • Fixed backwards compatibility on uniqueness checks (thanks eberkain).
  • Fixed edge case for VesselParameterGroup and completeInSequence (thanks NathanKell and stratochief).
  • Fixed problem with loading pqsCity and targetBody out of order in WaypointGenerator (thanks severedsolo).

Version Checking

This mod includes version checking using MiniAVC. If you opt-in, it will use the internet to check whether there is a new version available. Data is only read from the internet and no personal information is sent. For a more comprehensive version checking experience, please download the KSP-AVC Plugin.

Recommended Mods

The following is a list of mods that enhance some of the things Contract Configurator does:

  • Waypoint Manager - this will help with any contract using the stock waypoint system by drawing the waypoints in the flight view. Makes hitting targets more accurately much easier!

License

Contract Configurator is licensed under the MIT License.

RemoteTech integration (CC_RemoteTech.dll) is licensed under GNU GPL v2.0.

 

btn_donate_SM.gif Like what you see? Consider donating to the coffee fund! It will not go directly to supporting this or other mods under my care, but it may keep my motivation up!

 

Edited by nightingale
  • Like 48

Share this post


Link to post
Share on other sites

Listing of Contract Packs

This is a list of all mods that provide contracts packs built on Contract Configurator. If you have something you'd like added to this list, PM me or post in this thread.

[Active]

Retired/Unsupported Contract Packs

Contract packs that have fallen out of support or simply don't work in newer versions of KSP/Contract Configurator.

  • 5dim Military @odin_spain - Some changes to how vessels spawn in Contract Configurator broke the spawning in this contract pack, and odin_spain seems to have disappeared.
  • SCANsat Lite @severedsolo- This contract pack has been integrated into SCANsat itself.
  • Sprite Missions @linuxgurugamerSadly the sprite doesn't work in 1.x aero, so this contract pack is no longer supported.
  • Kerbal Aircraft Builders @maculatorContracts focused on building aircraft. (Absorbed into Giving Aircraft a Purpose (GAP))
  • SCANsat Contract Pack @DBT85 - Alternative to the contracts (also built using Contract Configurator) that come with SCANsat.(Now packaged with ScanSat)
  • Rover Contracts by Whyren! @Whyren Here is an Opportunity to seize the Spirit of rovers! Have I piqued your Curiosity? YuTu can send manned and unmanned rovers across the system and run them for years beyond their intended life span until the wheels crumble! (Taken over by @linuxgurugamer and folded into Rover Missions Redux)
  • Mission Based R&D @klefenz - Overhauls the R&D system of career mode by neutralizing the science points and unlocking tech nodes as a reward for completing missions.  (No longer available to download as old kerbal-stuff link no longer valid)
  • Maritime Mission Pack @Whitecat106 - A series of missions set at sea for a better use of Kerbin's vast oceans! Includes missions above and under water! (Modder advised leaving the KSP modding scene and now unsupported)
  • Kerbin-SideJobs @AlphaAsh - Contracts for Kerbin-Side! Ferry passengers and cargo between different Kerbin-Side bases. Also has missions of a campaign relating to ancient anomalies, with espionage and intrigue (in spaaaaaace)! (No longer supported - new Kerbin-Side continued mod maintainer @Ger_space might look into it in future)
  • Kerbin on Fire Military Contract Pack @VolwenMilitary missions for BDArmory that occur within 120km of KSC. Includes aerial combat missions! (Thread locked and no download link as kerbal-stuff link is invalid)
  • The K-Files @severedsolo - The first story based contract pack. The truth is out there! (Modder advised this is now unsupported due to lack of time)
  • Initial Contracts (SETI) @Yemo- InitialContracts replaces the buggy/annoying stock starting contracts with 3 similar ones, which can be completed by manned and unmanned craft. Thus the mods contracts are especially useful for TechTrees which start unmanned and may be redistributed with them  If you like what you see, then check out SETI-Contracts for the full deal! (Seems that support for this pack has dropped as last release was for KSP1.1.2)
  • Historic Missions  @Whitecat106 - Historic missions following manned (human) space flight. This contract pack contains over 600 contracts with detailed backgrounds on the real missions. (Unsupported now, but 'Rebuilt' by @Frylovespi as History of Spaceflight )
  • Clever Sats @severedsolo - More in-depth replacement of the stock satellite contracts.(Modder moved on from contract modding)
  • Base Construction @CosmoBroConstruct and maintain planetary bases! (Mod was folded into Kerbin Bases and Stations )
  • Banking @ArachnidekAdds a bank to the game. The bank gives you money and after 2 weeks it takes it back with some interest. (Built for KSP 0.90, unsupported since then)

Rules for Getting a Contract Pack Listed

  1. A contract pack is an add-on and falls under Squad's forums rules for add-on posting. All rules in that posting must be followed, but this licensing one in particular should be pointed out (emphasis mine):
    Licenses
    All add-ons that are posted on the services maintained by Squad that serve the KSP Community (such as this forum and Curse) must be accompanied by a license that regulates what other users can do with the copyrighted material. This license must be made available in both the download file and in the location the user downloads from (such as a forum post or a Curse listing).
  2. If the contract pack modifies, enhances or uses another mod, be respectful of the licenses of those mods. If the maintainer of a mod used by a contract pack requests that a contract pack be removed or modified, please work with them to make the Contract Pack comply with their wishes and vision for their mod. Remember that the contract pack wouldn't be possible without the original author's mod.
  3. I, nightingale, have the final say on what is listed. I do not generally want to be the one telling people what they can and cannot do, so I will list most contract packs so long as the comply with the above two rules.

Recommendations for Contract Packs

  1. Have your contract pack install into a subdirectory under GameData/ContractPacks/. Contract Configurator does not require this directory structure, but this keeps it cleaner for the end user.
  2. If adding your contract pack on CKAN, a name of the form "Contract Pack: <name of contract pack>" is recommended. This keeps the listings of all contract packs together, and allows the player to easily compare and decide which contract packs they are interested in.
  3. Try to be original. If your contract pack has significant overlap with an existing contract pack, consider contacting the author and working with them to enhance the contract pack.
  4. Be creative! The possibilities for contract packs are endless.
Edited by nightingale
  • Like 6

Share this post


Link to post
Share on other sites

Another mod to make modders' lifes easier! That's how I like it!

Thanks for your effort, Nightingale. That's a great work, and I'm looking forward to it! :)

Share this post


Link to post
Share on other sites

Your doing the work of the gods. This will lead to a whole lot of contract mods and that is a good thing. Would it be possible to add something that can disable the standard contracts, so that if you make for example a pack of contracts that resemble the Space Race, you won't have the stock contracts messing up the contracts menu.

Edited by CaptRobau

Share this post


Link to post
Share on other sites

Great job!

Is it possible to add two things?

First, VesselSpawner - which would spawn a ship at specified orbit, just like Kerbals from rescue contracts (I'm not talking about surface spawn now, just orbit). The vessel itself comes from Ships folder (i.e. it's possible to spawn, say, Aeris 3 at LKO, or any of your designs, or a design which comes with contract pack). It cannot be controlled until docked with.

Second, completion (or failure) of another contract as a requirement of spawning of the next contract. You can see why it's needed - with it, it would be possible to set up a full-blown, non-linear, story-driven campaign.

  • Like 2

Share this post


Link to post
Share on other sites

Awesome. Any plans for an end-user version? I'd love a way to block certain contracts from being generated in the first place :)

Share this post


Link to post
Share on other sites

While we're asking things, the one thing I saw lacking in that is the ReturnFrom parameter. It also would be nice to have some generic parameters, like HasCrew, HasPower, etc.

(The reason for these is it would be nice to make a "crewed orbit" mission, i.e. return a kerbal safely from orbit.)

  • Like 1

Share this post


Link to post
Share on other sites

It needs a duration parameter to accommodate and reward those using life support mods. (ie remain in orbit for 10 days)

OR...

Requirements for specific resources can ape a duration requirement (ie must have at least 5 Oxygen onboard").

With the original mission controller mod we could write contracts that would chain requirements. That made storytelling possible. Go here then go there ... rather than Squad's dwarf-fortress approach allowing only procedurally generated contracts.

  • Like 1

Share this post


Link to post
Share on other sites

Thanks all for the really positive feedback. I'm happy that my first mod has been so well received!

Great job!

Is it possible to add two things?

First, VesselSpawner - which would spawn a ship at specified orbit, just like Kerbals from rescue contracts (I'm not talking about surface spawn now, just orbit). The vessel itself comes from Ships folder (i.e. it's possible to spawn, say, Aeris 3 at LKO, or any of your designs, or a design which comes with contract pack). It cannot be controlled until docked with.

Good idea, I think it should be workable. Let me start with the Kerbal version (ie. like the rescue contract) and work my way there. I'm thinking it would be an optional section that can be added to the RecoverKerbal to generate the Kerbal (it doesn't right now because that logic in stock sits in the Contract and not the ContractParameter (I'm currently only providing a wrapper to generate the ContractParameter). I'm thinking you'd be able to specify the attributes of the orbit (using the same values HyperEdit uses such as apoapsis, periapsis, inclination, etc.). Unless of course, you're happy just with circular equatorial orbits at 100km... :wink:

Once I get that going, the I don't think ship version shouldn't be a huge jump.

Second, completion (or failure) of another contract as a requirement of spawning of the next contract. You can see why it's needed - with it, it would be possible to set up a full-blown, non-linear, story-driven campaign.

The requirement having another one complete is already there, that's the CompleteContract requirement:


// Requirement for having a certain number of contracts completed of the given type.
REQUIREMENT
{
name = CompleteContract1
type = CompleteContract


// The type of contract being checked. This can either be a ContractConfigurator contract
// type or a standard contract type (class).
contractType = SimpleTestContract


// The minimum number of times the given contract type must have been completed before
// the requirement is met.
// Default = 1
minCount = 1


// The maximum number of times the given contract type can be completed before the
// requirement will no longer be met.
// Default = Infinite
maxCount = 5
}

I'll maybe enhance this (or create a different one) to allow for requiring that a contract be failed.

You correctly guessed where I'm going with this - the mod that I wanted to build was one that had a tree of progression based one-time contracts, but I realized they didn't fit nicely in with the way the Squad contract system works. Most of my goals around ContractConfigurator are to set the stage for this future mod.

Your doing the work of the gods. This will lead to a whole lot of contract mods and that is a good thing. Would it be possible to add something that can disable the standard contracts, so that if you make for example a pack of contracts that resemble the Space Race, you won't have the stock contracts messing up the contracts menu.
Awesome. Any plans for an end-user version? I'd love a way to block certain contracts from being generated in the first place :)

Yup, definitely plans for building a mod using ContractConfigurator. I'd considered for that mod that I might disable the stock contracts (or some of them), but decided to just leave it. Since there's interest I'll look into ways to disable contracts via ContractConfigurator configuration - it looks like the list of valid contract types is public in the Squad code, so I should be able to modify it (just need to figure out the right time to do it).

While we're asking things, the one thing I saw lacking in that is the ReturnFrom parameter. It also would be nice to have some generic parameters, like HasCrew, HasPower, etc.

(The reason for these is it would be nice to make a "crewed orbit" mission, i.e. return a kerbal safely from orbit.)

For the first release I didn't write any parameters - just wrappers to the stock ones. The next major goal will be supporting Fine Print parameters (since they will be stock soon enough anyway). After that I'll looks at interesting/generic parameters/requirements. The ones you've mentioned all seem reasonable, I'll add them to the backlog.

It needs a duration parameter to accommodate and reward those using life support mods. (ie remain in orbit for 10 days)

OR...

Requirements for specific resources can ape a duration requirement (ie must have at least 5 Oxygen onboard").

I like it, that's a good idea. I'll have to play around with it a little bit to make sure it can be done as a standalone duration parameter. I'm thinking it will be a wrapper like this:


// Example - orbit the Mun for 10 days
PARAMETER
{
// Parameter is completed when all child parameters have been completed for the specified duration
type=Duration
duration=10 days

PARAMETER
{
type=ReachSituation
situation=Orbit
disableOnStateChange=false
}
PARAMETER
{
type=ReachDestination
targetBody=Mun
disableOnStateChange=false
}
}

As to your alternate suggestion I'd also like to be able to make this fit in with resource/mining mods - so Parameters like "have x amount of resource y" on a vessel are definitely in the pipeline. So in the end I'll probably implement both of these suggestions.

With the original mission controller mod we could write contracts that would chain requirements. That made storytelling possible. Go here then go there ... rather than Squad's dwarf-fortress approach allowing only procedurally generated contracts.

And that's the exact type of mod I'd like to make easy for people to write.

  • Like 1

Share this post


Link to post
Share on other sites
I'd like a contract, saying "We want you to do a thing"

"Now, as you've surely deduced already from all this, this is why we're here". :sticktongue:

Nice please add the Ability to modify the amount of research fom contracts

Do you mean modify the amount of research from other contracts (ie. stock ones)? I'll be honest, that's starting to get outside the intended scope of ContractConfigurator (which is providing an easy option for creating new contracts). Or did I misunderstand your request?

Share this post


Link to post
Share on other sites

Yeah, as an old Mission Controller dev I recognized the approach straight away (so is Sandworm, so that's not surprising. :D ).

ReturnFrom is a stock Param, though, I thought? The other stuff not so much...I would highly suggest waiting a bit for dealing with FP, as we don't know how much has changed for 0.90.

Share this post


Link to post
Share on other sites

I've got a couple of my old mission packs for lying around. But they all involve duration and/or resource requirements.

I did a bunch to simulate the realities if interplanetary flight. A sub-mission requirement such as ((in orbit = Sun) and (liquidfuel = 0) for (time=50 days)) forces the player to rely on xenon or monoprop, simulating the reality of boiloff without getting into realfuels-type plugins.

Testing missions would also benefit from a duration requirement. Run a test between 10k and 12k is easy. Staying between 10k and 12k for 5 minutes is a much much harder task.

Share this post


Link to post
Share on other sites
ReturnFrom is a stock Param, though, I thought?

It's an achievement - KSPAchievements.ReturnFrom (Flight | FlyBy | Orbit | SubOrbit | Surface). A lot of the achievements seem to have a mirrored ContractParameter, but not this one. But given that there's an achievement, that means that there's the right hooks to make writing a parameter for it pretty easy (I hope).

I would highly suggest waiting a bit for dealing with FP, as we don't know how much has changed for 0.90.

That's probably good advice. Some of the FP parameters are so perfect in their simplicity that I can see them changing (ie. PartNameParameter - it's simply "have part x on the vessel"), but others may not fit well in current stock KSP (ie. ResourceExtractionParameter - there's currently no way to extract resources in stock). At the same time, there's stuff like ResourcePossessionParameter - which exactly matches up with the parameter that Sandworm suggested. I guess it depends on how hard it is - writing a ParameterFactory wrapper can be as quick as 5-10 minutes - and that's for the Squad ones where I have to make some guesses based on methods/members - having full access to the code makes the FP ones *easy*.

Arsonide, I'm sure you're under NDA, but if the FP parameters are going into stock relatively untouched, please cough or blink twice. :sticktongue:

Share this post


Link to post
Share on other sites
Nice please add the Ability to modify the amount of research fom contracts

I know there's a mod (ZeroScienceContracts) which zeros out science for people who think science from contracts is cheaty.

Do you mean modify the amount of research from other contracts (ie. stock ones)? I'll be honest, that's starting to get outside the intended scope of ContractConfigurator (which is providing an easy option for creating new contracts). Or did I misunderstand your request?

I know the question is a bit out-of-scope, but in the process of writing the mod, have you found a way to get a reference to each contract as it is offered? I'm trying to do blanket editing of contracts, and what ZeroScience does won't work for me*.

*ZeroScience zeroes out the science on all contracts each time the list changes, whereas what I'm doing needs to be a one-time multiplier of funds. I've tried adding a dummy parameter to mark ones I've already visited, and it caused odd behavior with the scripted contracts: I think the parameter list is part of how KSP recognizes those scripted contracts.

Share this post


Link to post
Share on other sites
I've just look at the archive, why not adding the 2nd post content inside ? (License didn't help that's much :confused:).

I just wanted to keep the first post clean/short (it'll grow with the changelog). Also keeping the "documentation" in one post seemed sensible.

I've got a couple of my old mission packs for lying around. But they all involve duration and/or resource requirements.

I did a bunch to simulate the realities if interplanetary flight. A sub-mission requirement such as ((in orbit = Sun) and (liquidfuel = 0) for (time=50 days)) forces the player to rely on xenon or monoprop, simulating the reality of boiloff without getting into realfuels-type plugins.

Testing missions would also benefit from a duration requirement. Run a test between 10k and 12k is easy. Staying between 10k and 12k for 5 minutes is a much much harder task.

If I wasn't convinced before, I am now. Expect the Duration parameter in the next release.

Share this post


Link to post
Share on other sites
I know the question is a bit out-of-scope, but in the process of writing the mod, have you found a way to get a reference to each contract as it is offered? I'm trying to do blanket editing of contracts, and what ZeroScience does won't work for me*.

*ZeroScience zeroes out the science on all contracts each time the list changes, whereas what I'm doing needs to be a one-time multiplier of funds. I've tried adding a dummy parameter to mark ones I've already visited, and it caused odd behavior with the scripted contracts: I think the parameter list is part of how KSP recognizes those scripted contracts.

Nope, haven't found a way - mainly since I wasn't looking for it. ContractConfigurator works by having a single new Contract sub-class "ConfiguredContract". All contracts specified in the config file are of that class - the additional information is mostly captured in the ContractType class.

You're right though - the contract system does interesting things with parameters - when I was testing a contract with no parameters it caused an exception in a sorting method. Presumably, something about parameters (I have no idea what) affects how they are sorted in the window.

I'd suggest calling GetHashString() on each Contract instance and recording in your own class (perhaps with a Dictionary) which ones have been handled. I don't pretend to completely understand how GetHashString() is used by the contract system - but the implication is it needs to be unique for each contract instance. I can also see Contract.ContractID - which I have to assume also uniquely identifies a contract instance (but if so, why have GetHashString()??)

Share this post


Link to post
Share on other sites

I'd love to see parameters for Orbital Period, Eccentricity, Inclination, and other orbital parameters (Arg. of Periapsis, Long. of AN, AP Height, PE Height, or just Semi-Major and Semi-Minor Axes). It'd be really cool if there were some pre-defined orbits as well using the celestial body's parameters (so it'd work with RSS and 6.4x kerbin). "Tundra" orbits, Polar orbits, Keostationary, Keosynchronus, etc etc...

Maybe I'll play with the code and see what I can do...

  • Like 1

Share this post


Link to post
Share on other sites
I'd suggest calling GetHashString() on each Contract instance and recording in your own class (perhaps with a Dictionary) which ones have been handled. I don't pretend to completely understand how GetHashString() is used by the contract system - but the implication is it needs to be unique for each contract instance. I can also see Contract.ContractID - which I have to assume also uniquely identifies a contract instance (but if so, why have GetHashString()??)

Thanks for the help: the dictionary idea is promising. GetHashString() won't work: it keeps on changing when the scene changes. More testing is required, but I think Contract.ContractID is going to work better.

EDIT: Contract.ContractID does seem to be unique, and persistent between reloading the game. Now to figure out where to steal some code for keeping a dictionary persistent for a save game, probably from KAC.

Edited by Starman4308

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now