Jump to content

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


nightingale

Recommended Posts

Four things - First , re: the pre-release , Outstanding!
Re-working my contract packs to be ready for the release. Excellent revisions!

Second, a question/request on requirements.
I was working on a science based requirement for a series of contracts and it took me a while to realize that the "type = Science" requirement is for current science points.
Is it possible to use this, or perhaps add a new requirement in some future release, to have a requirement functionality of "Player has earned X number of science points in total, including unspent AND spent points" ?

Third, a request.
The behavior of snapping back to the "all" tab after declining a contract is incredibly tedious. Is it possible to stay on the "available" tab after declining a contract?

Fourth, a question/request: RESOLVED
I may have missed if this is already in the pre-release, but if not it would be great to be able to define inside CONTRACT_GROUP{} what icon/logo to use. In my testing, it's using a logo from one of the agents used by contracts in the group - which is fine - but just thinking ahead.
Found the answer myself - you can define "agent = " inside of CONTRACT_GROUP, just like for a regular contract.

Edited by tjsnh
Link to comment
Share on other sites

On 7/9/2016 at 4:36 PM, nightingale said:

If anyone has any art skills and would like to help out with the agent logos for stock contracts, please see the thread I raised:

 

FWIW, if these were defined in a config file (and thus, modulemanager patchable) that would be an absolutely amazing capability for mod makers.
(The ability to replace the default contract-type-category logos with nation-specific ones in my two career mode conversion mods would be incredible)

Edited by tjsnh
Link to comment
Share on other sites

Dont know if it's a known issue, but the "checkType" argument is returning errors. It doesn't recognize either "Manned" or "Unmanned" as valid values. Example:

 

REQUIREMENT
{
    name = ReturnFromFlyBy
    type = ReturnFromFlyBy
    checkType = Manned
    targetBody = Minmus
}

Causes the contract to not load, along with a bunch of error code pointing to checkType

Link to comment
Share on other sites

6 hours ago, hargn said:

I mean the instantaneous resource consumption, the derivative of the resource quantity by seconds.
For a contract, a want to know if the vessel consumes power or if the power reserve is growing due to solar panels.

Else, I'm looking for a function to get the current vessel instance. Does CurrentVessel().ResourceQuantity(ElectricCharge) work to get the resource of the current vessel ?

