Jump to content

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


nightingale

Recommended Posts

@Aelfhe1m

 

Thanks very much dude.. I will defiantly keep in mind the white space thing, going through all your fixes I started from the bottom first (cos I'm sooo random :P ) and turns out the data node was the only thing I needed to remove :wink:
No idea as to the reason why yet.. just doing stuff and seeing what happens.. I'll figure correlation at some point :D

next "issue" that I am honestly not sure if it is even doable or not.. so I want the player to kill Jeb.. horrific I know, But I have had enough of his front seat jumping ways.

In the params I thought I could make this happen by having a NOT param around the HasAstronaught unfortunately this just gives me the standard kill jeb to lose scenario, the opposite of what I want
any ideas on how to do this?

Edit : small caffeine break inspired me to try this without the "completeInSequence = true" despite the wiki saying this is important..  its not, it does in fact stop it working as I intended :wink:

Edited by Twitchi
Link to comment
Share on other sites

I'm looking at the RP-0 (v0.54) "LifeSupportStation".  I have two stations in my career game: Skylab orbiting Earth and Salyut-7 orbiting the Moon.  The Salyut-7 station is currently unoccupied and has at least 75% of it's starting life support resources, but my Skylab station is starting to run low.  Right now it's down to 16% food, 30% water and 77% oxygen.  But the "LifeSupportStation" contract will not come up as an option.  So I pulled up the contract to try and figure out what the issue was.  I'm pretty sure I see the first problem.  There is a DATA type setup as follows:

 DATA
 {
  type = Vessel
  requiredValue = true
  uniquenessCheck = GROUP_ACTIVE
  targetVessel1 = AllVessels().Where(v => v.VesselType() == Station && v.FreeDockingPorts()>0 && (v.ResourceCapacity(Food) / v.ResourceQuantity(Food))>0.26 || (v.ResourceCapacity(Water) / v.ResourceQuantity(Water))>0.26 || (v.ResourceCapacity(Oxygen) / v.ResourceQuantity(Oxygen))>0.26).SelectUnique()
  title = Must have an open Docking Port and 25% or less of Life Support Supplies
 }

The v.ResourceCapcity() and v.ResourceQuantity() pieces are wrong, I believe.  As written, if the food capacity of my station is 5000 and I currently have 500 food, that's going to give a result of 5000 / 50 which is 100 and therefore "100 > 0.26" would absolutely be true.  I'm pretty sure it needs to be rewritten as (v.ResourceQuantity()\v.ResourceCapacity()) < 0.26.  However, when I do that, both stations become viable options and the amount of resources I'm supposed to being is always 0. 

There is a second DATA section which is supposed to calculate the amount of life support resources you need to take with you to complete the contract:

 DATA
 {
  type = int
  foodSpace = Round(@/targetVessel1.ResourceCapacity(Food) - @/targetVessel1.ResourceQuantity(Food))
  waterSpace = Round(@/targetVessel1.ResourceCapacity(Water) - @/targetVessel1.ResourceQuantity(Water))
  oxygenSpace = Round(@/targetVessel1.ResourceCapacity(Oxygen) - @/targetVessel1.ResourceQuantity(Oxygen))
  title = Get empty space for Life Support
 }

No matter what I do, those three variables (foodSpace, waterSpace and oxygenSpace) are always set to 0.  I've tried changing the DATA type to double since that is apparently what ResourceCapacity and ResourceQuantity are supposed to return but that had no effect.  I tried removing the Round() function but that didn't help.  I'm assuming that the first DATA type is actually getting some kind of results for ResourceCapacity and ResourceQuantity since the contract doesn't return a divide by 0 error.  Can you take a look at this contract and see what might be the problem?

Link to comment
Share on other sites

Hey guys.. so I have a situation where all the conditions are met for my contract to be offered, but alas I still am not able to take them. I used to think the cooldownDuration on the CompleteContract requirement might be to blame for this but  after playing about have been convinced this is not so

A bit of forum searching points me to some mythical RNG based selection process turning over in the background.. but is there any way to over ride this and make it immediately available?

I'm typing this before going  to bed and don't have the time to check right now but would turning off the other contracts (I forget which flag turns off contact  groups right now) and having very few contracts to choose from be a dirty  way to make this happen?

Thanks for any assistance :wink:
 

Edited by Twitchi
forgot my manners :P
Link to comment
Share on other sites

I've noticed that anytime there is an error in the scripting of a Contract Pack cfg file, the Contract Configurator goes ballistic with null refs and then starts randomly showing and hiding many contracts about every 5 seconds.

 

One of my Contract Packs' contracts includes the following which causes it to go haywire. Does anyone know what's wrong with this line?
targetBody1 = ReturnedFromBodies().Where(body => @/stations.Where(v => v.CelestialBody() == body).Count() == 0).SelectUnique()

 

    DATA
    {
        title = Find the stations
        stations = AllVessels().Where(v => v.VesselType() == Station)
        requiredValue = false
        type = List<Vessel>
    }

 

The programmer in me says that Contract.stations is null when the player has not created any spacestations yet (instead of being a 0 count list), thus trying to execute a linq Where clause on it causes a nullref, but I've no experience with making contracts for CC, so perhaps that is not the case?

Edited by Electrocutor
Link to comment
Share on other sites

I'm having a similar problem, the contracts UI is very active, contracts are jumping in and out, I can occasionally click on them but sometimes can't accept them, even stock ones. The explore minmus one time to expire also counted down really fast. I have a lot of mods, but ScanSat and ReasearchBodies are the only two in the CC settings. I'm also on Linux so this could be a "punctuation matters" kind of an error in a pack.

Link to comment
Share on other sites

This latest Contract Configurator seems to collide with the way upgrade levels and Strategia mix up.

On level 1 Administration permits 2 strategies at a time. Without installing this mod here and entering Administration of course you see no contracts but in the lower half of the window there are 2 strategies permitted. Installing that required mod Contract Configurator here, leads to only one permitted strategy, although the upgrade level still suggests 2 strategies. 

 

Is this known to anyone? Unfortunately I can not say, how this works with KSP 1.3.0. Earlier with KSP 1.2.2 it worked as expected.

Edited by New Horizons
Link to comment
Share on other sites

    DATA
    {
        type = List<Vessel>
		requiredValue = false
        stations = AllVessels().Where(v => v.VesselType() == Station)
		title = Find the stations
    }
	
    DATA
    {
        type = CelestialBody
        requiredValue = false
        uniquenessCheck = CONTRACT_ACTIVE
        targetBody1 = ReturnedFromBodies().Where(body => @/stations.Where(v => v.CelestialBody() == body).Count() == 0).SelectUnique()
		title = Must have returned from a Celestial Body, but not have any stations deployed.
    }

NullReferenceException: Object reference not set to an instance of an object
    ContractConfigurator.ExpressionParser.CelestialBodyParser.CheckTree (KSPAchievements.CelestialBodySubtree tree, ProgressItem pi)

...

Rethrow as Exception: Error parsing statement.
    Error occurred near '*':
    ReturnedFromBodies().Where(body => @/stations.Where(v => v.CelestialBody() == body).Count() == 0).SelectUnique()
    ....................* <-- HERE

 

If we assume that all LINQ Where clauses will return a list of count 0, the problem has to be that ReturnedFromBodies() is returning null instead of an empty list, right?

Link to comment
Share on other sites

On 11/1/2017 at 7:25 PM, gamerscircle said:

I think this is a known issue -
There are contracts "stock I believe" that when I accept them, I see them at the space center [after leaving mission control] but when I go to another scene, that contract disappears.  I do have a couple of other contract mods.

Is there something that I need to do, in order to retain that stock contract or?

My apologies for not keeping up.

I didn't see any reply or query to this...  I did go back and read through the last 4 pages of the forums and did not see anything similar.

Link to comment
Share on other sites

On 11/6/2017 at 10:19 AM, Waxing_Kibbous said:

I'm having a similar problem, the contracts UI is very active, contracts are jumping in and out, I can occasionally click on them but sometimes can't accept them, even stock ones. The explore minmus one time to expire also counted down really fast. I have a lot of mods, but ScanSat and ReasearchBodies are the only two in the CC settings. I'm also on Linux so this could be a "punctuation matters" kind of an error in a pack.

It looks like my issue is caused by Research Bodies and/or Kerbal Health, if I remove one  things are normal. I'm curious if other people with issues are also using RB/KH.

Edited by Waxing_Kibbous
Link to comment
Share on other sites

21 hours ago, gamerscircle said:

I didn't see any reply or query to this...  I did go back and read through the last 4 pages of the forums and did not see anything similar.

Make sure the contract actually still exists when you click accept. There is a very annoying bug that makes contracts appear and disappear randomly (sometimes very rapidly). If your contract happened to have disappeared at the moment when you clicked accept, it will not have actually been accepted. Even when a contract disappears, it still stays showing in the right pane if you had clicked on it earlier.

Edited by Electrocutor
Link to comment
Share on other sites

3 hours ago, Electrocutor said:

Make sure the contract actually still exists when you click accept. There is a very annoying bug that makes contracts appear and disappear randomly (sometimes very rapidly). If your contract happened to have disappeared at the moment when you clicked accept, it will not have actually been accepted. Even when a contract disappears, it still stays showing in the right pane if you had clicked on it earlier.

 

1.) Go to mission control - accept contact
2.) Exit mission control, check at the Space Center - contract is still listed
3.) Enter VAB, check for contract - no longer available

