Jump to content

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


nightingale

Recommended Posts

I've had this problem too.

I think what's happening is that one of your contract packs (for example, SETI Contracts) is by default disabling some of the stock contracts. But for some reason, the stock contracts keep showing up anyway. But then, because they are disabled, they disappear after a scene change.

Link to comment
Share on other sites

  • 2 weeks later...
On 11/27/2017 at 3:25 PM, TaxiService said:

Hi nightingale,

A couple of players reported a Reflection issue of Contract Configuration 1.23.3 against newly-released RemoteTech 1.8.9 on KSP 1.3.1. Here's my output_log file.

Based on my investigation, the reflection issue seems to be due to the attributes of a new functionality added to RT 1.8.9. Here's the offending commit of RT codebase. I guess CC was compiled particularly against RT 1.8.8 and didn't expect the new attributes but I can hardly believe the reflection could fail against new attributes.

If possible, please advise me on possible changes required to be make to RT codebase to resolve the reflection issue.

[ERR 04:58:23.422] AssemblyLoader: Exception loading 'CC_RemoteTech': System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
  at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
  at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0
  at AssemblyLoader.LoadAssemblies () [0x00000] in <filename unknown>:0

Additional information about this exception:

 System.TypeLoadException: Could not load type 'ContractConfigurator.RemoteTech.RemoteTechProgressTracker+FakeSatellite' from assembly 'CC_RemoteTech, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

 System.TypeLoadException: Could not load type '<get_Antennas>d__29' from assembly 'CC_RemoteTech, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

 System.TypeLoadException: Could not load type '<FindNeighbors>d__33' from assembly 'CC_RemoteTech, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

----------------------------------------------------------

Still get it.

Link to comment
Share on other sites

On ‎12‎/‎31‎/‎2017 at 12:16 AM, MarvinKosh said:

I've had this problem too.

I think what's happening is that one of your contract packs (for example, SETI Contracts) is by default disabling some of the stock contracts. But for some reason, the stock contracts keep showing up anyway. But then, because they are disabled, they disappear after a scene change.

This. When I went into CC, and re-enabled stock milestone contracts (disabled by SETI Contracts) the contracts stayed. They shouldn't be there at all, but I'd rather they stay the night than to come and go, so to speak.

Link to comment
Share on other sites

I found this error with a pop up in game:

 

Spoiler

