Jump to content

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


nightingale

Recommended Posts

5 hours ago, Mr Shifty said:

Anyone know?

You can do this in the CONTRACT_GROUP node with the following;

    // List any contract types to disable as part of this contract group.
    // Multiple values can be provided.  These can be a Contract Configurator
    // CONTRAC_TYPE name, a stock contract type class name, or a mod contract
    // type class name.
    disabledContractType = ARMContract

You can also go into the difficulty settings for Contract Configurator and disable various contract agencies there as well as certain classes of stock contracts.

 

21 hours ago, Kerolyov said:

Once I do the other contract can then be identical to the acepted one and it seems random even using SelectUnique()

I would need to look at your contract file.

Link to comment
Share on other sites

  • 2 weeks later...
1 hour ago, Kerolyov said:

Any thoughts or help appreciated

I was able to get the next two unreached bodies to be offered in contracts at the same time with the following;

	DATA
	{
		type = CelestialBody
		targetBody1 = NextUnreachedBodies(2).Random()
		uniquenessCheck = GROUP_ACTIVE
		title = Must have not reached all bodies.
	}

UXLusEM.png

Link to comment
Share on other sites

I'm having an issue with ScienceSubject functions.

I am making unmanned Mun / Minmus lander contracts where each Biome should only be visited once, and the ScienceSubject needs to be something that can be done autonomously, but is not a robotic arm contract. How I am doing this is by filtering all experiments on the body through an exclusion list, which contains the manned experiments as well as all possible robotic arm combinations (i.e., ROCScience_MunStone, ROCScience_MunCrater, etc). 

My issue is that the only subjects returned by AllScienceSubjectsByBiome() are the robotic arm subjects, despite there being many other valid subjects, so my subsequent filtering starts returning null values because it's doing the right thing by removing them. At that point, the contract doesn't fail to load but it never gets offered, which I presume is because there's no ScienceSubject for the CollectScience parameter to work with.

Assuming no known issues with ScienceSubject, then I'm sure I'm missing something simple. If anyone has the time, these are the relevant data nodes in my contract, though they are a little more verbose than normal since I'm trying to debug. Everything appears to function normally until tempSubjects0 returns only the possible ROCScience_* subjects for the selected biome.

    DATA
    {
        type = Biome
        uniquenessCheck = CONTRACT_ALL
        hidden = true
        
        selectedBiome = @/targetBody.Biomes().SelectUnique()
    }
    
    DATA
    {
        type = List<ScienceExperiment>
        hidden = true
        
        validExperiments = AvailableExperiments(@targetBody).ExcludeAll(@CREI:srfProbeExcludeList)
    }
    
    DATA 
    {
        type = List<ScienceSubject>
        hidden = true
        
        tempSubjects0 = AllScienceSubjectsByBiome([@selectedBiome]).
        tempSubjects1 = @tempSubjects0.Where(s => @validExperiments.Contains(s.Experiment()))
        tempSubjects2 = @tempSubjects1.Where(s => s.Situation() == SrfLanded)
        validSubjects = @tempSubjects2.Where(s => s.RemainingScience() > 0)
    }
    
    DATA
    {
        type = ScienceSubject
        hidden = true
        
        selectedSubject = @validSubjects.Random()
    }

 

Edited by Zelda
Link to comment
Share on other sites

3 hours ago, Caerfinon said:

I was able to get the next two unreached bodies to be offered in contracts at the same time with the following;


	DATA
	{
		type = CelestialBody
		targetBody1 = NextUnreachedBodies(2).Random()
		uniquenessCheck = GROUP_ACTIVE
		title = Must have not reached all bodies.
	}

 

Thanks so much for taking a look. 

The bit that isnt working for me with this code or my original is when one of the two contracts is accepted.  I was hoping the second offered contract would not duplicate the accepted one but it still does.  I tested this by accepting one contract and then declining the other. 

