Jump to content

Contract Pack - Research Advancement Division - v1.2.1


Morphisor

Recommended Posts

So, it suddenly dawned on me that I completely forgot to actually release the draft changes. Totally slipped my mind. Oops.

Anyway, it's here now for those who didn't already grab the GitHub repo since I made the changes.

--

Version 1.2.1:

- Improved Local Observation flight subject selection logic to hopefully avoid requesting impossible experiments
- Changed max simultaneous contracts to 7, matching the number of available contract types.

Link to comment
Share on other sites

  • 3 months later...

For those that use this contract pack and also use the Strategia mod The following is my patch that associates these contracts with the Scientist Focus strategies

Spoiler
//   Title: Changes Strategia strategies to use RAD
//   Original Author: nightingale from Tourism contract pack
//   Modification: Caerfinon

@STRATEGY_LEVEL_EXPAND[ScientistFocus]:NEEDS[Strategia]:AFTER[Strategia]
{
    @EFFECT[CurrencyOperationByContract]
    {
        contractType = RAD
    }
}

  

Link to comment
Share on other sites

unknown.png

On 10/18/2022 at 9:53 PM, epicpupster239 said:

Does this support kerbalism?

This doesnt support kerbalism, none of the contracts appear. Expected since kerbalism changes the science system so much

On 4/22/2022 at 10:38 PM, Aelfhe1m said:

Depends how you define "compatible". Collect science type requirements in contracts are always a bit tricky with Kerbalism.

It won't throw any errors and the contracts should usually be completable but given how long some Kerbalism experiments take...

Kerbalism doesnt work, as from i can tell, the contract doesnt register the science experiments that kerbalism adds/changes, and thus contracts arent able to be accepted.

Edited by epicpupster239
missing image
Link to comment
Share on other sites

17 hours ago, epicpupster239 said:

unknown.png

This doesnt support kerbalism, none of the contracts appear. Expected since kerbalism changes the science system so much

Kerbalism doesnt work, as from i can tell, the contract doesnt register the science experiments that kerbalism adds/changes, and thus contracts arent able to be accepted.

Yeah that's pretty much expected behaviour. I don't play with Kerbalism so I wouldn't know where to start making it compatible. I'd happily accept a PR for a compatibility patch of course.

Link to comment
Share on other sites

  • 7 months later...

I have a mission to "Gather data from Kerbin's Shores" that will not complete.

It says that the biome and situation "landed" are incomplete. All of the experiments are  complete, but recovery or transmit is incomplete. This is despite me collecting the data and redoing it even when there was no additional data to collect. The first time I collected this information I did it with a manned rover and I considered that maybe the game was confused because it never took off and landed. So I made a little manned rocket and cut the fuel way back so that I would be sure to land in the correct biome. I recollected the data, but still cannot finish the contract.

Link to comment
Share on other sites

  • 1 month later...

Getting this error (including some others):

Spoiler

[ERR 01:51:25.967] ContractConfigurator.ContractType: CONTRACT_TYPE 'RAD_LocalFlight': Error parsing scienceSubjectsTemp1