Link to comment
Share on other sites

4 minutes ago, gamerscircle said:

 

1.) Go to mission control - accept contact
2.) Exit mission control, check at the Space Center - contract is still listed
3.) Enter VAB, check for contract - no longer available

I've not seen or heard of a disappearing bug like that mentioned anywhere; only odd completions and failures. If it happens again, I'd say grab your KSP.log and if not a stock contract, the log for the contract pack under GameData/ContractConfigurator/log; then drop them along with a description into https://github.com/jrossignol/ContractConfigurator/issues.

Link to comment
Share on other sites

On 12-11-2017 at 8:16 PM, Electrocutor said:

I've not seen or heard of a disappearing bug like that mentioned anywhere; only odd completions and failures. If it happens again, I'd say grab your KSP.log and if not a stock contract, the log for the contract pack under GameData/ContractConfigurator/log; then drop them along with a description into https://github.com/jrossignol/ContractConfigurator/issues.

I have the same problem. I don't use this mod tho. But my contracts are disappearing too whenever I go back to the VAB or the launchpad. Sometimes it does work, so it's hard to find which mod this causes.

Link to comment
Share on other sites

On 11/12/2017 at 10:26 AM, Electrocutor said:

Make sure the contract actually still exists when you click accept. There is a very annoying bug that makes contracts appear and disappear randomly (sometimes very rapidly). If your contract happened to have disappeared at the moment when you clicked accept, it will not have actually been accepted. Even when a contract disappears, it still stays showing in the right pane if you had clicked on it earlier.

