Jump to content

[1.10.1+] Contract Configurator [v1.30.5] [2020-10-05]


nightingale

Recommended Posts

This may make me sound like an insane person. I would like to edit the scansat contracts so the easy ones (Kerbin, Mun, Minimus) are available even if I've scanned more than 75% of the body. I've edited the files in the log folder. They just keep resetting. Which I thought was what would happen. Is there anyway to accomplish this, I just don't want to see them not completed in my contract building...

Link to comment
Share on other sites

2 hours ago, bukschr said:

I would like to edit the scansat contracts

The Scansat contracts are located in *.cfg files in the GameData\SCANsat\Resources\Contracts directory. You can alter their behaviour by making your changes there. Your changes will be overwritten each time the mod is updated. 

Link to comment
Share on other sites

10 hours ago, Caerfinon said:

The Scansat contracts are located in *.cfg files in the GameData\SCANsat\Resources\Contracts directory. You can alter their behaviour by making your changes there. Your changes will be overwritten each time the mod is updated. 

You know, that makes significantly more sense... Thank you for the assist!

Link to comment
Share on other sites

I'm hoping to get some help....

Is there a way to determine in a list, what index a particular value is located?  For example, I have the following list and I want to return the element number of Kerbin within the list?

allPlanets = [ Moho (CelestialBody), Eve (CelestialBody), Kerbin (CelestialBody), Duna (CelestialBody), Edna (CelestialBody), Dres (CelestialBody), Jool (CelestialBody), Lindor (CelestialBody), Hamek (CelestialBody), Eeloo (CelestialBody), Nara (CelestialBody) ]

Link to comment
Share on other sites

2 minutes ago, Oneiros said:

if there are requirements/behaviours that interact with the destructible buildings?

The only scenario that might apply is using the TargetDestroyed Parameter, but you would have to construct "the building" structure as a "vessel" since the parameter only relates to vessels. It is used in conjunction with weapons mods. 

There isn't anything that I could see that checks the status of building structures like the KSC ones. 

Link to comment
Share on other sites

I've searched this topic as best I can and cant find the answer to my question - so I thought id post.

Im creating a basic satellite contract pack. The contract in question is to deliver a payload into an orbit generated using the OrbitGenerator / RANDOM_ORBIT.

What i want to do is set the rewardFunds to be calculated based off the orbit parameters generated (eg more reward for higher inclined orbit).

Can this be done?

Link to comment
Share on other sites

6 minutes ago, Qwarkk said:

Can this be done?

Could you use two vessel state Orbit Parameters to accomplish this?

The first Parameter is the min/max settings to satisfy the contract.

The second optional Parameter is a more specific min/max requirement for the orbit that if met generates an additional reward for completion of the parameter.

Link to comment
Share on other sites

Did some testing with the new EVA construction Inventory slots. Couldn't find an obvious way to detect what was contained in the inventory, but the PartValidation parameter can be triggered by using EVA Construction to add new parts to the vessel. (Same behaviour with KIS also). Raised a Feature request on GitHub to see if there was a way that stock inventory could be added with maybe a HasCargo parameter check.

Envisioning creating some field repair contract possibilities in a future update if it's doable.

Link to comment
Share on other sites

Is there a way to use contract names that have been generated through the DATA_EXPAND in complete contract requirements?  I have a contract with the following DATA_EXPAND where homeMoons are moons around the home world:

    DATA_EXPAND
    {
        type         = CelestialBody
        targetBody1    = @KSP_Contracts:homeMoons
    }

I want to use the requirement complete requirement in other contracts to ensure they are complete first but I can't get the requirement to work unless I hardcode the name.  I don't want to hardcode the name since I want the contract pack to work with different planet systems.  Any ideas would be appreciated...

 

Link to comment
Share on other sites

edit: Okay, found my issue causing the contract failure, disregard. I only thought they were alive because the command capsule survived. They were in the Hitchhiker Storage Container, which didn't survive. Ouch.

Edited by TheDeamon
Link to comment
Share on other sites

