Jump to content

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


nightingale

Recommended Posts

Actually, it looks like my problem is that only Trivial prestige contracts of this type are being presented.  No matter how many I decline, it always comes up with a new one with a prestige level of Trivial.

I edited the persistent.sfs, and changed the rep fro 998 to 1998, in the hope that a higher rep would help, but no change.

So, what would prevent any contracts from being offered which are more than a Trivial level?

Thanks

Link to comment
Share on other sites

7 minutes ago, linuxgurugamer said:

Actually, it looks like my problem is that only Trivial prestige contracts of this type are being presented.  No matter how many I decline, it always comes up with a new one with a prestige level of Trivial.

I edited the persistent.sfs, and changed the rep fro 998 to 1998, in the hope that a higher rep would help, but no change.

So, what would prevent any contracts from being offered which are more than a Trivial level?

Thanks

Seeing as 1000 is the max rep, you should be getting more than just trivial contracts.

Could be contract requirements aren't being met.  Could also be you disabled too much stuff.  If 5 trivial contracts need to be generated, and the contract system can only generate 3, it won't try to generate significant contracts.  So you need to be able to fill all the slots below.  Also could happen if you've increased the contract limit in contracts.cfg.

Link to comment
Share on other sites

I would like to formally announce the availability of Contract Pack: Giving Aircraft a Purpose (GAP) 1.0 Beta for inclusion in Contract Configurator's listings in the OP and wherever else you want. 3 months of lots of hard work. I thank my wife and children for bearing up with it. :)  My 8 year old son did most of the QA testing. I think it came out pretty well for a first mod.

Let me know there or here what you think. I just haven't tested the CKAN install yet. Not sure if it got submitted correctly.

Link to comment
Share on other sites

17 minutes ago, inigma said:

I would like to formally announce the availability of Contract Pack: Giving Aircraft a Purpose (GAP) 1.0 Beta for inclusion in Contract Configurator's listings in the OP and wherever else you want. 3 months of lots of hard work. I thank my wife and children for bearing up with it. :)  My 8 year old son did most of the QA testing. I think it came out pretty well for a first mod.

Let me know there or here what you think. I just haven't tested the CKAN install yet. Not sure if it got submitted correctly.

