Jump to content

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


nightingale

Recommended Posts

Just tried the latest dll from the master branch and its struggling with the multiple ExperimenalPart section. Maybe I'm doing it wrong.

I have both my own code and the code copied from the wiki on using multiple parts, and the debug window is giving me this

65gpfg6.png


name = UnlockPart
type = ExperimentalPart


// The name of the part to unlock for the mission duration.
part = crewCabin
// part = probeCoreOcto2
// part = RCSTank1-2
// part = RCSBlock
// part = dockingPortLarge
// part = batteryBankLarge
// part = largeSolarPanel
}


BEHAVIOUR
{
name = ExperimentalPart
type = ExperimentalPart


// The name of the part to add/remove. Can be specified multiple
// times.
part = largeSolarPanel
part = cupola


// Whether the part should be added as an experimental part (when the
// contract is accepted). Also controls whether the part is removed
// if the contract fails or is withdrawn.
// Default = True
add = True


// Whether the part should be removed as an experimental part (when the
// contract completes successfully).
// Default = True
remove = True


}


    BEHAVIOUR    {

Edited by DBT85
Link to comment
Share on other sites

Just tried the latest dll from the master branch and its struggling with the multiple ExperimenalPart section. Maybe I'm doing it wrong.

I have both my own code and the code copied from the wiki on using multiple parts, and the debug window is giving me this

http://i.imgur.com/65gpfg6.png


name = UnlockPart
type = ExperimentalPart


// The name of the part to unlock for the mission duration.
part = crewCabin
// part = probeCoreOcto2
// part = RCSTank1-2
// part = RCSBlock
// part = dockingPortLarge
// part = batteryBankLarge
// part = largeSolarPanel
}


