Skip to content
Jeremie Rossignol edited this page Apr 1, 2016 · 15 revisions

Table of Contents

Creating a New Contract

To create new contracts create a new .cfg file in your mod's directory. If you're creating a new mod, then just create a sub-directory under GameData for the .cfg file(s) to live. If you are creating a Contract Pack (a mod that only contains Contract Configurator contracts), then it is suggested that you place your mod's directory as a subdirectory under GameData/ContractPacks/ instead.

The file name for the .cfg files can be anything (although it must end in .cfg). In the file, create a CONTRACT_TYPE node, like this:

CONTRACT_TYPE
{
}

And then start adding to it! See the Contract Type page for the full syntax. Or if you want to look at some examples, check out the test directory. One file may contain one or more of these CONTRACT_TYPE nodes - it's up to you to decide what the best way to organize it for you is.

[ Top ] [ Creating a New Contract ]

Turning On Debug

To turn on debug, copy the GameData/ContractConfigurator/ContractConfigurator.cfg.default file to ContractConfigurator.cfg. Then edit the file and change logLevel = INFO to logLevel = DEBUG. This will spit out some additional useful information when loading contracts, as well as adding a pop-up notification saying how many contracts loaded (and how many were attempted).

[ Top ] [ Turning On Debug ]

Testing a Contract

When creating a new contract, the first thing too look at is the Contract Configurator debug menu (Alt-F10) from the main menu. This will display a GUI with all the Contract Configurator contracts. If any failed to load, they will be displayed in red. To see the details of why it failed loading, see the output in the main debug log (Alt-F12). If there are no errors, then continue on and test your contracts as normal.

After fixing any errors, the contracts can be reloaded by pressing the the "Reload Contracts" button in the debug menu. For reference, the debug menu is shown below:

Within this menu, the following operations can be performed:

  • Reload contract types
  • View contract type details
  • Inspect underlying ConfigNode details
  • Temporarily disable parameters/requirements/behaviours

[ Top ] [ Testing a Contract ]

Creating an Agency

If you wish to create your own agency, all it takes is one config file, and a couple images. Within the config file (this can be the same as your Contract Configurator contracts), add the following node:

AGENT
{
    // The name of your agency
    name = Contract Configurator Inc.
  
    // Description of your agency
    description = Add a cool description here
  
    // Logo URL should be the full path to the image file for the logo (256x160)
    logoURL = ContractConfigurator/MyLogo

    // Logo URL is the full path to the scaled down image for thumbnails (64x40)
    logoScaledURL = ContractConfigurator/MyLogo_scaled
}

[ Top ] [ Creating an Agency ]

Preventing other contracts from using your Agency

Contracts in KSP are assigned an agency based on a parameters set by the contract (which aren't exposed by Contract Configurator). These parameters don't have a high level of visibility to the player - so they end up seeming pretty random (with the exception of the hardcoding in the part test contracts to prefer the agency that makes the part). To prevent other contracts from using your agency, use the NoRandomContractMentality provided by Contract Configurator in your AGENT config:

AGENT
{
    <rest of your agent config goes here>

    mentality = NoRandomContractMentality
}

[ Top ] [ Creating an Agency / Preventing other contracts from using your Agency ]

Using TextGen

TextGen is the Squad system for generating contract descriptions. If you would like to use this, I highly recommend making use of the Coherent Contracts mod.

To use TextGen, supply the topic, subject and motivation in your CONTRACT_TYPE node.

topic - The specific topic of the contract. This can be any singular noun and will be displayed prominently in the text. Here's some examples of Coherent contract phrases that use :

  • ...interest in [Topic] systems is off the charts...
  • ...we should study [Topic] and [Topic] accessories...
  • ...[Topic] needs rescuing... (where motivation=rescue)
  • ...test the [Topic] in service... (where motivation=test)

subject - The subject of the contract. This should be from either the list of values in Coherent Contracts (which presumably matches stock KSP), or you can use your own values if you provide strings for it (see Coherent Contracts for an example of how to do that). Some sample phrases that get used for subject:

  • [Subject] = [text]
  • Kerbal = all Kerbals enjoy feeling weightless
  • Experiment = and felt the need to do some tests
  • Mun = there was a far side to the Mun

The full list of values that is currently in Contract Configurator for the subject is (note there are also generic strings that get used if blank):

  • Duna
  • DunaSrf
  • Eve
  • EveSrf
  • Experiment
  • Gilly
  • GillySrf
  • Ike
  • IkeSurface
  • Kerbal
  • Kerbin
  • KerbinSrf,Deserts
  • Minmus
  • MinmusSrf
  • Moho
  • MohoSrf
  • Mun
  • MunSrf
  • Orbit
  • Orbit,Space
  • Parts
  • Sun

motivation - Motivation for why we are doing the contract. Like the subject, this needs to be from a valid list if you are not providing your own values. Examples:

  • [Motivation] = [text]
  • flags = decided we needed to have a flag, to make a point about how
  • test = remained unsure if
  • rescue = due to an unfortunate series of events, [Topic] needs rescuing...

Values for motivation (note there are also generic strings that get used if blank):

  • flags
  • rescue
  • test

[ Top ] [ Using TextGen ]

Clone this wiki locally