19 hours ago, HawkEngineer said:

    DATA_EXPAND
    {
        type         = CelestialBody
        targetBody1    = @KSP_Contracts:homeMoons
    }

Isn't he data expand a list? so type = List<CelestialBody> ? 

In the page https://github.com/jrossignol/ContractConfigurator/wiki/Data-Node#the-data_expand-node

The notes at the bottom says "Note in the example above that the type is defined as an int, but the actual type provided must be List<int>."

Link to comment
Share on other sites

57 minutes ago, Caerfinon said:

Isn't he data expand a list? so type = List<CelestialBody> ? 

In the page https://github.com/jrossignol/ContractConfigurator/wiki/Data-Node#the-data_expand-node

The notes at the bottom says "Note in the example above that the type is defined as an int, but the actual type provided must be List<int>."

Thanks for the response, the homeMoons is actually a list which is defined elsewhere in the main contract group.  The contract works until I try to set a requirement complete complete that references another contract that uses DATA_EXPAND...

I define the contract variable using the following data structure which works and the verifyContract variable is assigned the correct contract name which I want to verify complete:

    DATA
    {
        type            = string
        verify1            = MoonRelay
        verifyContract    = @verify1 + @/targetBody
        requiredValue        = true
    }

Then in the requirement section, the contract fails to load but does not give me any errors when I insert the following text into the contract definition file, without the requirement check, the contract loads and expands correctly.  The verifyContract variable is the name of the previous contract that should be completed before this one is offered.

    REQUIREMENT
    {
        name = CompleteContract
        type = CompleteContract
        contractType = @/verifyContract
        title = Complete @contractType Contract
    }

For the requirement complete type, can the contractType equal a variable?  It seems when a variable is used, the contract fails but when it is hardcoded, it works?

 

Edited by HawkEngineer
Link to comment
Share on other sites

1 hour ago, HawkEngineer said:

unfortunately the log file does not get created when I insert the complete Contract requirement

There should be entries in your KSP.log then that shows what might be going on with the contract as the game tries to load it and it fails to do so. That would be the next place to look for causes.

Link to comment
Share on other sites

28 minutes ago, Caerfinon said:

There should be entries in your KSP.log then that shows what might be going on with the contract as the game tries to load it and it fails to do so. That would be the next place to look for causes.

Appreciate the help....I have parsed through the ksp.log file and found the following error related to the contract in question:

 

Spoiler

LOG 12:26:40.250] [DEBUG] ContractConfigurator.ContractConfigurator: Loading CONTRACT_TYPE nodes.
[EXC 12:26:40.743] NullReferenceException: Object reference not set to an instance of an object
    ContractConfigurator.ContractCheckRequirement+<>c__DisplayClass5_0.<SetValues>b__0 (ContractConfigurator.ContractType ct) (at <ef0243a06f2841fe9bf57034a334902e>:0)
    System.Linq.Enumerable.Any[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) (at <fbb5ed17eb6e46c680000f8910ebb50c>:0)
    ContractConfigurator.ContractCheckRequirement.SetValues (System.String contractType) (at <ef0243a06f2841fe9bf57034a334902e>:0)
    ContractConfigurator.ContractCheckRequirement.LoadFromConfig (ConfigNode configNode) (at <ef0243a06f2841fe9bf57034a334902e>:0)
    ContractConfigurator.CompleteContractRequirement.LoadFromConfig (ConfigNode configNode) (at <ef0243a06f2841fe9bf57034a334902e>:0)
    ContractConfigurator.ContractRequirement.GenerateRequirement (ConfigNode configNode, ContractConfigurator.ContractType contractType, ContractConfigurator.ContractRequirement& requirement, ContractConfigurator.IContractConfiguratorFactory parent) (at <ef0243a06f2841fe9bf57034a334902e>:0)
    ContractConfigurator.ContractType.Load (ConfigNode configNode) (at <ef0243a06f2841fe9bf57034a334902e>:0)
    Rethrow as Exception: Error loading CONTRACT_TYPE 'MoonRelayBackup'
    ContractConfigurator.ContractType.Load (ConfigNode configNode) (at <ef0243a06f2841fe9bf57034a334902e>:0)
    ContractConfigurator.ContractConfigurator+<LoadContractTypeConfig>d__31.MoveNext () (at <ef0243a06f2841fe9bf57034a334902e>:0)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
    UnityEngine.Debug:LogException(Exception)
    ContractConfigurator.LoggingUtil:LogException(Exception)
    ContractConfigurator.<LoadContractTypeConfig>d__31:MoveNext()
    ContractConfigurator.<FinalizeContractTypeLoad>d__30:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

 