BEHAVIOUR
{
name = ExperimentalPart
type = ExperimentalPart


// The name of the part to add/remove. Can be specified multiple
// times.
part = largeSolarPanel
part = cupola


// Whether the part should be added as an experimental part (when the
// contract is accepted). Also controls whether the part is removed
// if the contract fails or is withdrawn.
// Default = True
add = True


// Whether the part should be removed as an experimental part (when the
// contract completes successfully).
// Default = True
remove = True


}


    BEHAVIOUR    {

Oops, thought that was fixed - I'll have a look.

Link to comment
Share on other sites

While making new contracts, I have 2 obstacles I m unable to tackle.

1. How do I "activate" a contract using module manager?

I want to make a contract system with different branches. And I want to be able to "activate" a branch based on the availability of a mod, or a combination of mods. Other mods should also be able to activate branches for themselves.

Is there something like an activation dummy variable I can include in contracts? eg


CONTRACT_TYPE
{
name = contract1

active = 0
}

That would mean, that contract1 is dormant.

Then I could make a mm config file which contains something like:


@CONTRACT_TYPE[contract1]:NEEDS[mod1]
{
@active = 1
}

Which would activate contract1 if mod1 is present.

Other mods could activate the contract themselves as well.

2. How do I implement a condition/parameter for unharmed return of Kerbals?

Basically I only want to see the contract fulfilled, if the Kerbals aboard the contract fulfilling craft are returned/recovered on Kerbin.

Thank you for your help!

Link to comment
Share on other sites

While making new contracts, I have 2 obstacles I m unable to tackle.

1. How do I "activate" a contract using module manager?

I want to make a contract system with different branches. And I want to be able to "activate" a branch based on the availability of a mod, or a combination of mods. Other mods should also be able to activate branches for themselves.

Is there something like an activation dummy variable I can include in contracts? eg


CONTRACT_TYPE
{
name = contract1

active = 0
}

That would mean, that contract1 is dormant.

Then I could make a mm config file which contains something like:


@CONTRACT_TYPE[contract1]:NEEDS[mod1]
{
@active = 1
}

Which would activate contract1 if mod1 is present.

Other mods could activate the contract themselves as well.

Closest I would suggest is setting weight to zero, and then setting it to 1 (the default value) in your module manager config. Of course, I checked, and I have validation for (weight > 0.0). I've already made the change in dev to make it >= 0.0 instead, that'll be released with 0.6.0. That should be out by.... Sunday (maybe?). In the meantime if you set it to 1.0E-300 it'll be effectively zero.

2. How do I implement a condition/parameter for unharmed return of Kerbals?

Basically I only want to see the contract fulfilled, if the Kerbals aboard the contract fulfilling craft are returned/recovered on Kerbin.

Hmmm, depends on what you're willing to accept. Issue #108 would've probably been the closest bet, and was originally intended for 0.6.0. But I had to change the contract pack that's coming out with the release mid-way and didn't need this parameter (yet), so it got pushed out. In the meantime, if you're willing to live with it, the closest I would suggest is:

  1. Use a VesselParameterGroup to set the conditions (including the crew requirements) and define the vessel.
  2. Use a second VesselParameterGroup to set the "home" conditions, as well as re-stating the crew requirements.

Here's an example (untested, but should work):


// Land 3 pilots on the Mun
PARAMETER
{
name = VesselParameterGroup1
type = VesselParameterGroup

define = Mun Lander

PARAMETER
{
name = ReachState
type = ReachState

situation = LANDED
targetBody = Mun
}

PARAMETER
{
name = HasPilots
type = HasCrew

// (Optional) The type of trait required. Valid values are:
// Pilot
// Engineer
// Scientist
trait = Pilot

minCrew = 3
}
}

// Bring 3 pilots home
PARAMETER
{
name = VesselParameterGroup1
type = VesselParameterGroup

vessel = Mun Lander

PARAMETER
{
name = ReachState
type = ReachState

situation = LANDED
targetBody = Kerbin
}

PARAMETER
{
name = HasPilots
type = HasCrew

// (Optional) The type of trait required. Valid values are:
// Pilot
// Engineer
// Scientist
trait = Pilot

minCrew = 3
}
}

This requires the player to go to the Mun with 3 pilots, and then bring the ship back to Kerbin, and have 3 pilots. This contract doesn't enforce that they are the same 3 pilots, so hypothetically a player could leave them behind and replace them with a different crew (but that might be harder than doing it the right way). Anyway, if you're willing to live with that loophole, this could be your solution. If not #108 may help a little... but no guarantees (and no timeline either... probably not for at least a month).

Thank you for your help!

Always happy to help!

Link to comment
Share on other sites

Updating to 0.5.12 caused me to lose all my active "custom" contracts in my current save. The standard/stock contracts were still there. I had a backup, so no big deal, but it might be worth including a warning about it in the first post.

Edited by Kedwin Hubble
Link to comment
Share on other sites

Updating to 0.5.12 caused me to lose all my active "custom" contracts in my current save. The standard/stock contracts were still there. I had a backup, so no big deal, but it might be worth including a warning about it in the first post.

That was not expected at all - I assume you went from 0.5.11 to 0.5.12? There really was very little that changed. Is it possible that you started up KSP with 0.5.11 and SCANsat 10 before 0.5.12 was out or before you updated? That I can see causing problems.

YESSSSS :) Can I show an image on one of the sides of the artifact?

Not my model - comes courtesy of Nicholander - see this thread. So if you want to change it (or have someone else change it), then he's your man.

Quick question - looking at the wiki it seems that ReachState has replaced ReachSituation ?

If so, will ReachSituation still work?

ReachSituation will still work... for now. It will likely disappear in 0.7.0, so stop using it! Changing to ReachState is easy - just rename the parameter, since ReachState supports all the attributes from the parameters it replaces.

- - - Updated - - -

Also, for Kedwin Hubble - any chance you can provide logs?

Link to comment
Share on other sites

Not my model - comes courtesy of Nicholander - see this thread. So if you want to change it (or have someone else change it), then he's your man.

Cool, and even better... Does this mean that I can display parts from any mod? I really reall really need to get cracking on that Vertical Propulsion Emporium contract set I keep mumbling about :)

Link to comment
Share on other sites

Cool, and even better... Does this mean that I can display parts from any mod? I really reall really need to get cracking on that Vertical Propulsion Emporium contract set I keep mumbling about :)

Well, what I did is I included the monolith part (with permission) in the upcoming contract pack. I built a vessel using it, and created it in-game using the SpawnVessel behaviour (new for 0.6.0).

For the Vertical Propulsion Emporium you'd ideally want to use module manager to make VPE a dependency on your contracts loading. With that you can just assume it's there and use their parts in PartValidator or in vessels for SpawnVessel with impunity.

Link to comment
Share on other sites