I'll have to dig back through posts at the end of 2016 / start of 2017, but a lot of that is caused by contracts that are not written properly.  For instance, there's a good way and a bad way to calculate the target body for your contract.  Do it the bad way and CC will be constantly recalculating until it finds a contract.

I've never had the issue with ResearchBodies contracts, but whichever contract pack that I use for ScanSAT and Bases & Stations have the issue.

(I remember having to work through the issue when I was putting together Stock Antenna Balance contracts.)

Edit 1: If you're digging through the post history, it's somewhere prior to page 150 where this is talked about it.  I haven't found it yet, but I know it's discussed in this thread.  Or maybe on the wiki...

Edit 2: It's this post that distills some wisdom on how to properly pick a random target.

 

Edited by WuphonsReach
Link to comment
Share on other sites

I've been having problems in recent version where Contract Configurator is expecting an integer for the last random seed and it is receiving a float.   This is triggering an NRE, at least on Linux.

I can isolate it, get a bug report, and make sure it is contract configurator and not a mod conflict..  Do you know a specifically "Clean" contract set I should use to test it?

Link to comment
Share on other sites

  • 2 weeks later...
On 05.11.2017 at 7:20 PM, Jalaris said:

I've found a bug: the launch your first vessel and gather scientific data from kerbin contracts no longer work with seti-contracts installed. You can see them, and you can accept them, but when you go to the VAB or launchpad, they disappear entirely and go back to the mission giver.

