Jump to content

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


nightingale

Recommended Posts

11 hours ago, nightingale said:

@hargn - You managed to find not one, but two bugs/limitations in the resource parser.  I've fixed both for the next release (I only added - and _ to the list of value resource characters, so if there's any other ones you can always fall back on to the string method now).

 

I did a 'grep "name = " CommonResources.cfg' there : https://github.com/BobPalmer/CommunityResourcePack/blob/master/FOR_RELEASE/GameData/CommunityResourcePack/CommonResources.cfg and I found no other characters.

So it's good for me (and for most of contracts writers I believe).
Thanks also for the better exception message.

Edited by hargn
Link to comment
Share on other sites

Exception occured while attempt to generate contract of type 'STGUnmannedMissions.Kolniya Orbital Satellite':
System.ArgumentException: Cannot use a Kolniya orbit with the Mun.
  at ContractConfigurator.Behaviour.OrbitGenerator.ValidateOrbitType (ContractConfigurator.Behaviour.OrbitData obData, ContractConfigurator.Behaviour.OrbitGeneratorFactory factory) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.Behaviour.OrbitGenerator..ctor (ContractConfigurator.Behaviour.OrbitGenerator orig, Contracts.Contract contract) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.Behaviour.OrbitGeneratorFactory.Generate (ContractConfigurator.ConfiguredContract contract) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.BehaviourFactory.GenerateBehaviours (ContractConfigurator.ConfiguredContract contract, System.Collections.Generic.List`1 behaviourNodes) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.ContractType.GenerateBehaviours (ContractConfigurator.ConfiguredContract contract) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.ConfiguredContract.Initialize (ContractConfigurator.ContractType contractType) [0x00000] in <filename unknown>:0 

Was told to post this

Link to comment
Share on other sites

29 minutes ago, harleyquinneth said:

Exception occured while attempt to generate contract of type 'STGUnmannedMissions.Kolniya Orbital Satellite':
System.ArgumentException: Cannot use a Kolniya orbit with the Mun.
  at ContractConfigurator.Behaviour.OrbitGenerator.ValidateOrbitType (ContractConfigurator.Behaviour.OrbitData obData, ContractConfigurator.Behaviour.OrbitGeneratorFactory factory) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.Behaviour.OrbitGenerator..ctor (ContractConfigurator.Behaviour.OrbitGenerator orig, Contracts.Contract contract) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.Behaviour.OrbitGeneratorFactory.Generate (ContractConfigurator.ConfiguredContract contract) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.BehaviourFactory.GenerateBehaviours (ContractConfigurator.ConfiguredContract contract, System.Collections.Generic.List`1 behaviourNodes) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.ContractType.GenerateBehaviours (ContractConfigurator.ConfiguredContract contract) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.ConfiguredContract.Initialize (ContractConfigurator.ContractType contractType) [0x00000] in <filename unknown>:0 

Was told to post this

Update unmanned Missions.

Link to comment
Share on other sites

Exception occured while loading contract 'ScanSatOfficial.SCAN_LoRes':
System.ArgumentException: 'Mun' 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 ContractConfigurator.ConfigNodeUtil.ParseValue[CelestialBody] (.ConfigNode configNode, System.String key, Boolean allowExpression) [0x00000] in <filename unknown>:0
  at ContractConfigurator.ConfigNodeUtil.ParseValue[CelestialBody] (.ConfigNode configNode, System.String key, .CelestialBody defaultValue) [0x00000] in <filename unknown>:0
  at ContractConfigurator.ConfiguredContract.OnLoad (.ConfigNode node) [0x00000] in <filename unknown>:0

No changes to any of my mod lineups or what not... but the Mun (and Minmus... and Moho) all vanished between closing out of the game and coming back in a few hours later.

Link to comment
Share on other sites

1 hour ago, Shadriss said:

Exception occured while loading contract 'ScanSatOfficial.SCAN_LoRes':
System.ArgumentException: 'Mun' 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 ContractConfigurator.ConfigNodeUtil.ParseValue[CelestialBody] (.ConfigNode configNode, System.String key, Boolean allowExpression) [0x00000] in <filename unknown>:0
  at ContractConfigurator.ConfigNodeUtil.ParseValue[CelestialBody] (.ConfigNode configNode, System.String key, .CelestialBody defaultValue) [0x00000] in <filename unknown>:0
  at ContractConfigurator.ConfiguredContract.OnLoad (.ConfigNode node) [0x00000] in <filename unknown>:0

No changes to any of my mod lineups or what not... but the Mun (and Minmus... and Moho) all vanished between closing out of the game and coming back in a few hours later.

Sounds like this is the symptom of a much bigger problem.  I can't say anything beyond that without a KSP.log file.

Link to comment
Share on other sites