In my save the next two unreached bodies are Duna and Gilly.  When I have no contract accepted it seems to work ok, but as soon as I accept one then the second one can duplicate the accepted one.  ie Accept the Duna one and when the Gilly one expired/declined the regenerated one some of the time is another Duna one.  Same prob with your code. 

Could this be a CC bug? 

Is there a way to edit the unreached bodies in the save file? 

Is there a log or debug info for CC beyond the Alt-F10 window (which doesn't say much about generation)?

Link to comment
Share on other sites

1 hour ago, Kerolyov said:

Is there a log or debug info for CC beyond the Alt-F10 window

There is a  file in the Contract Configurator folder called ContractConfigurator.cfg.default. Edit this and set all logging levels to debug. Then save it as ContractConfigurator.cfg in the folder. Then next time your game starts it will log more detail in the ksp.log and each contract file will have a separate log in the ContractConfigurator/log folder.

1 hour ago, Kerolyov said:

Is there a way to edit the unreached bodies in the save file? 

I have not really looked into this.

Link to comment
Share on other sites

3 hours ago, Caerfinon said:

Can you post the CC debug log for the contract file? and the group.cfg containing @CREI:srfProbeExcludeList ?

Well strangely enough, I just attempted to repro again to grab the logs and it worked this time. I did change the sort keys a bit, but that's it. Weird. Thanks for offering to help though!

Link to comment
Share on other sites

Im on ksp 1.12 and recieved this error. Exception occured while loading contract 'ExplorationPlus.ExplorationPlus-FlyBy':
System.ArgumentException: 'ProximaCentauri' is not a valid CelestialBody.
  at ContractConfigurator.ConfigNodeUtil.ParseCelestialBodyValue (System.String celestialName) [0x00046] in <ef0243a06f2841fe9bf57034a334902e>:0 
  at ContractConfigurator.ConfigNodeUtil.ParseSingleValue[T] (System.String key, System.String stringValue, System.Boolean allowExpression) [0x00179] in <ef0243a06f2841fe9bf57034a334902e>:0 
  at ContractConfigurator.ConfigNodeUtil.ParseValue[T] (ConfigNode configNode, System.String key, System.Boolean allowExpression) [0x002bc] in <ef0243a06f2841fe9bf57034a334902e>:0 
  at ContractConfigurator.ConfigNodeUtil.ParseValue[T] (ConfigNode configNode, System.String key, T defaultValue) [0x00012] in <ef0243a06f2841fe9bf57034a334902e>:0 
  at ContractConfigurator.ConfiguredContract.OnLoad (ConfigNode node) [0x00121] in <ef0243a06f2841fe9bf57034a334902e>:0  Im wondering about this because I dont want to lose any contract data stuff and Im wondering how to fix this or if it will be fixed by the author.

Link to comment
Share on other sites

18 hours ago, Duck0520 said:

Im on ksp 1.12 and recieved this error. Exception occured while loading contract 'ExplorationPlus.ExplorationPlus-FlyBy':
System.ArgumentException: 'ProximaCentauri' is not a valid CelestialBody.
  at ContractConfigurator.ConfigNodeUtil.ParseCelestialBodyValue (System.String celestialName) [0x00046] in <ef0243a06f2841fe9bf57034a334902e>:0 
  at ContractConfigurator.ConfigNodeUtil.ParseSingleValue[T] (System.String key, System.String stringValue, System.Boolean allowExpression) [0x00179] in <ef0243a06f2841fe9bf57034a334902e>:0 
  at ContractConfigurator.ConfigNodeUtil.ParseValue[T] (ConfigNode configNode, System.String key, System.Boolean allowExpression) [0x002bc] in <ef0243a06f2841fe9bf57034a334902e>:0 
  at ContractConfigurator.ConfigNodeUtil.ParseValue[T] (ConfigNode configNode, System.String key, T defaultValue) [0x00012] in <ef0243a06f2841fe9bf57034a334902e>:0 
  at ContractConfigurator.ConfiguredContract.OnLoad (ConfigNode node) [0x00121] in <ef0243a06f2841fe9bf57034a334902e>:0  Im wondering about this because I dont want to lose any contract data stuff and Im wondering how to fix this or if it will be fixed by the author.

Nevermind I just updated My mods and fixed it.

Link to comment
Share on other sites

  • 1 month later...
On 8/10/2021 at 7:48 PM, Angel33Demon said:

I'm not sure if I'm using the mod right, but I just installed it and it's giving me contracts for parts which I don't even have installed (Triple-Z Radio Telescope contract). Is there a fix for this?

If it's giving you a contract for a part, you've got the part in your install. It might be named differently in the in-game menu however.

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...
45 minutes ago, Teykn said:

Is there any way to have a PartValidation Parameter detect specifically Cupolas?

You can use part validation for all the specific parts for the various cupolas you are interested in. Just add multiple "part =" statements.

PARAMETER
{
    name = PartValidation
    type = PartValidation

    // The name of the part to check for.  If multiple are specified, will
    // match on ANY of the parts listed.
    //
    // Type:      AvailablePart
    // Required:  No (multiples allowed)
    //
    part = mk1pod
    part = mk1-2pod
}

 

Link to comment
Share on other sites

I would like to create contracts that look for parts in the stock inventory system, something like:

PARAMETER
{
    name = PartValidation
    type = PartValidation

    // other parameters //

    inventory = none | all | only //defaults to none but can search through all parts and inventories or just inventories (i.e. not active parts)

}

My questions to the dev(s):  I'm pretty sure I can add something like this by extending CC but before I dive in, is some sort of inventory validation being considered or worked on?  If not is this something you would want to include into the base CC as a pull request?

Link to comment
Share on other sites

On 8/23/2021 at 10:16 PM, wolffy_au said:

So I guess @nightingale is gone for good? Last release Oct 2020 and no movement on any issues in GitHub. Is anyone planning on picking this mod up in his absence?

I don't think he's gone. He's very busy. But he logs on. The mod still works far as I know? do others know different?

and it says it supports 1.10+ and until it doesn't work. then it is still good right? no need to update it.

Link to comment
Share on other sites

 I've noticed that SSPXR has patches that seemingly add its cupolas, science labs, etc. to contracts. However, the contract pack Bases and Stations Reborn don't accept those parts (or at least doesn't list them as options in the contract). Why?

Example from SSPXR:

// SSPXr contract patches
// New cupolas count for contracts
@Contracts
{
	@Base
	{
		@PART_REQUEST:HAS[#Part[cupola]]
		{
			Part = sspx-cupola-125-1
      Part = sspx-cupola-1875-1
			Part = sspx-cupola-375-1
			Part = sspx-observation-25-1
      Part = sspx-dome-5-1
      Part = sspx-dome-observation-5-1
		}
        }
	@Station
	{
		@PART_REQUEST:HAS[#Part[cupola]]
		{
			Part = sspx-cupola-125-1
      Part = sspx-cupola-1875-1
			Part = sspx-cupola-375-1
			Part = sspx-observation-25-1
      Part = sspx-dome-5-1
		}
  }

 

Edited by Krzeszny
Link to comment
Share on other sites

6 hours ago, JPLRepo said:

I don't think he's gone. He's very busy. But he logs on. The mod still works far as I know? do others know different?

and it says it supports 1.10+ and until it doesn't work. then it is still good right? no need to update it.

Wolffy wasn't so much asking for a new version to update functionality, rather just point out there's a number of issues that have been reported over past few years that are left unattended. That's no criticism of Nightingale either, everyone here is thankful this exists at all. It's just the state of the mod.

Link to comment
Share on other sites

What would a contract look like if it had 2 parameters:
Parameter 1 would check for module x (unspecified part) and gave a specific reward (multiple parts have that module)
Parameter 2 would check for one specific part (which has module x in it) but gave a different reward?

I know how to check for errors (the Ctrl+Alt+F10 menu) but not how to "spawn" a contract if not all requirements have been met, so testing it isn't that easy.

Edited by Krzeszny
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...