Exception occured while loading contract 'BasesandStations.MedicalEmergency':
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object
  at ContractConfigurator.Kerbal.SetCrew (.ProtoCrewMember pcm) [0x00000] in <filename unknown>:0
  at ContractConfigurator.Kerbal.Initialize (Nullable`1 gender, System.String name) [0x00000] in <filename unknown>:0
  at ContractConfigurator.Kerbal..ctor (System.String name) [0x00000] in <filename unknown>:0
  at ContractConfigurator.ConfigNodeUtil.ParseSingleValue[Kerbal] (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.ConfiguredContract.OnLoad (.ConfigNode node) [0x00000] in <filename unknown>:0

Didnt remember if i acept the MedicalEmergency contract. But i can tell little history with this error:

In other mision on mimus, an scientist where converted to a tourist with the ksp mod habitat needs.

I went with other vessel with more Hab capacity.Later I go on EVA, return to vessel, & when i changed to KSC pop up this error.

What it meens? It seems I lose  a contract. & now i cant see the Kerbal who was a tourist in the vessel. But in KSP i can see her in active (but without definitions)

If i return this vessel to KSC i will see her? Or i will lose this Kerbal forever?

EDIT: Sorry. didnt read above. I have installed remotetech 1.8.9 too (i thought mks was involved in my problem)

Edited by Skaramuza
Link to comment
Share on other sites

Hi guys,

I'dd like to modify the stored current completed contracts (from 'maxCompletions') each year.

Goal: allow some contracts to be repeated 3 time per year max. So I'dd need to reset 'current completed' to 0 every year.
I do not think contract configurator can do this currently. But I'dd like to do a very small mod that would add this possibility on top of CC.
How is this 'current completed' variable stored in CC and how would I modify it at runtime?

Thanks for your help!

Edited by Garlik
Link to comment
Share on other sites

@nightingale I'm just reinstalling KSP and refreshing my mod list and I got this error in my log file after installing contract Configurator along with several contract packs. I'm not sure the error belongs here or with the contract pack author. I posted it here as a first step. 

Here is my log file: https://drive.google.com/open?id=1nHfbrTLTuXkG3n2HjUudGy_PeLj7lBlE

This is the relevant error from the log.

Quote

[ERR 16:25:45.301] ContractConfigurator.HasCrewFactory: CONTRACT_TYPE 'BasePopulation', PARAMETER 'HasCrew' of type 'HasCrew': A validation error occured while loading the key 'maxCrew' with value '0'.

[EXC 16:25:45.304] ArgumentException: Must be greater than or equal to 1
    ContractConfigurator.Validation.GE[Int32] (Int32 val, Int32 referenceValue)
    ContractConfigurator.HasCrewFactory.<Load>b__7_8 (Int32 x)
    ContractConfigurator.ConfigNodeUtil.ParseValue[Int32] (.ConfigNode configNode, System.String key, System.Action`1 setter, IContractConfiguratorFactory obj, Int32 defaultValue, System.Func`2 validation)
    UnityEngine.Debug:LogException(Exception)
    ContractConfigurator.LoggingUtil:LogException(Exception)
    ContractConfigurator.ConfigNodeUtil:ParseValue(ConfigNode, String, Action`1, IContractConfiguratorFactory, Int32, Func`2)
    ContractConfigurator.HasCrewFactory:Load(ConfigNode)
    ContractConfigurator.ParameterFactory:GenerateParameterFactory(ConfigNode, ContractType, ParameterFactory&, ParameterFactory)
    ContractConfigurator.ParameterFactory:GenerateParameterFactory(ConfigNode, ContractType, ParameterFactory&, ParameterFactory)
    ContractConfigurator.ContractType:Load(ConfigNode)
    ContractConfigurator.<LoadContractTypeConfig>d__29:MoveNext()
    ContractConfigurator.<FinalizeContractTypeLoad>d__28:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

Tell me what else you need that I can help?

Link to comment
Share on other sites

  • 2 weeks later...

@Lumaan

Seeing this exception also with RP-0's Remote tech contracts

Spoiler

ReflectionTypeLoadException: The classes in the module cannot be loaded.
  at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
  at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0
  at ContractConfigurator.ContractConfigurator+<GetAllTypes>d__30`1[ContractConfigurator.ParameterFactory].MoveNext () [0x00000] in <filename unknown>:0
Rethrow as Exception: Error loading types from assembly CC_RemoteTech, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null

UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
ContractConfigurator.LoggingUtil:LogException(Exception)
ContractConfigurator.<GetAllTypes>d__30`1:MoveNext()
System.Linq.<CreateWhereIterator>c__Iterator1D`1:MoveNext()
ContractConfigurator.ContractConfigurator:RegisterParameterFactories()
ContractConfigurator.ContractConfigurator:PSystemReady()
EventVoid:Fire()
<Start>c__Iterator7A:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

gives me errors for RP-0 (developmental) contracts

Spoiler

ContractConfigurator.ContractType: Errors encountered while trying to load CONTRACT_TYPE 'GeoComSatNetwork'
ContractConfigurator.ContractType: Errors encountered while trying to load CONTRACT_TYPE 'GLONASSnetwork'
ContractConfigurator.ContractType: Errors encountered while trying to load CONTRACT_TYPE 'GPSnetwork'
ContractConfigurator.ContractType: Errors encountered while trying to load CONTRACT_TYPE 'EarlyComNetwork3'
ContractConfigurator.ContractType: Errors encountered while trying to load CONTRACT_TYPE 'EarlyComNetwork4'

I'm rooting around looking the the cause since we want to get RO/RP-0 to 1.3.1

 

My solution is this .dll CC_RemoteTech.dll

Edited by Bornholio
add fix
Link to comment
Share on other sites

I think I found a bug. I have "Bases and Stations" ContractPack installed and there is one contract that calls OrbitedBodies() but gets an empty list back (seen in the debug window), despite that I have loaded a save where I sure am orbiting bodies right now. I actually started a new game with this mods. So the orbiting was made, while ContractConfigurator was installed.

 

I also tried to change it to AllBodies() -> works

and to ReachedBodies() -> empty list

even targetBody = AllBodies().Where(b => b.HaveOrbited() == true) does return an empty list. Is there a known bug or is it possible that (for example) ResearchBodies interferes with this functions?

Thanks for your time and your great mod! :)