Getting these exceptions, first after resuming save and second after return to main menu:

Spoiler

Exception occured while loading contract parameter 'SCANsatCoverage' in contract 'ScanSatOfficial.SCAN_LoRes':
System.ArgumentException: Missing required value 'targetBody'.
  at ContractConfigurator.ConfigNodeUtil.ParseValue[CelestialBody] (.ConfigNode configNode, System.String key, Boolean allowExpression) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.SCANsatCoverage.OnParameterLoad (.ConfigNode node) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.Parameters.ContractConfiguratorParameter.OnLoad (.ConfigNode node) [0x00000] in <filename unknown>:0 

 

Exception occured while saving contract parameter 'ReachState' in contract 'RP0.recordCrewedCount':
System.NullReferenceException: Object reference not set to an instance of an object
  at ContractConfigurator.Parameters.ReachState.OnParameterSave (.ConfigNode node) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.Parameters.ContractConfiguratorParameter.OnSave (.ConfigNode node) [0x00000] in <filename unknown>:0 

Any ideas?

KSP.log file. This is a RP-0 install. Thanks.

EDIT: Digging down, it seems like something has broken in my persistent.sfs file. Is there anything I can change/delete to get rid of the issue? I'm not particularly concerned about saving the archive of contracts I've done, I just want to get on with my career.

EDIT2: This is a pretty nice exception system you have going, but it would be nice if they would point to the line number of the save file that it's having an issue reading from, it would make pinpointing the problematic area much easier. Just something to consider.

EDIT3: I've fixed the issue by finding the offending contract (searched 'SCAN_LoRes' in Notepad++) and deleting it entirely (everything within the brackets noted below)

CONTRACT COMPLETED
{
//Stuff
}

 

Edited by the_Demongod
Link to comment
Share on other sites

Looks like this may have been posted a few times already, but in case it wasn't, I'm getting this.... all mods updated to latest public release as of this post. Unmanned Missions is 0.3.24.

Spoiler

Exception occured while attempt to generate contract of type 'STGUnmannedMissions.Kolniya Orbital Satellite':
System.ArgumentException: Cannot use a Kolniya orbit with the Mun.
  at ContractConfigurator.Behaviour.OrbitGenerator.ValidateOrbitType (ContractConfigurator.Behaviour.OrbitData obData, ContractConfigurator.Behaviour.OrbitGeneratorFactory factory) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.Behaviour.OrbitGenerator..ctor (ContractConfigurator.Behaviour.OrbitGenerator orig, Contracts.Contract contract) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.Behaviour.OrbitGeneratorFactory.Generate (ContractConfigurator.ConfiguredContract contract) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.BehaviourFactory.GenerateBehaviours (ContractConfigurator.ConfiguredContract contract, System.Collections.Generic.List`1 behaviourNodes) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.ContractType.GenerateBehaviours (ContractConfigurator.ConfiguredContract contract) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.ConfiguredContract.Initialize (ContractConfigurator.ContractType contractType) [0x00000] in <filename unknown>:0 

 

Link to comment
Share on other sites

37 minutes ago, charliepryor said:

Looks like this may have been posted a few times already, but in case it wasn't, I'm getting this.... all mods updated to latest public release as of this post. Unmanned Missions is 0.3.24.

  Reveal hidden contents

Exception occured while attempt to generate contract of type 'STGUnmannedMissions.Kolniya Orbital Satellite':
System.ArgumentException: Cannot use a Kolniya orbit with the Mun.
  at ContractConfigurator.Behaviour.OrbitGenerator.ValidateOrbitType (ContractConfigurator.Behaviour.OrbitData obData, ContractConfigurator.Behaviour.OrbitGeneratorFactory factory) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.Behaviour.OrbitGenerator..ctor (ContractConfigurator.Behaviour.OrbitGenerator orig, Contracts.Contract contract) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.Behaviour.OrbitGeneratorFactory.Generate (ContractConfigurator.ConfiguredContract contract) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.BehaviourFactory.GenerateBehaviours (ContractConfigurator.ConfiguredContract contract, System.Collections.Generic.List`1 behaviourNodes) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.ContractType.GenerateBehaviours (ContractConfigurator.ConfiguredContract contract) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.ConfiguredContract.Initialize (ContractConfigurator.ContractType contractType) [0x00000] in <filename unknown>:0 

 

You'll have to post that in the unmanned mission thread in that case.

12 hours ago, the_Demongod said:

EDIT2: This is a pretty nice exception system you have going, but it would be nice if they would point to the line number of the save file that it's having an issue reading from, it would make pinpointing the problematic area much easier. Just something to consider.

That's a nice idea, but not technically possible (KSP doesn't preserve line number information in the config nodes).

Link to comment
Share on other sites

1 hour ago, nightingale said:

You'll have to post that in the unmanned mission thread in that case.

That's a nice idea, but not technically possible (KSP doesn't preserve line number information in the config nodes).

You need to update the Unmanned Missions

@nightingale If you get any more of those, please tell them that the UnmannedMission contract pack was updated, should be at version 0.3.24.  This was updated 8/12

I think I need to read first and then post.

I'll work on it this evening

@nightingale

It seems that this is the one causing the error, but why?  It should only allow planets which can have the orbit:

KolniyaMissionPlanet = Prestige() == Trivial ? @/easyPlanets.Where(cb => cb.CanHaveKolniyaOrbit()).Random() : Prestige() == Significant ? @/mediumPlanets.Where(cb => cb.CanHaveKolniyaOrbit()).Random() : @/hardPlanets.Where(cb => cb.CanHaveKolniyaOrbit()).Random()

 

Edited by linuxgurugamer
Link to comment
Share on other sites

4 hours ago, linuxgurugamer said:

You need to update the Unmanned Missions

@nightingale If you get any more of those, please tell them that the UnmannedMission contract pack was updated, should be at version 0.3.24.  This was updated 8/12

I think I need to read first and then post.

I'll work on it this evening

@nightingale

It seems that this is the one causing the error, but why?  It should only allow planets which can have the orbit:


KolniyaMissionPlanet = Prestige() == Trivial ? @/easyPlanets.Where(cb => cb.CanHaveKolniyaOrbit()).Random() : Prestige() == Significant ? @/mediumPlanets.Where(cb => cb.CanHaveKolniyaOrbit()).Random() : @/hardPlanets.Where(cb => cb.CanHaveKolniyaOrbit()).Random()

 

Took a quick peek - looks like your Kolniya contract is pulling from the wrong variable:

 	targetBody = @STGUnmannedMissions:UnmannedMissionPlanet

 

Link to comment
Share on other sites

17 minutes ago, nightingale said:

Took a quick peek - looks like your Kolniya contract is pulling from the wrong variable:


 	targetBody = @STGUnmannedMissions:UnmannedMissionPlanet

 

Grrrrrrr.

Thank you for looking, I'll get this updated in a bit

 

Edit:  Same problem with the Tundra sat contract, will be fixed as well

Edited by linuxgurugamer
Link to comment
Share on other sites

Hello,

I'm experiencing an issue while creating a new RP-0 carreer with my Groups.cfg modified to include (my previous) DATA node containing the monoPropellant list. I've just added a DATA node into the main RP-0 CONTRACT_GROUP, and as a result, no contracts are loading when a create a new carreer.
I know that there was a very similar issue that has been fixed into the last CC version 1.17.0 (that is the version I use), but it could be not completely resolved.
The DATA node I've been added is

DATA
{
	type = List<Resource>
	monoPropellant = [ Hydrazine, Helium, UH25, Aerozine50, HTP, Nitrogen, Aniline, IWFNA, Nitrogen, NitrousOxyde ]
}

If you want to see the two Groups.cfg (stock RP-0 and mine), as well as the logs for the working one and mine that is not working : https://drive.google.com/file/d/0B2RjcW4lKwZLWXlqN0FHelZQekU/view?usp=sharing
I've already make a diff between the two logs but I saw no differences for the contracts loading part.

Thanks for your help.

Edited by hargn
Link to comment
Share on other sites

4 hours ago, hargn said:

Hello,

I'm experiencing an issue while creating a new RP-0 carreer with my Groups.cfg modified to include (my previous) DATA node containing the monoPropellant list. I've just added a DATA node into the main RP-0 CONTRACT_GROUP, and as a result, no contracts are loading when a create a new carreer.
I know that there was a very similar issue that has been fixed into the last CC version 1.17.0 (that is the version I use), but it could be not completely resolved.
The DATA node I've been added is


DATA
{
	type = List<Resource>
	monoPropellant = [ Hydrazine, Helium, UH25, Aerozine50, HTP, Nitrogen, Aniline, IWFNA, Nitrogen, NitrousOxyde ]
}

If you want to see the two Groups.cfg (stock RP-0 and mine), as well as the logs for the working one and mine that is not working : https://drive.google.com/file/d/0B2RjcW4lKwZLWXlqN0FHelZQekU/view?usp=sharing
I've already make a diff between the two logs but I saw no differences for the contracts loading part.

Thanks for your help.

In the DATA node you have to have a required = false entry. 

Link to comment
Share on other sites

@pap1723

You mean requiredValue = false ? There are no required field described in the documentation.

It's weird if that allows the contracts to work, I think the value of this list is not null, so the contracts should be generated, no?

Edited by hargn
Link to comment
Share on other sites

9 minutes ago, hargn said:

@pap1723

You mean requiredValue = false ? There are no required field described in the documentation.

