Jump to content

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


nightingale

Recommended Posts

37 minutes ago, inigma said:

<snip>

How best to require a craft not to have solid rocket motors, but allow for any other engine type?

edit: it seems all the engines that fail have in common the partModule ModuleEngines. and all the engines that pass have the partModule ModuleEnginesFX. It seems then the filter is looking for all parts with ModuleEngines, but not checking the NONE parameter. Correct?

                EngineType = SolidBooster

There should be a warning about that in the log - as it should have no idea about EngineType.  Looking at the code (if the documentation doesn't agree, then let me know as it might be wrong), you should be wrapping that in a MODULE node:

           NONE
            {
                MODULE
                {
                    EngineType = SolidBooster
                }
            }

I don't have a good answer for the ModuleEngines vs. ModuleEnginesFx bit.  So I made a couple changes and now it will "magically" pick up ModulesEnginesFX for ModuleEngines.

Link to comment
Share on other sites

12 minutes ago, nightingale said:

                EngineType = SolidBooster

There should be a warning about that in the log - as it should have no idea about EngineType.  Looking at the code (if the documentation doesn't agree, then let me know as it might be wrong), you should be wrapping that in a MODULE node:


           NONE
            {
                MODULE
                {
                    EngineType = SolidBooster
                }
            }

I don't have a good answer for the ModuleEngines vs. ModuleEnginesFx bit.  So I made a couple changes and now it will "magically" pick up ModulesEnginesFX for ModuleEngines.

        PARAMETER
        {
            name = PartValidation
            type = PartValidation
            title = not have any solid rocket motors
            
            FILTER
            {
                partModule = ModuleEngines
                
            }

            NONE
            {
                MODULE
                {
                    EngineType = SolidBooster
                    
                }
                
            }
            
        }

 

Is just not working. Even with your latest fixup. The contract window says:

 

None have module Engines: Incomplete

None have module: Incomplete

None have Engine Type: SolidBooster: Incomplete

 

and it fails on any engine now.

Edited by inigma
Link to comment
Share on other sites

If you ask me, I think what's happening is that the filter is working, but the NONE is being applied to all the filter objects itself, and not to objects whose attributes are in the NONE node. Essentially if a NONE node exists in PartValidation, then the NONE check is applied to all FILTER objects, regardless of any additional attributes found in the NONE node. 

 

Opened #449 for this.

Edited by inigma
Link to comment
Share on other sites

6 minutes ago, inigma said:

If you ask me, I think what's happening is that the filter is working, but the NONE is being applied to all the filter objects itself, and not to objects whose attributes are in the NONE node. Essentially if a NONE node exists in PartValidation, then the NONE check is applied to all FILTER objects, regardless of any additional attributes found in the NONE node. 

 

Opened #449 for this.

Looks to me like you're using it right, and the contract window output doesn't look correct.  So yup, agree with that being a bug.

Link to comment
Share on other sites

Nightingale, is there any way from within a cfg file to disable a group of contracts like you can in the menu you added to the game?. I know it can be done with the stock contracts with  disabledContractType = WorldFirstContract for example.

 

For some reason I thought it was possible to start a contract with CONTRACT_TYPE:PooPoo and then in a seperate cfg file have the line disabledContractType = PooPoo but that doesn't work and only upsets CC. 

My old pack started CONTRACT_TYPE:NEEDS[SCANsat] which worked fine but now doesn't (not that it matters, I've deleted it). Obviously you've changed something as your excellent mod has grown so much.

Basically I was trying to allow my SCANSat pack to disable the built in SCANsat contracts.

 

EDIT:

 

While testing out VesselDestroyed it only seems to work if the vessel hits the terrain. If it explodes on re-entry or splashes down and is destroyed, the contract doesn't trigger accordingly. I've tried changing mustImpactTerrain between true and false and it made no difference in this instance.

Edited by DBT85
Link to comment
Share on other sites

4 hours ago, DBT85 said:

Nightingale, is there any way from within a cfg file to disable a group of contracts like you can in the menu you added to the game?. I know it can be done with the stock contracts with  disabledContractType = WorldFirstContract for example.

For some reason I thought it was possible to start a contract with CONTRACT_TYPE:PooPoo and then in a seperate cfg file have the line disabledContractType = PooPoo but that doesn't work and only upsets CC. 

My old pack started CONTRACT_TYPE:NEEDS[SCANsat] which worked fine but now doesn't (not that it matters, I've deleted it). Obviously you've changed something as your excellent mod has grown so much.