[EXC 01:51:25.968] NullReferenceException: Object reference not set to an instance of an object
    ContractConfigurator.ExpressionParser.SubjectParser+<>c.<RegisterMethods>b__2_17 (ContractConfigurator.Biome b) (at <cfd80845287d48d4ac98392279f8d3b5>:0)
    System.Linq.Lookup`2[TKey,TElement].Create (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] keySelector, System.Collections.Generic.IEqualityComparer`1[T] comparer) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
    System.Linq.GroupedEnumerable`2[TSource,TKey].GetEnumerator () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
    System.Linq.Enumerable+SelectEnumerableIterator`2[TSource,TResult].MoveNext () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
    System.Linq.Enumerable+WhereEnumerableIterator`1[TSource].MoveNext () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
    ContractConfigurator.Util.Science+<GetSubjects>d__13.MoveNext () (at <cfd80845287d48d4ac98392279f8d3b5>:0)
    System.Collections.Generic.List`1[T]..ctor (System.Collections.Generic.IEnumerable`1[T] collection) (at <9577ac7a62ef43179789031239ba8798>:0)
    System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
    ContractConfigurator.ExpressionParser.SubjectParser+<>c.<RegisterMethods>b__2_8 (System.Collections.Generic.List`1[T] biomes, System.Collections.Generic.List`1[T] exps) (at <cfd80845287d48d4ac98392279f8d3b5>:0)
    ContractConfigurator.ExpressionParser.Function`3[T1,T2,TResult].Invoke (T1 p1, T2 p2) (at <cfd80845287d48d4ac98392279f8d3b5>:0)
    ContractConfigurator.ExpressionParser.Function`3[T1,T2,TResult].Invoke (System.Object[] parameters) (at <cfd80845287d48d4ac98392279f8d3b5>:0)
    ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ParseMethod[TResult] (ContractConfigurator.ExpressionParser.BaseParser+Token token, T obj, System.Boolean isFunction) (at <cfd80845287d48d4ac98392279f8d3b5>:0)
    ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ParseFunction (ContractConfigurator.ExpressionParser.BaseParser+Token token) (at <cfd80845287d48d4ac98392279f8d3b5>:0)
    ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ParseSimpleStatement[TResult] () (at <cfd80845287d48d4ac98392279f8d3b5>:0)
    ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ParseStatementInner[TResult] () (at <cfd80845287d48d4ac98392279f8d3b5>:0)
    ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ParseStatement[TResult] () (at <cfd80845287d48d4ac98392279f8d3b5>:0)
    ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ParseExpression (System.String key, System.String expression, ContractConfigurator.ExpressionParser.DataNode dataNode) (at <cfd80845287d48d4ac98392279f8d3b5>:0)
    Rethrow as Exception: Error parsing statement.
    Error occurred near '*':
    AllScienceSubjectsByBiomeExperiment([@biome1], @experiments1)
    .............................................................* <-- HERE
    ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ParseExpression (System.String key, System.String expression, ContractConfigurator.ExpressionParser.DataNode dataNode) (at <cfd80845287d48d4ac98392279f8d3b5>:0)
    ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ExecuteExpression (System.String key, System.String expression, ContractConfigurator.ExpressionParser.DataNode dataNode) (at <cfd80845287d48d4ac98392279f8d3b5>:0)
    ContractConfigurator.ConfigNodeUtil.ParseSingleValue[T] (System.String key, System.String stringValue, System.Boolean allowExpression) (at <cfd80845287d48d4ac98392279f8d3b5>:0)
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <9577ac7a62ef43179789031239ba8798>:0)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <9577ac7a62ef43179789031239ba8798>:0)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <9577ac7a62ef43179789031239ba8798>:0)
    ContractConfigurator.ConfigNodeUtil.ParseValue[T] (ConfigNode configNode, System.String key, System.Boolean allowExpression) (at <cfd80845287d48d4ac98392279f8d3b5>:0)
    ContractConfigurator.ConfigNodeUtil.ParseValue[T] (ConfigNode configNode, System.String key, System.Action`1[T] setter, ContractConfigurator.IContractConfiguratorFactory obj, T defaultValue, System.Func`2[T,TResult] validation) (at <cfd80845287d48d4ac98392279f8d3b5>:0)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
    UnityEngine.Debug:LogException(Exception)
    ContractConfigurator.LoggingUtil:LogException(Exception)
    ContractConfigurator.ConfigNodeUtil:ParseValue(ConfigNode, String, Action`1, IContractConfiguratorFactory, List`1, Func`2)
    ContractConfigurator.ConfigNodeUtil:ParseValue(ConfigNode, String, Action`1, IContractConfiguratorFactory, Func`2)
    ContractConfigurator.DeferredLoadUtil:ExecuteLoad(DeferredLoadObject`1)
    System.Reflection.MethodBase:Invoke(Object, Object[])
    ContractConfigurator.<UpdateNonDeterministicValuesIterator>d__31:MoveNext()
    System.Linq.ConcatIterator`1:MoveNext()
    ContractConfigurator.<GenerateContract>d__30:MoveNext()
    ContractConfigurator.<ContractEnumerator>d__29:MoveNext()
    ContractConfigurator.ContractPreLoader:Update()

KSP.log

Edit: Well it seems like the issue could be somewhere in here:

Line 68 in RAD_LocalFlight.cfg

scienceSubjectsTemp1 = AllScienceSubjectsByBiomeExperiment([@biome1], @experiments1)

After trying to trace this through CC using the debugger, it seems like @experiments1 value is null.

 

Edit 2: The issue was found to be an error in CC. More info here:

 

Edited by UltraJohn
Link to comment
Share on other sites

  • 1 year later...
On 5/27/2023 at 5:24 AM, ZarDan said:

I have a mission to "Gather data from Kerbin's Shores" that will not complete.

It says that the biome and situation "landed" are incomplete. All of the experiments are  complete, but recovery or transmit is incomplete. This is despite me collecting the data and redoing it even when there was no additional data to collect. The first time I collected this information I did it with a manned rover and I considered that maybe the game was confused because it never took off and landed. So I made a little manned rocket and cut the fuel way back so that I would be sure to land in the correct biome. I recollected the data, but still cannot finish the contract.

Getting the exact same issue on the exact same contract. Would love some attention to this.

NB : I did not delete the CC biomedata cfg files as I was unaware of that detail before playing with this mod.

 

Looking at the contract config file ("RAD_Surface.cfg"), it seems that at some point, the required experiments are selected from a list of experiments in a specific biome that have leftover science :

// Mission activates only for science that has not yet been done
DATA
{
  type = List<ScienceSubject>
  hidden = true

  scienceSubjectsTemp1 = AllScienceSubjectsByBiome([@biome1])
  scienceSubjectsTemp2 = @scienceSubjectsTemp1.Where(s => s.Situation() == SrfLanded || s.Situation() == SrfSplashed)
  scienceSubjectsTemp3 = @scienceSubjectsTemp2.Where(s => !s.Experiment().ID().StartsWith("ROCScience_"))
  scienceSubjectsTemp4 = @scienceSubjectsTemp3.Where(s => s.CollectedScience() == 0.0)

  scienceSubjects = @scienceSubjectsTemp4.Random(8,12)
}

According to the last line, it selects between 8 to 12 items from the filtered list at random. But according to the CC documentation, the List.Random(int min, int max) method should return the original list if there are less that min elements to begin with.

The funny thing is that a previous instance of the problem in this thread showed 12 subjects, I myself have 8 (with similar duplicates), so I'm beginning to think that something's off there.

Should I just delete the biome data files and scrap the current contract ?

Edited by Splatpope
more info
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...