Edited by Jim_Panzee
Link to comment
Share on other sites

  • 2 weeks later...

I'll start off saying I'm still playing KSP 1.2.2 so I'm using Contract Configurator 1.22.2 which may be what the issue is.  I've got a contract pack with a satellite contract that, by default, wants me to include "part = SCANsat_Scanner", "part = SCANsat_Scanner24" and "part = SCANsat_Scanner2".  I've also got a parts pack that has a satellite that includes the MODULE from each of those parts.  So I wanted to update the contract so it would look for a specific module instead of a specific part.  I looked on the wiki and I see there is a "partModule" parameter I can use instead of the existing "part" parameter (in "PartValidation").  Trouble is, the module name for all three of the SCANsat scanners is just "SCANsat".  But the wiki also "MODULE" and says it's an "Extended PartModule check".  Based on the information provided in the wiki, I figure this is exactly what I need.  So I edited the parameters of the contract as follows (showing just one of the three):

PARAMETER:NEEDS[SCANsat]
{
    name = LowResScanner
    type = PartValidation
    title = Must have a Low Resolution scanner on board
    partModule = SCANsat
    MODULE
    {
        name = SCANsat
        sensorType = 1
    }
    hideChildren = true
}

I've tried it both with the "partModule = SCANsat" parameter and without.  Either way the contract fails to load.  The debug data says "unexpected node 'MODULE'".

Ultimately what I'm trying to determine is, does the MODULE parameter of PartValidation work in Contract Configurator 1.22.2 and am I using the correct format.

 

EDIT: Corrected version number

Edited by chrisl
Link to comment
Share on other sites

  • 2 weeks later...

Having some trouble with CC behaviours.

The following exception is coming up 