Basically I was trying to allow my SCANSat pack to disable the built in SCANsat contracts.

That is all Module Manager functionality.  You'd have to look there, but you can do something like -CONTRACT_TYPE:some_condition[some_stuff] to disable other config nodes (ie. other contract types).

4 hours ago, DBT85 said:

While testing out VesselDestroyed it only seems to work if the vessel hits the terrain. If it explodes on re-entry or splashes down and is destroyed, the contract doesn't trigger accordingly. I've tried changing mustImpactTerrain between true and false and it made no difference in this instance.

Raise an issue on GitHub please.

Link to comment
Share on other sites

1 hour ago, linuxgurugamer said:

Is there any way I can update the wiki with some of the answers you've given here?  I looked, but other than cloning the entire thing, it doesn't seem to be doable easily

Not easily, unfortunately.  I had to disable anonymous edits because github's web based editor screws up the folder structure, which I rely on for the page links to work properly.

You basically have to do a manual pull request:

  1. Clone Contract Configurator (this also clones the wiki)
  2. Set the real wiki as your upstream
  3. Make your changes, and check them in
  4. Raise an issue and say you want me to pull your changes - sending a link to your repository would be helpful, but I can probably figure it out without this.  (ie. request that I do a pull).
Link to comment
Share on other sites

23 minutes ago, nightingale said:

Not easily, unfortunately.  I had to disable anonymous edits because github's web based editor screws up the folder structure, which I rely on for the page links to work properly.

You basically have to do a manual pull request:

  1. Clone Contract Configurator (this also clones the wiki)
  2. Set the real wiki as your upstream
  3. Make your changes, and check them in
  4. Raise an issue and say you want me to pull your changes - sending a link to your repository would be helpful, but I can probably figure it out without this.  (ie. request that I do a pull).

How do I set the real wiki as the upstream?  When I cloned CC, and went into the wiki on my clone, there was nothing there.

From what I found online, the wiki is saved as a seperate repo

Edited by linuxgurugamer
Link to comment
Share on other sites

42 minutes ago, linuxgurugamer said:

How do I set the real wiki as the upstream?  When I cloned CC, and went into the wiki on my clone, there was nothing there.

From what I found online, the wiki is saved as a seperate repo