That was not expected at all - I assume you went from 0.5.11 to 0.5.12? There really was very little that changed. Is it possible that you started up KSP with 0.5.11 and SCANsat 10 before 0.5.12 was out or before you updated? That I can see causing problems. [snip] Also, for Kedwin Hubble - any chance you can provide logs?

I did indeed go from 0.5.11 to 0.5.12. There was a point when I loaded the game with SCANsat 10 and CC 0.5.11, but at the time the contracts disappeared, I had SCANsat 10 and CC 0.5.12. It was actually pretty strange what ended up happening. I apologize for not including logs originally, it was very late at night and I was having a number of frustrating KSP issues and forgot to grab them for you. Anyways, so what happened was, I had 15 active contracts in my save. I updated CC to 0.5.12 (and also updated several other mods: MKS and related dependencies, but I don't think this was related). I went to complete a "build an orbital station around Kerbin" contract and while deploying the station, I ran into two sticky docking port bugs. This resulted in many quicksave/quickloads trying to force the stuck docking ports apart. I finally got them apart and completed the contract. My command module that deployed the station splashed down back on Kerbin. At this point, I quicksave to make sure I have a save with my deployed station. I recover the pod, which brings me back to the KSC home screen. I click the mission control building and when it loads I only have two active contracts (I should have had 14). Both active contracts are stock type contracts. I think to myself, "well something must have bugged updating CC, but oh well, I'll just take a bunch of new contracts." I accept a bunch of new contracts and then when I click to exit mission control to go back to the KSC, the game bugs out and I get stuck in mission control and clicking exit does nothing. So I alt-F4 out of the game. Later, I load KSP back up, and I have the 14 active contracts I should have had originally, my command pod I mentioned earlier is still splashed down, and it's like it never happened.

I then went on to continue playing as if it never happened. I'm not sure if logs are still helpful to you as I'm not sure what will have been overwritten because I've been playing since then. But here's a copy of my output log in case it's of any use.

Edited by Kedwin Hubble
Link to comment
Share on other sites

I did indeed go from 0.5.11 to 0.5.12. There was a point when I loaded the game with SCANsat 10 and CC 0.5.11, but at the time the contracts disappeared, I had SCANsat 10 and CC 0.5.12. It was actually pretty strange what ended up happening. I apologize for not including logs originally, it was very late at night and I was having a number of frustrating KSP issues and forgot to grab them for you. Anyways, so what happened was, I had 15 active contracts in my save. I updated CC to 0.5.12 (and also updated several other mods: MKS and related dependencies, but I don't think this was related). I went to complete a "build an orbital station around Kerbin" contract and while deploying the station, I ran into two sticky docking port bugs. This resulted in many quicksave/quickloads trying to force the stuck docking ports apart. I finally got them apart and completed the contract. My command module that deployed the station splashed down back on Kerbin. At this point, I quicksave to make sure I have a save with my deployed station. I recover the pod, which brings me back to the KSC home screen. I click the mission control building and when it loads I only have two active contracts (I should have had 14). Both active contracts are stock type contracts. I think to myself, "well something must have bugged updating CC, but oh well, I'll just take a bunch of new contracts." I accept a bunch of new contracts and then when I click to exit mission control to go back to the KSC, the game bugs out and I get stuck in mission control and clicking exit does nothing. So I alt-F4 out of the game. Later, I load KSP back up, and I have the 14 active contracts I should have had originally, my command pod I mentioned earlier is still splashed down, and it's like it never happened.

I then went on to continue playing as if it never happened. I'm not sure if logs are still helpful to you as I'm not sure what will have been overwritten because I've been playing since then. But here's a copy of my output log in case it's of any use.

Yeah, sounds like something went wrong in those contracts, and they buggered up the whole system. Don't think it's a problem specific to 0.5.12, but unfortunately there's not much to go on - the logs you provided weren't much help in this case.

Best I can say is to keep an eye out for this type of behaviour and throw the logs my way if you ever see it again.

Link to comment
Share on other sites

Contract Configurator 0.6.0 is out! The contract pack for this release will be a bit late... but what's holding it up isn't stuff that affects Contract Configurator itself, so I figured I'd get that release out now. Download it here!

​Contract Configurator 0.6.0

  • Added SpawnVessel behaviour.
  • Added ExperimentalPart behaviour.
  • Added Docking parameter.
  • Added TargetDestroyed parameter.
  • Added VesselNotDestroyed parameter.
  • Added VesselIsType parameter.
  • Added SCANsatLocationCoverage requirement.
  • Added Message behaviour.
  • Add situation filter to Orbit parameter.
  • Support for VALIDATION node in PartValidation to allow more terse validation for specific part recipes on a ship.
  • Added CONTRACT_GROUP and extra logic for limiting contracts based on group.
  • SCANsat coverage parameter now displays the current scan percentage.
  • Improvements to HasPassengers (loads real passengers!)
  • Fix to how contract expiry is handled - setting to 0.0 will now give a contract that never expires, similar to the way the deadline works.
  • New debugging window that shows the underlying configurator and allows selectively disabling parts of the contract for testing.
  • Can now add REQUIREMENT nodes as children to PARAMETER nodes.
  • Performance fixes for requirement checks.
  • Remove parameters that have been obsolete since Contract Configurator 0.5.0.

Biggest major feature was huge additions to the debugging window (alt-F10):

V8lMs9F.png

It gives the ability to:

  • view the contract types and the all parameters, behaviours and requirements
  • temporarily disable parts of the contract (useful for disabling requirements for testing)
  • view the underlying ConfigNode details
  • view the error/warning messages related to loading the contract type/parameters/behaviours/requirements

I'll need to update the screenshot, as it also shows a summary of how many contracts succeed loading out of the total.

There's the ability to view all contracts and the parameters within them,

Lots of other little changes, so play around with all the new stuff. Happy contracting!

Link to comment
Share on other sites

You can find my career save and logs on my one drive.

I made a log for the 0.5.12 and 0.6.0 version.

EDIT: Let me remove the background processing mod

I can also delete the contents of the log file after KSP is loaded. This might make the debugging easier.

I you can explain how i can attach the debugger to KSP, i am willing to see what happens :P

Edited by BlackSoldierB
Link to comment
Share on other sites

You can find my career save and logs on my one drive.

I made a log for the 0.5.12 and 0.6.0 version.

EDIT: Let me remove the background processing mod

I can also delete the contents of the log file after KSP is loaded. This might make the debugging easier.

I you can explain how i can attach the debugger to KSP, i am willing to see what happens :P

Just on my mobile right now, so I can't easily look at the logs. The part I'll need to see is loading up the 0.5.12 save game under 0.6.0 - so just make sure you don't trim that. ;)

Link to comment
Share on other sites

I also have the SCANsat and RemoteTech contract packs installed, updated from CC0.5.12 to CC0.6.0, and have lost active contracts.

I have verified the following is repeatable:

In the save file before load there are 3 offered contracts, 12 active contracts and 77 completed contracts before load.

Something goes wrong on save load.

Both the stock contact window and ContractWindowPlus3.2 show no active contracts.

Entering Mission Control shows 3 active contracts and zero completed contracts.

It appears that the first 4 contracts in the save file are loaded intact (one offered, 3 active, all stock).

The 5th contract in the save file is a SCANsat contract which was reset to offered and kept in the same order as save file.

The remaining contracts were lost and replaced with new offers (expect explore the moon which was offered before and after).

Returning to the SpaceCenter both contract windows still show no active contracts.

With a scene change both contract windows now show the 3 remaining active contracts.

Contracts in save file:

Survey - offered - remained

Satellite - active - remained

PartTest - active - remained

PartTest - active - remained

ScanSat - active - reset to offered

Station - active - lost

RTrelay - active - lost

Rescue - active - lost

Station - active - lost

Explore - offered - remained (first explore Mun contract)

Survey - offered - lost

Survey - active - lost

Satellite - active - lost

Satellite - active - lost

PartTest - active - lost

77 various completed - lost & removed from save file

log and save files:

https://dl.dropboxusercontent.com/u/61115544/KSP%20-%20ContractConfigurator0.6.0%20update.log.zip

Link to comment
Share on other sites

Just on my mobile right now, so I can't easily look at the logs. The part I'll need to see is loading up the 0.5.12 save game under 0.6.0 - so just make sure you don't trim that. ;)

Got it, I see the problem. Raised #120 on github. It should only affect contracts in saves upgrades to 0.5.12. After the issue occurs if you accept new contracts there won't be a problem. I'll get a fix out as soon as I can, but likely won't be until this afternoon.

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