Link to comment
Share on other sites

3 hours ago, HawkEngineer said:

Appreciate the help

Not sure I can help with this though. The only other contract packs I've seen use the Data_Expand are the ScanSat contracts, but in their requirements they are looking for % of planet scanned not the completion of another contract. Perhaps that particular requirement node required a not variable entry or one that meets deterministic = true requirement. 

Link to comment
Share on other sites

14 hours ago, Caerfinon said:

Not sure I can help with this though. The only other contract packs I've seen use the Data_Expand are the ScanSat contracts, but in their requirements they are looking for % of planet scanned not the completion of another contract. Perhaps that particular requirement node required a not variable entry or one that meets deterministic = true requirement. 

Thanks for the feedback, I did try that hardcoding the name works so I believe it is something to do with using a variable in the contractType field.  I was hoping to use the DATA_EXPAND field so that the contract files could be used for any planet pack...might need to rethink the approach....

Link to comment
Share on other sites

  • 2 weeks later...

Quick Question:

Does anyone know if an error is generated when using an iterator within the parameter node when the iterator list is empty?  For example, if the iterator is written:

    ITERATOR
    {
        type = CelestialBody
        targetMoon = @/targetBody.Children()
    }

If the targetBody does not have any moons, will the parameter node be skipped or will this cause an error in loading the contract?

Link to comment
Share on other sites

11 hours ago, HawkEngineer said:

Quick Question:

Does anyone know if an error is generated when using an iterator within the parameter node when the iterator list is empty?  For example, if the iterator is written:


    ITERATOR
    {
        type = CelestialBody
        targetMoon = @/targetBody.Children()
    }

If the targetBody does not have any moons, will the parameter node be skipped or will this cause an error in loading the contract?

Probably the latter, but it may depend on the type of parameter. It's an easy thing to check. When ingame, just checkout the CC debug menu for any notifications (red texts usually) concering the contract in question.

Link to comment
Share on other sites

Hi there. I was just wondering something. I've gone through the documentation, but I couldn't find how to do the following:

If I just want to disable all ARM Contracts from the base game, do I just make a .cfg file in a folder like /GameData/ContractPacks/MyFilter/filter.cfg, and then have the contents of filter.cfg be

CONTRACT_CONFIGURATOR
{
    disabledContractType = ARMContract
}

?

Thanks.

Link to comment
Share on other sites

19 minutes ago, RenegadeWizard said:

If I just want to disable all ARM Contracts from the base game

You could just go into settings of Contract Configurator and disable them from GUI (along with any other stock contracts as well). 

Otherwise you need to make a contract group... but the GUI is the way to go on this.

CONTRACT_GROUP
{
    name = somename
    displayName = sometext

    minVersion = 1.30.3
    agent = Field Research Team

    // Disable the stock science contracts
    disabledContractType = thingstodisable
}

Contract Configurator > wiki > Contract-Group        More details in the wiki

Edited by Caerfinon
Link to comment
Share on other sites

1 hour ago, Caerfinon said:

You could just go into settings of Contract Configurator and disable them from GUI (along with any other stock contracts as well). 

Otherwise you need to make a contract group... but the GUI is the way to go on this.


CONTRACT_GROUP
{
    name = somename
    displayName = sometext

    minVersion = 1.30.3
    agent = Field Research Team

    // Disable the stock science contracts
    disabledContractType = thingstodisable
}

Contract Configurator > wiki > Contract-Group        More details in the wiki

Thanks! I will try both. This is a great mod and I look forward to learning all about it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...