Correct. You would then do a git command to set mine as upstream (in phone, don't remember the exact command offhand). 

Link to comment
Share on other sites

20 hours ago, nightingale said:

That is all Module Manager functionality.  You'd have to look there, but you can do something like -CONTRACT_TYPE:some_condition[some_stuff] to disable other config nodes (ie. other contract types).

On the Wiki is says this about CONTRACT_GROUP

   // 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

Is that saying that a mod contract can be disabled?

 

Also from the WIKI

 

This verifies that the listed parts in the given quantities are present.

PARAMETER
{
    name = PartValidation
    type = PartValidation

    VALIDATE
    {
        part = fuelTank3-2
        minCount = 1
    }

    VALIDATE
    {
        part = largeSolarPanel
        minCount = 4
    }

    VALIDATE
    {
        part = cupola
        minCount = 2
        maxCount = 2
    }
}

When I put this into a contract (after struggling with my own) the contract wants NONE of these to appear, not all of them with these quantities which the WIKI suggests. When I launch a vessel with any of these on I get a red X, when they are not on I get a tick. In the contract text is says "none have type: PartNameGoesHere".

Edited by DBT85
Link to comment
Share on other sites

3 hours ago, DBT85 said:

On the Wiki is says this about CONTRACT_GROUP


   // 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

Is that saying that a mod contract can be disabled?

 

Also from the WIKI

 

This verifies that the listed parts in the given quantities are present.


PARAMETER
{
    name = PartValidation
    type = PartValidation

    VALIDATE
    {
        part = fuelTank3-2
        minCount = 1
    }

    VALIDATE
    {
        part = largeSolarPanel
        minCount = 4
    }

    VALIDATE
    {
        part = cupola
        minCount = 2
        maxCount = 2
    }
}

When I put this into a contract (after struggling with my own) the contract wants NONE of these to appear, not all of them with these quantities which the WIKI suggests. When I launch a vessel with any of these on I get a red X, when they are not on I get a tick. In the contract text is says "none have type: PartNameGoesHere".

Post the full contract, please

Link to comment
Share on other sites

5 hours ago, DBT85 said:

Is that saying that a mod contract can be disabled?

Mod that uses the stock contract system (like DMagic, Mission Controller 2, etc.).  For disabling other contract groups, use module manager (but do it with care - I don't want any contract pack wars started ;))

5 hours ago, DBT85 said:

 


PARAMETER
{
    name = PartValidation
    type = PartValidation

    VALIDATE
    {
        part = fuelTank3-2
        minCount = 1
    }

    VALIDATE
    {
        part = largeSolarPanel
        minCount = 4
    }

    VALIDATE
    {
        part = cupola
        minCount = 2
        maxCount = 2
    }
}

When I put this into a contract (after struggling with my own) the contract wants NONE of these to appear, not all of them with these quantities which the WIKI suggests. When I launch a vessel with any of these on I get a red X, when they are not on I get a tick. In the contract text is says "none have type: PartNameGoesHere".

There was a bug that inigma caught yesterday related to that.  It's fixed in the dev build, and will be released in 1.9.4 when it comes out.

Link to comment
Share on other sites

2 hours ago, linuxgurugamer said:

Post the full contract, please

CONTRACT_TYPE
{
    name = PartTestContract
    group = CCCP-SCANsat

    // Contract text
    title = Get into orbit with these parts on board
    description = get into orbit with these parts
    synopsis = get into orbit with these parts
	completedMessage = Mission complete! 

    targetBody = Kerbin
	agent = Research & Development Department
	
    // Contract rewards
    advanceFunds = 10000
	rewardScience = 10
	rewardReputation = 8
    rewardFunds = 20000

	// Can only be done once
	maxCompletions = 1
	maxSimultaneous = 1
	
	// Prestige level 2
	prestige = Significant
	
	// very likely to be chosen
	weight = 10.0
	
	PARAMETER
	{
		// Named for the Scottish physicist who predicted the existence of electromagnetic waves.
		name = Maxwell1
		type = VesselParameterGroup

        define = Maxwell I
		
		PARAMETER
		{
			name = ReachState
			type = ReachState
			targetBody = Kerbin
			situation = ORBITING
		}
		
		PARAMETER
		{
			name = PartValidation
			type = PartValidation

			VALIDATE
			{
				part = fuelTank3-2
				minCount = 1
			}

			VALIDATE
			{
				part = largeSolarPanel
				minCount = 4
			}

			VALIDATE
			{
				part = cupola
				minCount = 2
				maxCount = 2
			}
		}
	}
}

To my mind it should want all of those things, yet it specifically wants none of them.

Link to comment
Share on other sites

45 minutes ago, DBT85 said:

CONTRACT_TYPE
{
    name = PartTestContract
    group = CCCP-SCANsat

    // Contract text
    title = Get into orbit with these parts on board
    description = get into orbit with these parts
    synopsis = get into orbit with these parts
	completedMessage = Mission complete! 

    targetBody = Kerbin
	agent = Research & Development Department
	
    // Contract rewards
    advanceFunds = 10000
	rewardScience = 10
	rewardReputation = 8
    rewardFunds = 20000

	// Can only be done once
	maxCompletions = 1
	maxSimultaneous = 1
	
	// Prestige level 2
	prestige = Significant
	
	// very likely to be chosen
	weight = 10.0
	
	PARAMETER
	{
		// Named for the Scottish physicist who predicted the existence of electromagnetic waves.
		name = Maxwell1
		type = VesselParameterGroup

        define = Maxwell I
		
		PARAMETER
		{
			name = ReachState
			type = ReachState
			targetBody = Kerbin
			situation = ORBITING
		}
		
		PARAMETER
		{
			name = PartValidation
			type = PartValidation

			VALIDATE
			{
				part = fuelTank3-2
				minCount = 1
			}

			VALIDATE
			{
				part = largeSolarPanel
				minCount = 4
			}

			VALIDATE
			{
				part = cupola
				minCount = 2
				maxCount = 2
			}
		}
	}
}

To my mind it should want all of those things, yet it specifically wants none of them.

Try the following:

1.  Move the PartValidation BEFORE the ReachState
2.  Add the following:   completeInSequence  = true to all the parameter groups

Link to comment
Share on other sites

Having a pretty nasty issue with Contract Configurator at the moment, I haven't seen this issue discussed in about 50 pages, so I don't know if it's been reported yet.

Without Contract Configurator installed and stock install, I'm getting a steady 150-200 FPS on the launchpad with a 2-part ship.

With Contract Configurator installed and otherwise stock install, I'm getting a stuttering 30-60 FPS on the launchpad with a 2-part ship.

 

Removing Contract Configurator and even installing several dozen part/texture heavy mods reduces my max FPS with the same ship to 130-150. This wouldn't be an issue if Unity's garbage collection didn't cause mini-spikes every 1-2 seconds, but the constant jerkiness makes it mostly unplayable once Contract Configurator is installed.

I'd be happy to provide an output log or CC's debug output if necessary.


EDIT: With even more testing, I've noticed that it seems to go away after it completes the background load of Laythe biome data. However, with mods installed (including Kopernicus and New Horizons), this lag does not seem to go away and it never starts or completes the background load. Nevermind, I timed it, it takes almost two full minutes to complete a background load of Tidus' biome data and then the FPS will boost to approximately 90-100.

Edited by IggyHitokage
Link to comment
Share on other sites

3 hours ago, linuxgurugamer said:

Try the following:

1.  Move the PartValidation BEFORE the ReachState
2.  Add the following:   completeInSequence  = true to all the parameter groups

Don't think that should be needed since there is a VesselParameterGroup and I don't think order needs to matter for this one. See my post above - there's a bug and you need the dev version to get sane results. 

Link to comment
Share on other sites

EDIT: With even more testing, I've noticed that it seems to go away after it completes the background load of Laythe biome data. However, with mods installed (including Kopernicus and New Horizons), this lag does not seem to go away and it never starts or completes the background load. Nevermind, I timed it, it takes almost two full minutes to complete a background load of Tidus' biome data and then the FPS will boost to approximately 90-100.

It's a once per save thing, so you should be okay now. The idea was to limit the duration it works on each tick to keep the FPS from dropping too low (I can't remember what I was aiming for, but 30-60 sounds right).  If you were way up in the 200 FPS region, then I could see that being very noticeable. 

Raise a GitHub issue and I'll look at some changes:

1. Half the duration per tick so that it stays above 60 FPS. 

2. Make it global, so the data only gets calculated once per install. This will also fix the issue that if you change scenes and it wasn't done it'll start the celestial body over. 

I'm also hoping I can just dump it in a thread in 1.1.

Link to comment
Share on other sites

On 1/17/2016 at 1:39 PM, nightingale said:

It's a once per save thing, so you should be okay now. The idea was to limit the duration it works on each tick to keep the FPS from dropping too low (I can't remember what I was aiming for, but 30-60 sounds right).  If you were way up in the 200 FPS region, then I could see that being very noticeable.