There is no CurrentVessel() function.  The expression are only executed at time of contract offer (which means that the ResourceQuantity method probably isn't what you want here).

Are you looking for this as part of a parameter (eg. to meet the contract, have store energy growing)?  Or as part of an expression to select vessels (select vessels that are losing power)?

4 hours ago, tjsnh said:

I was working on a science based requirement for a series of contracts and it took me a while to realize that the "type = Science" requirement is for current science points.
Is it possible to use this, or perhaps add a new requirement in some future release, to have a requirement functionality of "Player has earned X number of science points in total, including unspent AND spent points" ?

Could be done, would require summing up the all the techs that have been unlocked.  It also wouldn't take into account any science points lost/spent through strategies or other means.  If you're okay with those limitation, raise an enhancement request.

Quote

Third, a request.
The behavior of snapping back to the "all" tab after declining a contract is incredibly tedious. Is it possible to stay on the "available" tab after declining a contract?

Declines are barely functional in the pre-release.  Rest assured it won't do that in the full release.

4 hours ago, tjsnh said:

FWIW, if these were defined in a config file (and thus, modulemanager patchable) that would be an absolutely amazing capability for mod makers.
(The ability to replace the default contract-type-category logos with nation-specific ones in my two career mode conversion mods would be incredible)

The contract type => agent mapping is currently hardcoded, but probably makes sense to expose in a config file.  Even if I don't do that, the agent files are just config files, and can be MM'd.

2 hours ago, tjsnh said:

Dont know if it's a known issue, but the "checkType" argument is returning errors. It doesn't recognize either "Manned" or "Unmanned" as valid values. Example:


REQUIREMENT
{
    name = ReturnFromFlyBy
    type = ReturnFromFlyBy
    checkType = Manned
    targetBody = Minmus
}

Causes the contract to not load, along with a bunch of error code pointing to checkType

The code looks good at a glance, but I have limited ability to test it myself at the moment.  Can you post a log file?

Edited by nightingale
Link to comment
Share on other sites

3 hours ago, nightingale said:

There is no CurrentVessel() function.  The expression are only executed at time of contract offer (which means that the ResourceQuantity method probably isn't what you want here).

Are you looking for this as part of a parameter (eg. to meet the contract, have store energy growing)?  Or as part of an expression to select vessels (select vessels that are losing power)?

I want this as a parameter to validate the contract : the vessel must generate power (storing energy with its solar panels) to meet the contract.

Link to comment
Share on other sites

7 hours ago, hargn said:

I want this as a parameter to validate the contract : the vessel must generate power (storing energy with its solar panels) to meet the contract.

I can probably put something together, raise an enhancement request on GitHub for me.  I'll more than likely have to take the stored energy value and average out over several frames, and possibly even remove spikes (so that docking doesn't trigger it).

9 minutes ago, Sudragon said:

Is anyone else having problems with contracts defining 'orbit'? Everything i send up goes up to a stable 100km orbit but the orbit check box isn't ticked.

No issues that I've heard of recently.  Can you provide the config that you are using?  Maybe a KSP.log file in case there some sort of exception occurring?

Link to comment
Share on other sites

3 minutes ago, nightingale said:

I can probably put something together, raise an enhancement request on GitHub for me.  I'll more than likely have to take the stored energy value and average out over several frames, and possibly even remove spikes (so that docking doesn't trigger it).

No issues that I've heard of recently.  Can you provide the config that you are using?  Maybe a KSP.log file in case there some sort of exception occurring?

I'll run a mission and drop the log here.

Link to comment
Share on other sites

 

Just now, pap1723 said:

I guess I should have asked if it is a contract that you created, or a different one that you downloaded.

ah. hm. might be one of the contract packs. possibly the advanced tourism pack.

Link to comment
Share on other sites

I need help with a contract please. For some reason, I cannot get this contract to work right. The logic looks solid, but it does not complete the right way...What I need to have happen is that the player launches Gemini 7 into Orbit. Once it reaches orbit, the timer starts to tick down on the 14 days. Then, the player launches Gemini 6 and Rendezvous with Gemini 7. When I launch this to test, the first ship launched gets declared as Gemini-6 and then I cannot complete any of the rest of the parameters.

DATA
	{
		type = double
		dayLength = @targetBody.RotationalPeriod()
		fourteenDays = @dayLength * 14
	}
	
	PARAMETER
	{
		name = Gemini-7
		type = VesselParameterGroup
		define = Gemini-7
		title = Gemini 7
		disableOnStateChange = false
		
		PARAMETER
        {
            name = IsNotGemini6
            type = IsNotVessel
            vessel = Gemini-6
        }
		PARAMETER
		{
			name = NewVessel
			type = NewVessel
			hidden = true
		}
		PARAMETER
		{
			name = HasCrew
			type = HasCrew
			minCrew = 2
			maxCrew = 2
			title = Have 2 crewmembers on board
			hideChildren = true
		}
		PARAMETER
		{
			name = Gemini7Orbit
			type = Orbit
			minAltitude = @targetBody.AtmosphereAltitude()
			title = Orbit @targetBody
			disableOnStateChange = true
			hideChildren = true
		}
		PARAMETER
		{
			name = Gemini7Duration
			type = Duration
			duration = @/fourteenDays
			preWaitText = Waiting to reach orbit
			waitingText = Orbiting for @duration
			completionText = Orbits Complete! You may fire retros when ready
			disableOnStateChange = true
		}
		PARAMETER
		{
			name = ReturnHome
			type = ReturnHome
			targetBody = HomeWorld()
			title = Return Home Safely
			hideChildren = true
			disableOnStateChange = true
		}
		
	}
	PARAMETER
	{
		name = Gemini-6
		type = VesselParameterGroup
		define = Gemini-6
		title = Gemini 6
		disableOnStateChange = false
		
		PARAMETER
        {
            name = IsNotGemini7
            type = IsNotVessel
            vessel = Gemini-7
        }		
		PARAMETER
		{
			name = NewVessel
			type = NewVessel
			hidden = true
		}
		PARAMETER
		{
			name = HasCrew
			type = HasCrew
			minCrew = 2
			maxCrew = 2
			title = Have 2 crewmembers on board
			hideChildren = true
		}
		PARAMETER
		{
			name = ReturnHome
			type = ReturnHome
			targetBody = HomeWorld()
			title = Return Home Safely
			hideChildren = true
			disableOnStateChange = true
		}
	}
	PARAMETER
	{
		name = Rendezvous
		type = Rendezvous
		distance = 100
		title = Rendezvous Gemini 6A with Gemini 7
		hideChildren = true
		disableOnStateChange = true
	}	
}

 