Hi there!

I'm having the same problem:

Contracts of "Kerbal World Record-Keeping Society" like "Launch your First vehicle", "Gather Scientific data from Kerbin", "Explore Kerbin" can be accepted in Mission Control, but they disappear and can not be completed, when entering VAB/SPC

Edited by Nik Power
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

I think this is actually a Historic Missions: Contract Pack issue, and I have asked over there, but I'm hoping someone here might know.  I'm playing 1.2.2 with RO/RSS/RP-0 and the Historic Missions pack.  So far everything has gone just fine but recently I've starting running low on useful available contracts.  I've currently got 5 active contracts (all 2 star) including Mariner 10, Viking 2 and STS-41B (all from historic missions).  I've completed all the Apollo contracts, the ASTP contract, the Helios NASA contract as well as the first four Space Shuttle contracts.  But I've never been offered the Pioneer 10 & 11 contracts, nor the Voyager 1& 2 contracts.  As far as I can tell, I meet all the prerequisites to get those contracts, but they don't show in the list.  Anyone have any idea what the issue might be?

Link to comment
Share on other sites

1 hour ago, inigma said:

How can I set multiple needs to check for AirplanePlus and TweakScale?

CONTRACT_TYPE:NEEDS[AirplanePlus]
{

 

I can check for one, but how do I add a second check?

Think you do NEEDS:[AirplanePlus,TweakScale,OtherMod,OtherMod] (I believe commas mean "AND" in context...)

Link to comment
Share on other sites

Question 1:

Looking to build a contract that says "you must produce X units of Y" (and tracks how many units you have produced/consumed since acceptance of the contract).  Very similar to the stock "RESOURCE_REQUEST {}" contracts, but done through CC.

We have "HasResource" and "ResourceConsumption", but not something that tracks resource production over time (maybe "ResourcesConsumed"?).  I could sort of get there with combining "duration" and "ResourceConsumption".

Question 2:

Also have trouble with this bit of code:

Spoiler

DATA
{
type = string
title = What to harvest
harvestResource = Ore
}

PARAMETER
{
name = ResourceConsumption
type = ResourceConsumption
title = Harvest at least @/harvestRate units per second of @/harvestResource
resource = Resource(@/harvestResource)
minRate = @/harvestRate * -1
}    

 

Not sure the global function works: resource = Resource(@/harvestResource) 

Question 3:

Is there a way to create a list of resource types and pick one at random?

 

Edited by WuphonsReach
Link to comment
Share on other sites

On 11/14/2017 at 6:01 AM, damonvv said:

I have the same problem. I don't use this mod tho. But my contracts are disappearing too whenever I go back to the VAB or the launchpad. Sometimes it does work, so it's hard to find which mod this causes.

I have both this issue (I accept a contract in Mission Control, it shows up under the "Active" list, then go to the launchpad --> launch a ship, the contract no longer appears in my list) and the issue where contracts shuffle, appear, disappear, and change while in mission control. It's a constant thing. I tried it three times in a row with contracts asking me to rendezvous vessels in orbit of the Mun or Minmus - possibly from Exploration Plus? - and the same thing occurred each time.

Meanwhile, contracts constantly appear and disappear while in Mission Control - doesn't *seem* to be only certain contracts from certain packs, just a constant recalculation of what contracts are offered, or something.

Log: https://www.dropbox.com/s/13bfrfv30o4q9ur/output_logContractConfig.txt?dl=0

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