Ah, well that makes sense. I just never gave it a chance with so many mods installed. Just a suggestion, but would a small pop-up when loading in a vessel for the first time work? Obviously not for 1.0.5, but in the overhaul that everyone has to do for 1.1. Otherwise, not an issue now that I know about it!

Link to comment
Share on other sites

8 minutes ago, IggyHitokage said:

Ah, well that makes sense. I just never gave it a chance with so many mods installed. Just a suggestion, but would a small pop-up when loading in a vessel for the first time work? Obviously not for 1.0.5, but in the overhaul that everyone has to do for 1.1. Otherwise, not an issue now that I know about it!

If I'm able to make it threaded in 1.1, then it won't even be noticeable anymore (at least, in theory).

Link to comment
Share on other sites

14 minutes ago, smjjames said:

Is there a way to get the 'recover asset' contracts to not autofail when I put the part into a KIS container?

No idea (since that's stock and not Contract Configurator). I'd I had to guess I'd say no as it is probably taking the part based on its uid. 

Link to comment
Share on other sites

@nightingale I was thinking of ways to get around the Squad EngineType limitation.

Essentially for my airspeed contracts I need a way to limit a craft to only have engines that use LiquidFuel and IntakeAir. I need a check that does not pass on a craft that has an engine that uses SolidFuel or Oxidizer.

So.. what about adding PROPELLANT to the PartValidation parameter MODULE node tree? Enhancement?

 

PARAMETER
{
    name = PartValidation
    type = PartValidation
    
    NONE
    {
        MODULE
        {
            PROPELLANT
            {
                name = Oxidizer
            }
        }
    }
}

 

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...