It's weird if that allows the contracts to work, I think the value of this list is not null, so the contracts should be generated, no?

Yes, that is the right syntax. Sorry I was on mobile and didn't have it in front of me.

It has something to do with the new way the contracts are generated since 1.15. But trust me, I was pulling my hair out because my contracts wouldn't generate. Then I figured out it needed to be a false requirement.

Link to comment
Share on other sites

Just now, pap1723 said:

Yes, that is the right syntax. Sorry I was on mobile and didn't have it in front of me.

It has something to do with the new way the contracts are generated since 1.15. But trust me, I was pulling my hair out because my contracts wouldn't generate. Then I figured out it needed to be a false requirement.

It's working very well with your tip, I agree. Thanks.

But maybe @nightingale should explain why the contracts was not generated without this field.
The documentation explains that it should prevent the contract generation if the value of the data is null, that should not be the case in my example.

Link to comment
Share on other sites

1 hour ago, hargn said:

It's working very well with your tip, I agree. Thanks.

But maybe @nightingale should explain why the contracts was not generated without this field.
The documentation explains that it should prevent the contract generation if the value of the data is null, that should not be the case in my example.

You shouldn't need to set requiredValue = false, since the value is a constant (and is always there).  I tried it out with a basic test, and it worked for me.  Can you generate another log with debug turned on?  Please add the following verbose logging (you'll need to download the dev dll for verbose logging to show up).

CC_DEBUGGING
{
	// Possible LogLevel: VERBOSE, DEBUG, INFO, WARNING, ERROR
	logLevel = DEBUG
	
	ADD_LOGLEVEL_EXCEPTION
	{
		// Type name
		type = ContractPreLoader
		// Possible LogLevel: VERBOSE, DEBUG, INFO, WARNING, ERROR
		logLevel = VERBOSE
	}
	
	ADD_LOGLEVEL_EXCEPTION
	{
		// Type name
		type = ContractType
		// Possible LogLevel: VERBOSE, DEBUG, INFO, WARNING, ERROR
		logLevel = VERBOSE
	}
}

 

Link to comment
Share on other sites

Here is the log file : https://drive.google.com/file/d/0B2RjcW4lKwZLRU9fTV8yS0lyUjg/view?usp=sharing
First, the resource NitrousOxyde didn't exist, so the monoPropelant data couldn't be properly generated.
I've fixed that (the real name was NitrousOxide), but the contract are still not generated.
The log shows that for each contract that belongs in an under-group of the CONTRACT_GROUP RP0 the data is not found.

For example, the contract recordCrewedAlt belongs to the group Records, that is defined inside the group RP0.
Then the log shows that the data Records:monoPropellant doesn't exist (even if the contract doesn't use it) and then the contract is not generated.

I know that you won't implement some sort of inheritance of the data between contract groups, @nightingale, but this issue may force you to do it. If you fix this issue in this way, I would request that you give us the ability to modify the data in an under-contract : I've already requested that, and I'll use it.

Edited by hargn
Link to comment
Share on other sites

@hargn - it was a bug in the logic (it was checking for the data in the wrong contract_group node).  That should be fixed now.

The problem with the inheritance is that Contract Configurator is very strict with the namespacing for the variables.  Changing that would have a very big impact to the parser.  Right now when you do an @variable notation, it will defer the load if the variable isn't defined.  But if the variable can be defined at different levels, and the parser does find it, it won't be able to know if this is the right one, or if the correct one still isn't loaded yet.  As long as I define the load order of the groups properly, it may still work, but for the amount of effort I'm not sure what it buys you (the ability to copy + paste the same variable name across different contracts and have a different meaning?).

Link to comment
Share on other sites

37 minutes ago, nightingale said:

@hargn - it was a bug in the logic (it was checking for the data in the wrong contract_group node).  That should be fixed now.

The problem with the inheritance is that Contract Configurator is very strict with the namespacing for the variables.  Changing that would have a very big impact to the parser.  Right now when you do an @variable notation, it will defer the load if the variable isn't defined.  But if the variable can be defined at different levels, and the parser does find it, it won't be able to know if this is the right one, or if the correct one still isn't loaded yet.  As long as I define the load order of the groups properly, it may still work, but for the amount of effort I'm not sure what it buys you (the ability to copy + paste the same variable name across different contracts and have a different meaning?).

Agree that it can be hard to redesign the parser.
I'm realy looking foward the new version in order that I can test my contracts.

Thanks

Link to comment
Share on other sites

1 minute ago, hargn said:

Agree that it can be hard to redesign the parser.
I'm realy looking foward the new version in order that I can test my contracts.

Thanks

You can grab the latest dev version from here.  In general, I highly recommend doing this if there are pending changes that you're waiting on - that way if there's any issues you can get them fixed quicker.

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