Congrats!  I've been thinking of dropping the listing of contract packs in the second post ever since the move to the new forum.  It's a missive pain to update with this forum software (no way to add a row to the table without recreating the whole thing.

Question to everyone: Do you find it useful?  If not, do you just find your contract packs via CKAN or the forums?

Link to comment
Share on other sites

29 minutes ago, nightingale said:

Congrats!  I've been thinking of dropping the listing of contract packs in the second post ever since the move to the new forum.  It's a missive pain to update with this forum software (no way to add a row to the table without recreating the whole thing.

Question to everyone: Do you find it useful?  If not, do you just find your contract packs via CKAN or the forums?

Why not replace the table with a numbered list?  That is easy to update.

I like seeing it in the first post, it let people know how useful CC is.

13 hours ago, nightingale said:

Seeing as 1000 is the max rep, you should be getting more than just trivial contracts.

Could be contract requirements aren't being met.  Could also be you disabled too much stuff.  If 5 trivial contracts need to be generated, and the contract system can only generate 3, it won't try to generate significant contracts.  So you need to be able to fill all the slots below.  Also could happen if you've increased the contract limit in contracts.cfg.

There is something weird going on with my DATA nodes, most likely my problem

I tried setting the logging to VERBOSE, but it was too much.  What level logging should I use if I want to see the following:

  1. variables and data being stored
  2. Completion of an expression and the result

Thanks

Link to comment
Share on other sites

14 minutes ago, linuxgurugamer said:

Why not replace the table with a numbered list?  That is easy to update.

That's the other option - it'll just be a pain to do that update (but the pain is only once).

15 minutes ago, linuxgurugamer said:

I like seeing it in the first post, it let people know how useful CC is.

There is something weird going on with my DATA nodes, most likely my problem

I tried setting the logging to VERBOSE, but it was too much.  What level logging should I use if I want to see the following:

  1. variables and data being stored
  2. Completion of an expression and the result

Thanks

There's an undocumented feature, but trace=true in your contract_type, and it will turn verbose logging on for that contract only.  I use it for my own debugging of the expression system, but it might work for you.

Link to comment
Share on other sites

1 hour ago, nightingale said:

That's the other option - it'll just be a pain to do that update (but the pain is only once).

There's an undocumented feature, but trace=true in your contract_type, and it will turn verbose logging on for that contract only.  I use it for my own debugging of the expression system, but it might work for you.

Ok, thanks.  That will be a big help 

Link to comment
Share on other sites

So, I'm feeling a bit lazy and could do with some repetitive dialog boxes.

Let's say i have a dialog box that's triggered by parameter "MyParameter" - if I had two parameters with that name, would the dialog box trigger for both of them? Or just the first one (assume they complete in sequence so wouldn't trigger together)

 

Link to comment
Share on other sites

27 minutes ago, severedsolo said:

So, I'm feeling a bit lazy and could do with some repetitive dialog boxes.

Let's say i have a dialog box that's triggered by parameter "MyParameter" - if I had two parameters with that name, would the dialog box trigger for both of them? Or just the first one (assume they complete in sequence so wouldn't trigger together)

It would trigger for either of them.

Link to comment
Share on other sites

I'm not sure if this is supposed to be allowed:

    BEHAVIOUR
    {
        name = Expression
        type = Expression

        CONTRACT_COMPLETED_SUCCESS
        {
            type = bool
            roverDeployed = true
        }
    }
    DATA
    {
        type = List<CelestialBody>
        //easyPlanets = HomeWorld().Children()
        // Make sure first rover is deployed to Kerbin
        easyPlanets = $roverDeployed  ? HomeWorld().Children() : [ @kerbin ]
    }

 

It isn't really clear from the wiki.  If it is supposed to be allowed, then it's broken, if not, I'll have to figure out another way to do this.  Let me know if you want me to raise this as an issue.  I am using the dev dll downloaded about 9PM EST:

 

ContractConfigurator.ContractType: CONTRACT_TYPE 'RoverDeploy': Error parsing easyPlanets
 
(Filename: C:/buildslave/unity/build/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 56)

DataStoreCastException: Cannot cast from CelestialBody to System.Boolean.
  at ContractConfigurator.ExpressionParser.ExpressionParser`1[CelestialBody].ConvertType[Boolean] (.CelestialBody value) [0x00000] in <filename unknown>:0
  at ContractConfigurator.ExpressionParser.CelestialBodyParser.ConvertType[Boolean] (.CelestialBody value) [0x00000] in <filename unknown>:0
  at ContractConfigurator.ExpressionParser.ExpressionParser`1[CelestialBody].ParseStatement[CelestialBody] (.CelestialBody lval) [0x00000] in <filename unknown>:0 
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
  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[CelestialBody].ParseStatement[CelestialBody] () [0x00000] in <filename unknown>:0 
Rethrow as DataStoreCastException: Cannot cast from CelestialBody to System.Boolean.
  at ContractConfigurator.ExpressionParser.ExpressionParser`1[CelestialBody].ParseStatement[CelestialBody] () [0x00000] in <filename unknown>:0 
Rethrow as Exception: Error parsing statement.
Error occurred near '*':
$roverDeployed ? HomeWorld().Children() : [ @kerbin ]
................* <-- HERE
  at ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ParseExpression (System.String key, System.String expression, ContractConfigurator.ExpressionParser.DataNode dataNode) [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 
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
  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 
UnityEngine.Debug:Internal_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)
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
ContractConfigurator.ExpressionParser.DataNode:ParseDataNodes(ConfigNode, IContractConfiguratorFactory, Dictionary`2, Dictionary`2)
ContractConfigurator.ContractType:Load(ConfigNode)
ContractConfigurator.<LoadContractConfig>d__1e:MoveNext()
ContractConfigurator.ContractConfigurator:Update()


 

 

Edited by linuxgurugamer
Link to comment
Share on other sites

48 minutes ago, linuxgurugamer said:

I'm not sure if this is supposed to be allowed:

<snip>

It isn't really clear from the wiki.  If it is supposed to be allowed, then it's broken, if not, I'll have to figure out another way to do this.  Let me know if you want me to raise this as an issue.  I am using the dev dll downloaded about 9PM EST:

Should be doable, but you're running into an initialization problem that I don't have a good answer for.  In short, doesn't know what type $roverDeployed is, and it's guessing wrong.  I made a change in the latest dev dll (just now) to add a bool() cast function, try this and see if it works:

        easyPlanets = bool($roverDeployed) ? HomeWorld().Children() : [ @kerbin ]
Link to comment
Share on other sites

8 hours ago, nightingale said:

Should be doable, but you're running into an initialization problem that I don't have a good answer for.  In short, doesn't know what type $roverDeployed is, and it's guessing wrong.  I made a change in the latest dev dll (just now) to add a bool() cast function, try this and see if it works:


        easyPlanets = bool($roverDeployed) ? HomeWorld().Children() : [ @kerbin ]

Yes, that worked.

And, it may even solved the problem I was having earlier with this, when $roverDeployed was an int. I had been trying to get a count of how many times a rover had been deployed (and thanks for fixing the addition, I'll test it later), and while the "$roverDeployed > 0": wasn't generating an error directly, it wasn't work (there are 3 lines like that) and I wasn't getting the results I expected.  Now, with the bool(), I am.  I'm assuming that where I was referencing a bool with the @ sign it was and is properly guessing the type (see the @dunaReached in the code below)?

   BEHAVIOUR
    {
        name = Expression
        type = Expression

        CONTRACT_COMPLETED_SUCCESS
        {
            type = int
            roverDeployed = 1
        }
    }
	DATA
	{
		type = bool
		moonsReached = @mun.HaveReached() || @minmus.HaveReached()
		dunaReached = @duna.HaveReached()
	}
    DATA
    {
        type = List<CelestialBody>
        //easyPlanets = HomeWorld().Children()
        // Make sure first rover is deployed to Kerbin
        easyPlanets = $roverDeployed > 0 ? HomeWorld().Children() : [ @kerbin ]

        hardPlanetsTemp2 = @dunaReached ?  @hardPlanetsTemp1.ExcludeAll(@mediumPlanets).Exclude(HomeWorld()) : @mediumPlanets
    }
Edited by linuxgurugamer
Link to comment
Share on other sites

Ok, I just went through all my tests, and they all are working now with the updated dll.

Questions:

  1. Will the following work:     bool($roverDeployed > 2) 
  2. What is the value of an int, double and bool when first defined (ie: if in first contract, the above $roverDeployed will not have been set yet)

 

A bug was reported to me about my GrandTours contract, the solution is the same code I have in this (Rovers).  So, not pressing, just asking for an ETA on the next release so I can tell the players who reported the bug as to when they should expect an update.

I know that RL comes first.

Thanks for all your work

 

LGG

Link to comment
Share on other sites

20 hours ago, nightingale said:

Congrats!  I've been thinking of dropping the listing of contract packs in the second post ever since the move to the new forum.  It's a missive pain to update with this forum software (no way to add a row to the table without recreating the whole thing.

Question to everyone: Do you find it useful?  If not, do you just find your contract packs via CKAN or the forums?

I only look in Kerbalstuff for mods (not CKAN), but yes, the list of available contract packs is pretty important.  Maybe maintain it in the README file inside the zip instead of on the forum though.  That way going to your github page would show the latest information about contract packs and people could submit PRs.

Link to comment
Share on other sites

23 hours ago, nightingale said:

Question to everyone: Do you find it useful?  If not, do you just find your contract packs via CKAN or the forums?

ABSOLUTELY!.... But then I'm the weirdo with a spreadsheet keeping track of almost 700 mods... :rolleyes:

I also like that you have the "retired" contracts list... ;P

Sorry for voting for the extra work... :)

3 hours ago, WuphonsReach said:

Maybe maintain it in the README file inside the zip instead of on the forum though.  That way going to your github page would show the latest information about contract packs and people could submit PRs.

Hmmm... No not INSTEAD OF.... maybe "AS WELL AS".... I mean, NO ONE ever reads the README files... lol

Edited by Stone Blue
Link to comment
Share on other sites

I want to have one contract pack change it's requirements if another is loaded.  I've been looking at MM, but I don't think it can do anything, since there is no dll (I posted  a question in that thread)

How would you suggest I do it (ie:  I want my RoverMissions to check to see if UnmannedContracts is installed, and if so, to have another requirement based on the status of unmanned Contracts)

Thanks

 

Link to comment
Share on other sites

4 hours ago, linuxgurugamer said:

And, it may even solved the problem I was having earlier with this, when $roverDeployed was an int. I had been trying to get a count of how many times a rover had been deployed (and thanks for fixing the addition, I'll test it later), and while the "$roverDeployed > 0": wasn't generating an error directly, it wasn't work (there are 3 lines like that) and I wasn't getting the results I expected.  Now, with the bool(), I am.  I'm assuming that where I was referencing a bool with the @ sign it was and is properly guessing the type (see the @dunaReached in the code below)?

<snip>

No, with the @ variables and data nodes it's a little bit more sophisticated.  Because @dunaReached was defined earlier as a bool, it knows that it's a bool (also, order doesn't matter, it'll still work if you swap stuff around).  In your case for $roverDeployed it should hypothetically be able to figure out the type by doing an early initialization before trying to parse the value (raise a GitHub request there, I can probably do that one fairly easily), but there's a lot of cases where it's not so simple (any time that the value is defined in one contract and used in another).

4 hours ago, linuxgurugamer said:

1. Will the following work:     bool($roverDeployed > 2) 

No - as it's $roverDeployed that it doesn't know the type of.  ($x > C) is always going to be a bool.  What you want is int($roverDeployed) > 2.

4 hours ago, linuxgurugamer said:

2. What is the value of an int, double and bool when first defined (ie: if in first contract, the above $roverDeployed will not have been set yet).

It will always be default(T).  For those not familiar with C#, that means it'll be 0 for numeric values, and null for most everything else.

4 hours ago, linuxgurugamer said:

A bug was reported to me about my GrandTours contract, the solution is the same code I have in this (Rovers).  So, not pressing, just asking for an ETA on the next release so I can tell the players who reported the bug as to when they should expect an update.

In general I'm trying to go with roughly weekly releases if I know someone is ready to release a contract pack update or there is a bug that is affecting players on released versions of contract packs.  December was an exception, because it was crazy.  I can't make promises in general, but I would expect to see 1.9.3 sometime on the weekend.

4 hours ago, WuphonsReach said:

I only look in Kerbalstuff for mods (not CKAN), but yes, the list of available contract packs is pretty important.  Maybe maintain it in the README file inside the zip instead of on the forum though.  That way going to your github page would show the latest information about contract packs and people could submit PRs.

1 hour ago, Stone Blue said:

ABSOLUTELY!.... But then I'm the weirdo with a spreadsheet keeping track of almost 700 mods... :rolleyes:

I also like that you have the "retired" contracts list... ;P

Sorry for voting for the extra work... :)

Based on the various feedback, I'll keep maintaining the list.  I just need to take the time to change the formatting to something that is maintainable on these forums.  Or perhaps move it to a GitHub IO page (way more maintainable, but way less visible on the forums as it would just be an external link).  Opinions on that?

13 minutes ago, linuxgurugamer said:

I want to have one contract pack change it's requirements if another is loaded.  I've been looking at MM, but I don't think it can do anything, since there is no dll (I posted  a question in that thread)

How would you suggest I do it (ie:  I want my RoverMissions to check to see if UnmannedContracts is installed, and if so, to have another requirement based on the status of unmanned Contracts)

I know that @sarbian once said in the past that he would not support nested directory structures.  I remember him mentioning that he didn't like the GameData/company/mod structure that some use, although maybe he'd consider it for this use case.  Anyway, if he doesn't make a change, your best bet is to just include a dummy .dll.  It doesn't need to have any real code in it (no maintenance required), but that should be enough to allow a NEEDS[UnmannedContracts] syntax to work.

Link to comment
Share on other sites

2 minutes ago, nightingale said:

I know that @sarbian once said in the past that he would not support nested directory structures.  I remember him mentioning that he didn't like the GameData/company/mod structure that some use, although maybe he'd consider it for this use case.  Anyway, if he doesn't make a change, your best bet is to just include a dummy .dll.  It doesn't need to have any real code in it (no maintenance required), but that should be enough to allow a NEEDS[UnmannedContracts] syntax to work.

Not what I really wanted to hear, but at least it's a solution.

Thanks

Link to comment
Share on other sites

47 minutes ago, Svm420 said:

@linuxgurugamer What about a dummy folder instead of a .dll not sure if it makeS a difference, but another idea.

I would prefer the dummy dll, safer.

@nightingale

Food for thought:  Would it be possible to have CC have a global list of all contract packs installed?  Not sure if this would require a new parameter to add the name of the pack.

Not urgent, I'm going to move ahead with the dummy dll for now

Link to comment
Share on other sites

4 minutes ago, linuxgurugamer said:

I would prefer the dummy dll, safer.

@nightingale

Food for thought:  Would it be possible to have CC have a global list of all contract packs installed?  Not sure if this would require a new parameter to add the name of the pack.

Not urgent, I'm going to move ahead with the dummy dll for now

To what end?  It internally has a list of all root CONTRACT_GROUP nodes, which is pretty close to contract packs.  Are you saying something that is exposed via an expression function?

Link to comment
Share on other sites

44 minutes ago, nightingale said:

To what end?  It internally has a list of all root CONTRACT_GROUP nodes, which is pretty close to contract packs.  Are you saying something that is exposed via an expression function?

That sounds like it's what I would need.  Would that be difficult?

Also, does it get a list of all the CONTRACT_GROUP nodes before it starts processing the contracts?

 

But if I'm the only one who has ever asked for this, then I suppose I can do a dummy dll, and let MM do the work for me.  Might make it easier for  you.

Edited by linuxgurugamer
Link to comment
Share on other sites

2 hours ago, nightingale said:
6 hours ago, linuxgurugamer said:

A bug was reported to me about my GrandTours contract, the solution is the same code I have in this (Rovers).  So, not pressing, just asking for an ETA on the next release so I can tell the players who reported the bug as to when they should expect an update.

In general I'm trying to go with roughly weekly releases if I know someone is ready to release a contract pack update or there is a bug that is affecting players on released versions of contract packs.  December was an exception, because it was crazy.  I can't make promises in general, but I would expect to see 1.9.3 sometime on the weekend.

That's fine, thanks

2 hours ago, nightingale said:
6 hours ago, linuxgurugamer said:

1. Will the following work:     bool($roverDeployed > 2) 

No - as it's $roverDeployed that it doesn't know the type of.  ($x > C) is always going to be a bool.  What you want is int($roverDeployed) > 2.

6 hours ago, linuxgurugamer said:

2. What is the value of an int, double and bool when first defined (ie: if in first contract, the above $roverDeployed will not have been set yet).

It will always be default(T).  For those not familiar with C#, that means it'll be 0 for numeric values, and null for most everything else.

ok, thanks.

So if $testBool  is not defined, what will happen when it is referenced, will it act as if it is false?

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