Exception occured while loading contract 'RP0.recordUncrewedAlt':
System.Exception: Error parsing statement.
Error occurred near '*':
Max(60 * (@/uncrewedTargetAltitudeKM), $RP0_SoundingDifficulty)
........* <-- HERE ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Cannot get value for @/uncrewedTargetAltitudeKM: not available in this context.
  at ContractConfigurator.ExpressionParser.ExpressionParser`1[System.Double].ParseSpecialIdentifier (ContractConfigurator.ExpressionParser.Token token) [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.ExpressionParser.ExpressionParser`1[System.Double].GetCalledFunction (System.String functionName, Function& selectedMethod, Boolean isFunction) [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at ContractConfigurator.ExpressionParser.ExpressionParser`1[System.Double].ParseExpression (System.String key, System.String expression, ContractConfigurator.ExpressionParser.DataNode dataNode) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.ExpressionParser.ExpressionParser`1[System.Double].ParseExpressionGeneric (System.String key, System.String expression, ContractConfigurator.ExpressionParser.DataNode dataNode) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.Behaviour.Expression.OnLoad (.ConfigNode configNode) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.ContractBehaviour.Load (.ConfigNode configNode) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.ContractBehaviour.LoadBehaviour (.ConfigNode configNode, ContractConfigurator.ConfiguredContract contract) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.ConfiguredContract.OnLoad (.ConfigNode node) [0x00000] in <filename unknown>:0 

It's to do with this bit of code - the error occurs in the behaviour at the bottom

    DATA
    {
        type = float

        testDat = Max(60 * (@/uncrewedTargetAltitudeKM), $RP0_SoundingDifficulty)
    }
    
    BEHAVIOUR
    {
        name = SetMaxSoundingDifficulty
        type = Expression

        CONTRACT_COMPLETED_SUCCESS
        {
            RP0_SoundingDifficulty = @/testDat
        }
    }
    
    BEHAVIOUR
    {
        name = SetMaxSoundingDifficulty
        type = Expression

        CONTRACT_COMPLETED_SUCCESS
        {
            RP0_SoundingDifficulty = Max(60 * (@/uncrewedTargetAltitudeKM), $RP0_SoundingDifficulty)
        }
    }

The problem is - as you can see from the 'testdat' data node, that if I have the same set of math in a data node works just fine.  And I'm using the @/ thing to reference a variable in the data nodes.  

I need this math to occur in the behaviour however, I don't want it to be evaluated until the contract is completed.

Link to comment
Share on other sites

  • 2 weeks later...

Okay, let's get this show on the road.  I have about a year of unread posts in this thread, and the only way I can constructively move forward with this mod is to just pretend most of them don't exist.  So I'll work backwards and answer a few posts, but even the second post is nearing a month old - hard to say who's still actually waiting on an answer.  After that, I'll start digging into 1.4.0 compatibility.

@Maxsimal - The triggered expressions in behaviours suck.  Because they are the only thing that doesn't get parsed at either contract type load or contract instantiation, they have different rules around them.  Their limitations are due to the fact that they are the original expression based thing in Contract Configurator, but they were only meant to transfer simple values from one contract to another.  It may be possible to make it work with some changes, but that's the must ugly and complex part of the Contract Configurator code, and I'm worried if I look at it now I'll run away for another year.  So best bet is to just go with something similar to the existing AltRecord contract and go with a simple increasing index or value.

@chrisl - The documentation doesn't match the code, and it looks like a bug.  So I've fixed it for the next release.  For you though, you'll have to use the extended model of PartValidation.  Untested and from a rusty memory, but I think you can do something like this:

PARAMETER:NEEDS[SCANsat]
{
    name = LowResScanner
    type = PartValidation
    title = Must have a Low Resolution scanner on board
    FILTER
    {
        MODULE
        {
            name = SCANsat
            sensorType = 1
        }
    }
    minCount = 1
    hideChildren = true
}

@Jim_Panzee - It might be a bug.  It uses the internal progress stuff in KSP.  I think when KSP added crewed/uncrewed/global progress nodes, it was either buggy or I didn't understand it correctly.  So I might be looking at the wrong versions of those nodes in some cases.  But it also might work in KSP 1.4.0.  So for now I'm not going to touch it - but if you can reconfirm once I have a 1.4.0 compatible version out, then it might be worth a deeper dive.

@AlexALX - Multi-lingual support is one of the things that I wanted to look at before i disappeared on my KSP sabbatical.  If I know there's someone willing to step up to do a translation (it sounds like you're willing for Russian) and there is a desire in the community (I assume there is or you wouldn't be asking), then it's something that I can consider looking at once the 1.4.0 (and probably 1.4.1) stuff is out of the way.  There is going to be a lot of challenges though - right now a contract pack can have text like "Land on @body", so I can't easily convert that to use the localization string system because it already has variable replacement going on.  I'm sure it's solvable - but it'll need lots of though.

@Bornholio - It was caused by a change in RemoteTech (as it looks like you figured out).  The pull request that was sent in to fix has been merged for the next release.

@Magnavox - Hopefully you got some help from the contract author - most likely that's where the issue is.

@Garlik - You'd need to do something similar to the cooldownDuration in CompleteContractRequirement.  Have a look at the code.

... and that's as far back as I'm willing to go.  If you have something you want answered, post below and hopefully/maybe I'll be able to help.

Link to comment
Share on other sites

16 hours ago, nightingale said:

Okay, let's get this show on the road.  I have about a year of unread posts in this thread, and the only way I can constructively move forward with this mod is to just pretend most of them don't exist.  So I'll work backwards and answer a few posts, but even the second post is nearing a month old - hard to say who's still actually waiting on an answer.  After that, I'll start digging into 1.4.0 compatibility.

@Maxsimal - The triggered expressions in behaviours suck.  Because they are the only thing that doesn't get parsed at either contract type load or contract instantiation, they have different rules around them.  Their limitations are due to the fact that they are the original expression based thing in Contract Configurator, but they were only meant to transfer simple values from one contract to another.  It may be possible to make it work with some changes, but that's the must ugly and complex part of the Contract Configurator code, and I'm worried if I look at it now I'll run away for another year.  So best bet is to just go with something similar to the existing AltRecord contract and go with a simple increasing index or value.

@chrisl - The documentation doesn't match the code, and it looks like a bug.  So I've fixed it for the next release.  For you though, you'll have to use the extended model of PartValidation.  Untested and from a rusty memory, but I think you can do something like this:


PARAMETER:NEEDS[SCANsat]
{
    name = LowResScanner
    type = PartValidation
    title = Must have a Low Resolution scanner on board
    FILTER
    {
        MODULE
        {
            name = SCANsat
            sensorType = 1
        }
    }
    minCount = 1
    hideChildren = true
}

@Jim_Panzee - It might be a bug.  It uses the internal progress stuff in KSP.  I think when KSP added crewed/uncrewed/global progress nodes, it was either buggy or I didn't understand it correctly.  So I might be looking at the wrong versions of those nodes in some cases.  But it also might work in KSP 1.4.0.  So for now I'm not going to touch it - but if you can reconfirm once I have a 1.4.0 compatible version out, then it might be worth a deeper dive.

@AlexALX - Multi-lingual support is one of the things that I wanted to look at before i disappeared on my KSP sabbatical.  If I know there's someone willing to step up to do a translation (it sounds like you're willing for Russian) and there is a desire in the community (I assume there is or you wouldn't be asking), then it's something that I can consider looking at once the 1.4.0 (and probably 1.4.1) stuff is out of the way.  There is going to be a lot of challenges though - right now a contract pack can have text like "Land on @body", so I can't easily convert that to use the localization string system because it already has variable replacement going on.  I'm sure it's solvable - but it'll need lots of though.

@Bornholio - It was caused by a change in RemoteTech (as it looks like you figured out).  The pull request that was sent in to fix has been merged for the next release.

@Magnavox - Hopefully you got some help from the contract author - most likely that's where the issue is.

@Garlik - You'd need to do something similar to the cooldownDuration in CompleteContractRequirement.  Have a look at the code.

... and that's as far back as I'm willing to go.  If you have something you want answered, post below and hopefully/maybe I'll be able to help.

Glad to have You back, Nightingale!

Just hope You will update your mod to work with new Remote Tech

Link to comment
Share on other sites

42 minutes ago, Nik Power said:

Glad to have You back, Nightingale!

Just hope You will update your mod to work with new Remote Tech

Someone posted up a dll that can be used for 1.3.1.  For 1.4.0 I'll incorporate that (and any other RemoteTech changes required) into the release.

Link to comment
Share on other sites

9 hours ago, nightingale said:

Someone posted up a dll that can be used for 1.3.1.  For 1.4.0 I'll incorporate that (and any other RemoteTech changes required) into the release.

I guess, I did something wrong trying to implement that DLL for me, but it does not helped.

Still running on RT 1.8.8 (works OK for me)

Link to comment
Share on other sites

6 hours ago, Nik Power said:

I guess, I did something wrong trying to implement that DLL for me, but it does not helped.

Still running on RT 1.8.8 (works OK for me)

The DLL was for RemoteTech 1.8.9 - as far as I know it should "just work" on the older version.

Link to comment
Share on other sites

Didn't seem to need too much for KSP 1.4.0 - so here's the new update!

Contract Configurator 1.24.0

  • Recompile for KSP 1.4.0
  • Added back MODULE checks in simple version of PartValidation (thanks chrisl).
  • Support RemoteTech 1.8.9 (thanks vader111).
  • Read date/time information from dateTimeFormatter (thanks Aelfhe1m).
Link to comment
Share on other sites

 

22 hours ago, nightingale said:

Didn't seem to need too much for KSP 1.4.0 - so here's the new update!

Contract Configurator 1.24.0

  • Recompile for KSP 1.4.0
  • Added back MODULE checks in simple version of PartValidation (thanks chrisl).
  • Support RemoteTech 1.8.9 (thanks vader111).
  • Read date/time information from dateTimeFormatter (thanks Aelfhe1m).

Oh, thank KERBOL. I couldn't stand the endless progression of part testing contacts in my new 1.4 save!

Link to comment
Share on other sites

On 3/12/2018 at 12:54 AM, nightingale said:

Didn't seem to need too much for KSP 1.4.0 - so here's the new update!

Contract Configurator 1.24.0

  • Recompile for KSP 1.4.0
  • Added back MODULE checks in simple version of PartValidation (thanks chrisl).
  • Support RemoteTech 1.8.9 (thanks vader111).
  • Read date/time information from dateTimeFormatter (thanks Aelfhe1m).

Is this version reverse compatible with 1.3.1?

Link to comment
Share on other sites

9 hours ago, Kaa253 said:

Now if there was just a Making History Mission Designer 2 Career Mode Contract converter !!!! :D

Or just a way to load missions into career mode... it seems like a huge oversight that that isn't a default feature.

Link to comment
Share on other sites

15 hours ago, tjsnh said:

Or just a way to load missions into career mode... it seems like a huge oversight that that isn't a default feature.

Wait. You can not use the Missionbuilder missions inside career?!

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