Jump to content

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


nightingale

Recommended Posts

1 hour ago, nightingale said:

See [#420].  This functionality was actually introduced by KSP 1.0.5 - I just haven't exposed it through Contract Configurator yet.

Can't really help there - the game doesn't track that.

Is there an ETA for #420?

Re the other, I'll just dummy it up for now, and when 1.9.4 comes out with the persistent lists, I'll implement it there and put some extra info into the README

Thanks

Link to comment
Share on other sites

4 hours ago, linuxgurugamer said:

Is there an ETA for #420?

Re the other, I'll just dummy it up for now, and when 1.9.4 comes out with the persistent lists, I'll implement it there and put some extra info into the README

Thanks

I've marked issue #420 for the 1.9.4 release.  I've gone through and pruned the list to what I think is actually achievable for that release, and moved other things into a 1.9.x release.  Those are ones that are uncertain - although it's possible they will be in 1.9.4, it's not very likely.  See the lists here:

1.9.4
1.9.x

@Steven Mading, @inigma, @severedsolo - you guys should probably have a look through those as well.  If there's anything that is on the 1.9.x list that you want to see in 1.9.4, then drop a note on the issue.  Similarly, if there's something in the 1.9.4 list that you raised (or I raised for you) that you can live without for a while, let me know (it'll drop to 1.9.x, but you will gain goodwill ;)).

I've been aiming for roughly weekly releases, but looking at what's been done for 1.9.4 (not much yet) this one will probably be later.  Probably either mid-week or even as late as next weekend.

Link to comment
Share on other sites

14 minutes ago, nightingale said:

I've marked issue #420 for the 1.9.4 release.  I've gone through and pruned the list to what I think is actually achievable for that release, and moved other things into a 1.9.x release.  Those are ones that are uncertain - although it's possible they will be in 1.9.4, it's not very likely.  See the lists here:

1.9.4
1.9.x

@Steven Mading, @inigma, @severedsolo - you guys should probably have a look through those as well.  If there's anything that is on the 1.9.x list that you want to see in 1.9.4, then drop a note on the issue.  Similarly, if there's something in the 1.9.4 list that you raised (or I raised for you) that you can live without for a while, let me know (it'll drop to 1.9.x, but you will gain goodwill ;)).

I've been aiming for roughly weekly releases, but looking at what's been done for 1.9.4 (not much yet) this one will probably be later.  Probably either mid-week or even as late as next weekend.

Looks good, but there is one thing which came up while I was on a bus.

The maxCompletions setting.  I had to disable it because I want each of these contracts to come up no more than 1 or 2 times for each planet.  This was fine when I was generating those hundreds of contracts, but this revamp  means that it won't work, since a contract name can't be variable.

I just raised the issue (#446).  While I don't expect it for this release (although I would be thrilled if it was), please take a look and see how difficult it would be.

Edit:  I just realized that this would probably be done at the same time as #444, I would think it would be essentially use the same code internally

 

Thanks

Edited by linuxgurugamer
Link to comment
Share on other sites

27 minutes ago, nightingale said:

I've marked issue #420 for the 1.9.4 release.  I've gone through and pruned the list to what I think is actually achievable for that release, and moved other things into a 1.9.x release.  Those are ones that are uncertain - although it's possible they will be in 1.9.4, it's not very likely.  See the lists here:

1.9.4
1.9.x

@Steven Mading, @inigma, @severedsolo - you guys should probably have a look through those as well.  If there's anything that is on the 1.9.x list that you want to see in 1.9.4, then drop a note on the issue.  Similarly, if there's something in the 1.9.4 list that you raised (or I raised for you) that you can live without for a while, let me know (it'll drop to 1.9.x, but you will gain goodwill ;)).

I've been aiming for roughly weekly releases, but looking at what's been done for 1.9.4 (not much yet) this one will probably be later.  Probably either mid-week or even as late as next weekend.

#401 iterated spawnkerbals can wait. #149 neg rewards and penalties I consider a greater priority than #386 perm declinable contracts though they both go hand in hand with offering part unlock contracts for a price and declining them permanently if not wanted.

Link to comment
Share on other sites

13 minutes ago, inigma said:

#401 iterated spawnkerbals can wait. #149 neg rewards and penalties I consider a greater priority than #386 perm declinable contracts though they both go hand in hand with offering part unlock contracts for a price and declining them permanently if not wanted.

Thanks.  I've made some adjustments to the lists.

Link to comment
Share on other sites

4 hours ago, nightingale said:

@Steven MadingI@inigma@severedsolo Similarly, if there's something in the 1.9.4 list that you raised (or I raised for you) that you can live without for a while, let me know (it'll drop to 1.9.x, but you will gain goodwill ;)).

Issue #441 is one that was there specifically for what I needed, but to be honest if you find yourself short of time it can easily wait for 1.9.x.  I haven't looked at the contracts work for a few days now, and won't be able to until next week.  We're in the middle of a big refactor in kOS that once begun, must be continued out to the very end, and it percolates all through the system.  So that tied up my free programming time.

 

 

Link to comment
Share on other sites

After reading your comment on the new issue I raised, I've been looking at the uniquenessCheck:

(Optional, default = NONE) Whether (and how to check uniqueness of this value). Use this to prevent duplicate contracts (eg. for the same Kerbal, Vessel, etc.). This can check against contracts of the same type, or contracts in the same parent group. It can also check only active contracts or all contracts (to make it so a contract can only ever be completed once for the given value). The valid values are NONE, CONTRACT_ACTIVE, CONTRACT_ALL, GROUP_ACTIVE and GROUP_ALL.

So I'm a little puzzled and am looking for some explanations.  I've written here what I think they mean, can you confirm, deny or elaborate/correct:

  • NONE       Does not check for any uniqueness (ie:  multiple, duplicate contracts are allowed)
  • CONTRACT_ACTIVE       Checks the currently active contracts to be sure it is unique
  • CONTRACT_ALL       Checks all contracts (active and completed)
  • GROUP_ACTIVE       Checks all the contracts in the group which are active
  • GROUP_ALL       Checks all contract in the group (active and completed)

What needs to be unique is the identifier.

==================

So,I was thinking about how to do this (assuming what I wrote above is correct), and wanted to create a unique id based on joining (concating) two strings together.  I can't find any, and was wondering if this would work:

    DATA
    {
        type = String

        uniquenessCheck = GROUP_ALL
        requiredValue = true

        uid = FirstUnmannedFlyby:@STGUnmannedMissions:UnmannedMissionPlanet.Name()
    }

 

So, what this is supposed to do is to make sure that the uid will be generated to look like (using the Mun as an example):

     FirstUnmannedFlyby:Mun

and this data node will make sure that this will only allow this contract to be generated for the Mun once


 

Link to comment
Share on other sites

1 hour ago, linuxgurugamer said:

So I'm a little puzzled and am looking for some explanations.  I've written here what I think they mean, can you confirm, deny or elaborate/correct:

  • NONE       Does not check for any uniqueness (ie:  multiple, duplicate contracts are allowed)
  • CONTRACT_ACTIVE       Checks the currently active contracts to be sure it is unique
  • CONTRACT_ALL       Checks all contracts (active and completed)
  • GROUP_ACTIVE       Checks all the contracts in the group which are active
  • GROUP_ALL       Checks all contract in the group (active and completed)

What needs to be unique is the identifier.

Correct.  One thing just to be sure though, the CONTRACT_* values apply to all contracts of the same CONTRACT_TYPE.

1 hour ago, linuxgurugamer said:

So,I was thinking about how to do this (assuming what I wrote above is correct), and wanted to create a unique id based on joining (concating) two strings together.  I can't find any, and was wondering if this would work:


    DATA
    {
        type = String

        uniquenessCheck = GROUP_ALL
        requiredValue = true

        uid = FirstUnmannedFlyby:@STGUnmannedMissions:UnmannedMissionPlanet.Name()
    }

So, what this is supposed to do is to make sure that the uid will be generated to look like (using the Mun as an example):

     FirstUnmannedFlyby:Mun

and this data node will make sure that this will only allow this contract to be generated for the Mun once

Short answer: Yup, that will work (event for non-stock planets).  Can't remember how the colon (:) gets parsed - if you get any parse issues, try a space instead.

Long answer: It's probably more than what you need.  This same check will do the same thing (only allow the given contract type to be offered once per Celestial Body):

    DATA
    {
        type = CelestialBody

        uniquenessCheck = CONTRACT_ALL
        requiredValue = true

        uid = @/targetBody
    }

Now, if you wanted something more complex that isn't directly tied to a contract type, then you'd need to do it the way you showed.  For example you could use it if you had two contracts that were variants on the same theme, but only wanted the player to be able to do one of them (for example, one contract for landing at a specific location, and another for landing at a bunch of specific biomes).


5 hours ago, Steven Mading said:

Issue #441 is one that was there specifically for what I needed, but to be honest if you find yourself short of time it can easily wait for 1.9.x.  I haven't looked at the contracts work for a few days now, and won't be able to until next week.  We're in the middle of a big refactor in kOS that once begun, must be continued out to the very end, and it percolates all through the system.  So that tied up my free programming time.

I'll tentatively leave it in 1.9.4, but that'll probably be the first one to slip if I run low on time. :)

Edited by nightingale
Link to comment
Share on other sites

So, I have the following contract group:

 

CONTRACT_GROUP
{
trace = true
    // Name of the contract group
    name = STGUnmannedMissions
    displayName = Unmanned Missions

    // Use this to specify the minimum version of Contract Configurator
    // That is required to run contracts in this group.
    minVersion = 1.9.3

    // The maximum number of times that contracts within this contract
    // group can be completed (0 being unlimited).
    // Default = 0
    // maxCompletions = 3

    // The maximum instances of this contract within this contract group
    // that can be active at one time (0 being unlimited).
    // Default = 0
    maxSimultaneous = 4
    
      DATA
      {
          type = bool
        
          homeIsMoon = HomeWorld().IsMoon()
      }    
    DATA
    {
        type = double

        sma = @/homeIsMoon? HomeWorld().Parent().SemiMajorAxis() : HomeWorld().SemiMajorAxis()
        outerTargetSMA = @/sma * 1.55
        innerTargetSMA = @/sma * 0.66
    }


    DATA
    {
        type = List<CelestialBody>
        
          unreachedBodies = AllBodies().ExcludeAll(ReachedBodies())

        // uniqueValue = true
  
        outerPlanets1 = AllBodies().Where(cb => (cb.SemiMajorAxis() > @/outerTargetSMA) &&  cb.IsPlanet() )
          outerMoons = AllBodies().Where(cb => cb.IsMoon() && cb.Parent().SemiMajorAxis() > @/outerTargetSMA)
          outerPlanets = @/outerPlanets1.Concat(@/outerMoons)
        
        innerPlanets1 = AllBodies().Where(cb => (cb.SemiMajorAxis() < @/innerTargetSMA) && cb.IsPlanet())
          innerMoons = AllBodies().Where(cb => cb.IsMoon() && cb.Parent().SemiMajorAxis() < @/innerTargetSMA)
          innerPlanets = @/innerPlanets1.Concat(@/innerMoons)
        
          validBodies = AllBodies().Where(cb => (cb.IsPlanet() || cb.IsMoon()) && cb != HomeWorld())

          easyPlanets1 = @/validBodies.Where(cb => cb == (HomeWorld().IsMoon() ? HomeWorld().Parent() : HomeWorld() ) )
          easyPlanets2 = @/validBodies.Where(cb => @/homeIsMoon ? cb.Parent() == HomeWorld().Parent() : HomeWorld().Children().Contains(cb))
          easyPlanets = @/easyPlanets2.Concat(@/easyPlanets1).Exclude(HomeWorld())

          // If any moon has been reached, then allow contracts for the medium planets
          mediumPlanets1 = AllBodies().ExcludeAll(@/innerPlanets).ExcludeAll(@/outerPlanets)

// Only the following values seem to get stored

          mediumPlanets =  @/moonsReached ? @/mediumPlanets1 : @/easyPlanets

          // If any of the medium planets have been reached, then hard planets are the rest of the system
          hardPlanets=  @/mediumPlanetsReached ? AllBodies().ExcludeAll(@/easyPlanets).ExcludeAll(@/mediumPlanets) : @/mediumPlanets
        
      }

When I look at the log to see the values of what is being stored, I don't see ANY of the values before the mediumPlanets.

But there aren't any errors shown

I have the tracing on for all of these contracts.  They aren't behaving because (I think) the above values aren't working.

 

Any ideas?

 

Link to comment
Share on other sites

4 minutes ago, linuxgurugamer said:

So, I have the following contract group:

 


CONTRACT_GROUP
{
trace = true
    // Name of the contract group
    name = STGUnmannedMissions
    displayName = Unmanned Missions

    // Use this to specify the minimum version of Contract Configurator
    // That is required to run contracts in this group.
    minVersion = 1.9.3

    // The maximum number of times that contracts within this contract
    // group can be completed (0 being unlimited).
    // Default = 0
    // maxCompletions = 3

    // The maximum instances of this contract within this contract group
    // that can be active at one time (0 being unlimited).
    // Default = 0
    maxSimultaneous = 4
    
      DATA
      {
          type = bool
        
          homeIsMoon = HomeWorld().IsMoon()
      }    
    DATA
    {
        type = double

        sma = @/homeIsMoon? HomeWorld().Parent().SemiMajorAxis() : HomeWorld().SemiMajorAxis()
        outerTargetSMA = @/sma * 1.55
        innerTargetSMA = @/sma * 0.66
    }


    DATA
    {
        type = List<CelestialBody>
        
          unreachedBodies = AllBodies().ExcludeAll(ReachedBodies())

        // uniqueValue = true
  
        outerPlanets1 = AllBodies().Where(cb => (cb.SemiMajorAxis() > @/outerTargetSMA) &&  cb.IsPlanet() )
          outerMoons = AllBodies().Where(cb => cb.IsMoon() && cb.Parent().SemiMajorAxis() > @/outerTargetSMA)
          outerPlanets = @/outerPlanets1.Concat(@/outerMoons)
        
        innerPlanets1 = AllBodies().Where(cb => (cb.SemiMajorAxis() < @/innerTargetSMA) && cb.IsPlanet())
          innerMoons = AllBodies().Where(cb => cb.IsMoon() && cb.Parent().SemiMajorAxis() < @/innerTargetSMA)
          innerPlanets = @/innerPlanets1.Concat(@/innerMoons)
        
          validBodies = AllBodies().Where(cb => (cb.IsPlanet() || cb.IsMoon()) && cb != HomeWorld())

          easyPlanets1 = @/validBodies.Where(cb => cb == (HomeWorld().IsMoon() ? HomeWorld().Parent() : HomeWorld() ) )
          easyPlanets2 = @/validBodies.Where(cb => @/homeIsMoon ? cb.Parent() == HomeWorld().Parent() : HomeWorld().Children().Contains(cb))
          easyPlanets = @/easyPlanets2.Concat(@/easyPlanets1).Exclude(HomeWorld())

          // If any moon has been reached, then allow contracts for the medium planets
          mediumPlanets1 = AllBodies().ExcludeAll(@/innerPlanets).ExcludeAll(@/outerPlanets)

// Only the following values seem to get stored

          mediumPlanets =  @/moonsReached ? @/mediumPlanets1 : @/easyPlanets

          // If any of the medium planets have been reached, then hard planets are the rest of the system
          hardPlanets=  @/mediumPlanetsReached ? AllBodies().ExcludeAll(@/easyPlanets).ExcludeAll(@/mediumPlanets) : @/mediumPlanets
        
      }

When I look at the log to see the values of what is being stored, I don't see ANY of the values before the mediumPlanets.

But there aren't any errors shown

I have the tracing on for all of these contracts.  They aren't behaving because (I think) the above values aren't working.

 

Any ideas?

 

Where are you looking?  In the debug menu?  Can you post a screenshot?  What do you mean by before the medium Planets?  You can see hardPlanets?

Edited by nightingale
Link to comment
Share on other sites

52 minutes ago, nightingale said:

Where are you looking?  In the debug menu?  Can you post a screenshot?  What do you mean by before the medium Planets?  You can see hardPlanets?

In the log file output_log.txt

Here is a link to the log file:  https://drive.google.com/file/d/0Bzid7e3pW1k7clkyRkxsQ1VjWW8/view?usp=sharing

 

I search for the text strings "storing easyPlanets", nothing there.  Search for "storing mediumPlanets", and you find it, etc.

Link to comment
Share on other sites

22 minutes ago, linuxgurugamer said:

In the log file output_log.txt

Here is a link to the log file:  https://drive.google.com/file/d/0Bzid7e3pW1k7clkyRkxsQ1VjWW8/view?usp=sharing

 

I search for the text strings "storing easyPlanets", nothing there.  Search for "storing mediumPlanets", and you find it, etc.

Don't count on the log file for stuff like that - I have no idea what I actually write to the log for data nodes, and not all expressions get stored (typically only stuff that is needed to be saved for uniqueness checks).  Also, some values are deterministic (parsed/executed at KSP load time) and others are non-deterministic (executed each time a contract is generated).  Look at what showing in the debug menu:

http://i.imgur.com/M9g0Jlb.pngM9g0Jlb.png

Mouse over the applicable CONTRACT_TYPE node, and slide over to the right.  Near the bottom should be all the DATA node elements for the contract, and their last value (the value from either the initial parse, or the last time it attempted to generate a contract.

Link to comment
Share on other sites

55 minutes ago, severedsolo said:

I hope that's your dev KSP build :D you are about 3 patches behind on KSS.

GAP too, don't tell @inigma.

Actually, usually I rely on KSP-AVC.  I'm not getting KSS notifications because I'm probably on the wrong "stream" and need to just reinstall the correct one.  And GAP doesn't support KSP-AVC.  You need to get on that, @inigma.... :)

Link to comment
Share on other sites

1 minute ago, nightingale said:

GAP too, don't tell @inigma.

Actually, usually I rely on KSP-AVC.  I'm not getting KSS notifications because I'm probably on the wrong "stream" and need to just reinstall the correct one.  And GAP doesn't support KSP-AVC.  You need to get on that, @inigma.... :)

it's on the  um... radar...

Link to comment
Share on other sites

I had this insane idea to consider decoupling the Kerbin-centric GAP contracts from the non-Kerbin centric contracts as part of a solution for RSS compatibility. Insane because it means GAP goes modular (or maybe that's a sane thing?)

But along the lines of decoupling, which has nothing relevant to do with my question here, I was wondering about your Requirement SplashDown: does. Is it checking if the player has at anytime simply reached the water with a Splashed ReachState (preferred) or is it more complicated than that?

Edited by inigma
Link to comment
Share on other sites

20 minutes ago, inigma said:

I had this insane idea to consider decoupling the Kerbin-centric GAP contracts from the non-Kerbin centric contracts as part of a solution for RSS compatibility. Insane because it means GAP goes modular (or maybe that's a sane thing?)

Doesn't sound terrible - you can even keep delivering them all together and just use a ModuleManager line of CONTRACT_TYPE:NEEDS[!RealSolarSystem].  That way you don't even need to really be all that modular (although I'm sure that can cause other problems in your progression).

21 minutes ago, inigma said:

But along the lines of decoupling, which has nothing relevant to do with my question here, I was wondering about your Requirement SplashDown: does. Is it checking if the player has at anytime simply reached the water with a Splashed ReachState (preferred) or is it more complicated than that?

Nothing of the sort.  It checks whether the player hit the splashdown progress node in KSP's progress tracking.  It's one of those things that is 99% stock KSP, so I just assume works.

Link to comment
Share on other sites

8 hours ago, inigma said:

I had this insane idea to consider decoupling the Kerbin-centric GAP contracts from the non-Kerbin centric contracts as part of a solution for RSS compatibility. Insane because it means GAP goes modular (or maybe that's a sane thing?)

Well it would probably be best for CCF support, too. Having clear delineations between contract packs seems to me like the best way to go.

Link to comment
Share on other sites

@nightingale

Any reason why the following:

        PARAMETER
        {
            name = PartValidation
            type = PartValidation
            title = not have any solid rocket motors

            FILTER
            {
                partModule = ModuleEngines
            
            }
            
            NONE
            {
                EngineType = SolidBooster
            }

            hideChildren = true
            
        }

fails to complete when rocket engines or monoprop engines are used, and not just solid rocket motors, but passes when regular air breathing engines including the RAPIER are used?

 

How best to require a craft not to have solid rocket motors, but allow for any other engine type?

 

edit: it seems all the engines that fail have in common the partModule ModuleEngines. and all the engines that pass have the partModule ModuleEnginesFX. It seems then the filter is looking for all parts with ModuleEngines, but not checking the NONE parameter. Correct?

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