Link to comment
Share on other sites

@pap1723 - You probably want to do a completeInSequence=true on the Gemini-6 parameter (so it can't be completed until Gemini 7 has been defined).  Also, the return home in Gemini 6 doesn't really make sense (since it'll get met immediately on the launchpad).

Link to comment
Share on other sites

6 minutes ago, nightingale said:

@pap1723 - You probably want to do a completeInSequence=true on the Gemini-6 parameter (so it can't be completed until Gemini 7 has been defined).  Also, the return home in Gemini 6 doesn't really make sense (since it'll get met immediately on the launchpad).

Thanks, as usual!

Link to comment
Share on other sites

Greetings! I'm building a repeatable contract for RP-0, and I'm struggling to find a way to select a random (already unlocked) experiment to include as a requirement. Do the AllExperiments() expression list only the unlocked experiments, or all of them?

Thanks in advance!

Link to comment
Share on other sites

1 hour ago, leudaimon said:

Greetings! I'm building a repeatable contract for RP-0, and I'm struggling to find a way to select a random (already unlocked) experiment to include as a requirement. Do the AllExperiments() expression list only the unlocked experiments, or all of them?

Thanks in advance!

Looks like there was a function missing in the wiki - AvailableExperiments is the one you want (I just added it to the doc).  AllExperiments includes ones that are tech-locked.  Note that the only signature of AvailableExperiments requires the celestial body as a parameter (I think that was mainly for performance reasons).  Take a look at the Experiment contract from Field Research - it may be very close to what you're trying to achieve (and if not, one of the other Field Research contracts may be close).

Link to comment
Share on other sites

Thanks @nightingale! I've been looking at these contracts there to learn some of the syntax. I had seen this one, but thought the AvailableExperiment() had come from somewhere else, as I hadn't found it in the documentation. I'll try to use this. Once I get these corrections and the at least a large amount of the set of uncrewed exploration contracts I'm making for RP-0, would you be willing to help me with debugging some of them?

Link to comment
Share on other sites

1 hour ago, leudaimon said:

Thanks @nightingale! I've been looking at these contracts there to learn some of the syntax. I had seen this one, but thought the AvailableExperiment() had come from somewhere else, as I hadn't found it in the documentation. I'll try to use this. Once I get these corrections and the at least a large amount of the set of uncrewed exploration contracts I'm making for RP-0, would you be willing to help me with debugging some of them?

Yup, if you think you've found an issue raise it on GitHub, otherwise for general support you can ask in the thread here.  When I'm in town I'm usually idling in #kspmodding too (currently out, will be flying home Friday) .

Link to comment
Share on other sites

Hello ! I had an "unexpected exception" with Contract configurator that came twice (not the same one).

I don't see anything that have changed, but i might have missed something.

It happend after I installed EVE / Scatterer / RVE manually.

here is the log when I first loaded the save :

Exception occured while loading contract parameter 'ReachState' in contract 'RP0.recordUncrewedAlt':
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: 'Earth' is not a valid CelestialBody.
  at ContractConfigurator.ConfigNodeUtil.ParseCelestialBodyValue (System.String celestialName) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.ConfigNodeUtil.ParseSingleValue[CelestialBody] (System.String key, System.String stringValue, Boolean allowExpression) [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.ConfigNodeUtil.ParseValue[List`1] (.ConfigNode configNode, System.String key, Boolean allowExpression) [0x00000] in <filename unknown>:0 

And here is the one when I entered the VAB

Exception occured while loading contract parameter 'CollectScience' in contract 'RP0.first_OrbitUncrewed':
System.ArgumentException: Missing required value 'recoveryMethod'.
  at ContractConfigurator.ConfigNodeUtil.ParseValue[ScienceRecoveryMethod] (.ConfigNode configNode, System.String key, Boolean allowExpression) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.Parameters.CollectScienceCustom.OnParameterLoad (.ConfigNode node) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.Parameters.ContractConfiguratorParameter.OnLoad (.ConfigNode node) [0x00000] in <filename unknown>:0 

If I have more errors, I will edit this post.
Thanks !

Link to comment
Share on other sites

2 minutes ago, Buisson said:

Hello ! I had an "unexpected exception" with Contract configurator that came twice (not the same one).

I don't see anything that have changed, but i might have missed something.

It happend after I installed EVE / Scatterer / RVE manually.

here is the log when I first loaded the save :


Exception occured while loading contract parameter 'ReachState' in contract 'RP0.recordUncrewedAlt':
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: 'Earth' is not a valid CelestialBody.
  at ContractConfigurator.ConfigNodeUtil.ParseCelestialBodyValue (System.String celestialName) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.ConfigNodeUtil.ParseSingleValue[CelestialBody] (System.String key, System.String stringValue, Boolean allowExpression) [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.ConfigNodeUtil.ParseValue[List`1] (.ConfigNode configNode, System.String key, Boolean allowExpression) [0x00000] in <filename unknown>:0 

And here is the one when I entered the VAB


Exception occured while loading contract parameter 'CollectScience' in contract 'RP0.first_OrbitUncrewed':
System.ArgumentException: Missing required value 'recoveryMethod'.
  at ContractConfigurator.ConfigNodeUtil.ParseValue[ScienceRecoveryMethod] (.ConfigNode configNode, System.String key, Boolean allowExpression) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.Parameters.CollectScienceCustom.OnParameterLoad (.ConfigNode node) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.Parameters.ContractConfiguratorParameter.OnLoad (.ConfigNode node) [0x00000] in <filename unknown>:0 

If I have more errors, I will edit this post.
Thanks !

The RP-0 contract is not finding the planet Earth. Did you install RSS and Kopernicus correctly?

Link to comment
Share on other sites

@Buisson - At one point I thought there was some Kopernicus/Scatterer incompatibility that could cause this.  The first one is because Scatterer (or something) changed Earth back to Kerbin, then second is the contracts getting mangled due to the first error.

You may want to confirm on the RP-0 thread.

Link to comment
Share on other sites

Thank you for the quick reply.

I think it is Scatterer because I just installed it, and everything was OK before. I will try to see if I can do someting.

I installed Scatterer, EVE and RVE in an unfashioned way, meaning I'm playing 1.1.3 and found a workaround on the RVE (which is 1.0.5) forums, but apparently it messes things up :P

Link to comment
Share on other sites

Ok so I modified a config file in Scatterer and now all goes well :)

In the PlanetList.cfg, I had to write this :        transformName = Kerbin 

instead of         transformName = Earth

 

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