Jump to content

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


nightingale

Recommended Posts

Ok - further testing has given good results. It's working, I think, but I have it working two ways and would welcome thoughts on which to use.

First - the testing. I used four contracts to test with, the differences should be semi obvious :

////////////////////////////

CONTRACT_TYPE

{

name = TESTA1

title = TESTA1

description = TESTA1

notes = Complete the following:

synopsis = TESTA1

completedMessage = TESTA1

agent = Kerbin World-Firsts Record-Keeping Society

cancellable = false

declinable = false

prestige = Trivial

targetBody = Minmus

maxCompletions = 1

rewardScience = 100.0

rewardReputation = 20.0

rewardFunds = 100000.0

advanceFunds = 10000.0

weight = 99.0

PARAMETER

{

name = VesselParameterGroupA

type = VesselParameterGroup

define = Landermission

PARAMETER

{

name = HasCrewA1

type = HasCrew

trait = Pilot

minCrew = 1

}

PARAMETER

{

name = ReachStateA1

type = ReachState

situation = LANDED

completeInSequence = true

disableOnStateChange = true

}

PARAMETER

{

name = PlantFlagA1

type = PlantFlag

targetBody = Minmus

completeInSequence = true

}

PARAMETER

{

name = ReturnHomeA1

type = ReturnHome

vessel = Landermission

completeInSequence = true

}

}

}

////////////////////////////

////////////////////////////

CONTRACT_TYPE

{

name = TESTB1

title = TESTB1

description = TESTB1

notes = Complete the following:

synopsis = TESTB1

completedMessage = TESTB1

agent = Kerbin World-Firsts Record-Keeping Society

cancellable = false

declinable = false

prestige = Trivial

targetBody = Minmus

maxCompletions = 1

rewardScience = 100.0

rewardReputation = 20.0

rewardFunds = 100000.0

advanceFunds = 10000.0

weight = 99.0

PARAMETER

{

name = VesselParameterGroupB1

type = VesselParameterGroup

PARAMETER

{

name = HasCrewB1

type = HasCrew

trait = Pilot

minCrew = 1

}

PARAMETER

{

name = ReachStateB1

type = ReachState

situation = LANDED

completeInSequence = true

disableOnStateChange = true

}

PARAMETER

{

name = PlantFlagB1

type = PlantFlag

targetBody = Minmus

}

PARAMETER

{

name = ReturnHomeB1

type = ReturnHome

completeInSequence = true

}

}

}

////////////////////////////

////////////////////////////

CONTRACT_TYPE

{

name = TESTA2

title = TESTA2

description = TESTA2

notes = Complete the following:

synopsis = TESTA2

completedMessage = TESTA2

agent = Kerbin World-Firsts Record-Keeping Society

cancellable = false

declinable = false

prestige = Trivial

targetBody = Minmus

maxCompletions = 1

rewardScience = 100.0

rewardReputation = 20.0

rewardFunds = 100000.0

advanceFunds = 10000.0

weight = 99.0

PARAMETER

{

name = VesselParameterGroupA21

type = VesselParameterGroup

PARAMETER

{

name = VesselParameterGroupA22

type = VesselParameterGroup

define = Landermission

PARAMETER

{

name = HasCrewA2

type = HasCrew

trait = Pilot

minCrew = 1

}

PARAMETER

{

name = ReachStateA2

type = ReachState

situation = LANDED

completeInSequence = true

}

PARAMETER

{

name = PlantFlagA2

type = PlantFlag

targetBody = Minmus

completeInSequence = true

}

}

PARAMETER

{

name = ReturnHomeA2

type = ReturnHome

vessel = Landermission

completeInSequence = true

}

}

}

////////////////////////////

////////////////////////////

CONTRACT_TYPE

{

name = TESTB2

title = TESTB2

description = TESTB2

notes = Complete the following:

synopsis = TESTB2

completedMessage = TESTB2

agent = Kerbin World-Firsts Record-Keeping Society

cancellable = false

declinable = false

prestige = Trivial

targetBody = Minmus

maxCompletions = 1

rewardScience = 100.0

rewardReputation = 20.0

rewardFunds = 100000.0

advanceFunds = 10000.0

weight = 99.0

PARAMETER

{

name = VesselParameterGroupB21

type = VesselParameterGroup

PARAMETER

{

name = VesselParameterGroupB22

type = VesselParameterGroup

PARAMETER

{

name = HasCrewB2

type = HasCrew

trait = Pilot

minCrew = 1

}

PARAMETER

{

name = ReachStateB2

type = ReachState

situation = LANDED

completeInSequence = true

}

PARAMETER

{

name = PlantFlagB2

type = PlantFlag

targetBody = Minmus

}

}

PARAMETER

{

name = ReturnHomeB2

type = ReturnHome

completeInSequence = true

}

}

}

////////////////////////////

All four seem to transfer the "weak" landed-ness back to the return ship after docking AND/OR after EVA'ing a kerbal over from the lander. Clearly, progress. :-)

A2 and B2 allow completion AFTER re-docking the lander & return ship by simply launching a "10 meter hop" ship off the launchpad.

A1 and B1 both require the correct ship to return home. They still work if the lander is "terminated" from KSC before the returnship gets home.

Any thoughts or advice on if I should go with A1 or B1 as the template?

Link to comment
Share on other sites

Ok - further testing has given good results. It's working, I think, but I have it working two ways and would welcome thoughts on which to use.

First - the testing. I used four contracts to test with, the differences should be semi obvious :

////////////////////////////

CONTRACT_TYPE

{

name = TESTA1

title = TESTA1

description = TESTA1

notes = Complete the following:

synopsis = TESTA1

completedMessage = TESTA1

agent = Kerbin World-Firsts Record-Keeping Society

cancellable = false

declinable = false

prestige = Trivial

targetBody = Minmus

maxCompletions = 1

rewardScience = 100.0

rewardReputation = 20.0

rewardFunds = 100000.0

advanceFunds = 10000.0

weight = 99.0

PARAMETER

{

name = VesselParameterGroupA

type = VesselParameterGroup

define = Landermission

PARAMETER

{

name = HasCrewA1

type = HasCrew

trait = Pilot

minCrew = 1

}

PARAMETER

{

name = ReachStateA1

type = ReachState

situation = LANDED

completeInSequence = true

disableOnStateChange = true

}

PARAMETER

{

name = PlantFlagA1

type = PlantFlag

targetBody = Minmus

completeInSequence = true

}

PARAMETER

{

name = ReturnHomeA1

type = ReturnHome

vessel = Landermission

completeInSequence = true

}

}

}

////////////////////////////

////////////////////////////

CONTRACT_TYPE

{

name = TESTB1

title = TESTB1

description = TESTB1

notes = Complete the following:

synopsis = TESTB1

completedMessage = TESTB1

agent = Kerbin World-Firsts Record-Keeping Society

cancellable = false

declinable = false

prestige = Trivial

targetBody = Minmus

maxCompletions = 1

rewardScience = 100.0

rewardReputation = 20.0

rewardFunds = 100000.0

advanceFunds = 10000.0

weight = 99.0

PARAMETER

{

name = VesselParameterGroupB1

type = VesselParameterGroup

PARAMETER

{

name = HasCrewB1

type = HasCrew

trait = Pilot

minCrew = 1

}

PARAMETER

{

name = ReachStateB1

type = ReachState

situation = LANDED

completeInSequence = true

disableOnStateChange = true

}

PARAMETER

{

name = PlantFlagB1

type = PlantFlag

targetBody = Minmus

}

PARAMETER

{

name = ReturnHomeB1

type = ReturnHome

completeInSequence = true

}

}

}

////////////////////////////

////////////////////////////

CONTRACT_TYPE

{

name = TESTA2

title = TESTA2

description = TESTA2

notes = Complete the following:

synopsis = TESTA2

completedMessage = TESTA2

agent = Kerbin World-Firsts Record-Keeping Society

cancellable = false

declinable = false

prestige = Trivial

targetBody = Minmus

maxCompletions = 1

rewardScience = 100.0

rewardReputation = 20.0

rewardFunds = 100000.0

advanceFunds = 10000.0

weight = 99.0

PARAMETER

{

name = VesselParameterGroupA21

type = VesselParameterGroup

PARAMETER

{

name = VesselParameterGroupA22

type = VesselParameterGroup

define = Landermission

PARAMETER

{

name = HasCrewA2

type = HasCrew

trait = Pilot

minCrew = 1

}

PARAMETER

{

name = ReachStateA2

type = ReachState

situation = LANDED

completeInSequence = true

}

PARAMETER

{

name = PlantFlagA2

type = PlantFlag

targetBody = Minmus

completeInSequence = true

}

}

PARAMETER

{

name = ReturnHomeA2

type = ReturnHome

vessel = Landermission

completeInSequence = true

}

}

}

////////////////////////////

////////////////////////////

CONTRACT_TYPE

{

name = TESTB2

title = TESTB2

description = TESTB2

notes = Complete the following:

synopsis = TESTB2

completedMessage = TESTB2

agent = Kerbin World-Firsts Record-Keeping Society

cancellable = false

declinable = false

prestige = Trivial

targetBody = Minmus

maxCompletions = 1

rewardScience = 100.0

rewardReputation = 20.0

rewardFunds = 100000.0

advanceFunds = 10000.0

weight = 99.0

PARAMETER

{

name = VesselParameterGroupB21

type = VesselParameterGroup

PARAMETER

{

name = VesselParameterGroupB22

type = VesselParameterGroup

PARAMETER

{

name = HasCrewB2

type = HasCrew

trait = Pilot

minCrew = 1

}

PARAMETER

{

name = ReachStateB2

type = ReachState

situation = LANDED

completeInSequence = true

}

PARAMETER

{

name = PlantFlagB2

type = PlantFlag

targetBody = Minmus

}

}

PARAMETER

{

name = ReturnHomeB2

type = ReturnHome

completeInSequence = true

}

}

}

////////////////////////////

All four seem to transfer the "weak" landed-ness back to the return ship after docking AND/OR after EVA'ing a kerbal over from the lander. Clearly, progress. :-)

A2 and B2 allow completion AFTER re-docking the lander & return ship by simply launching a "10 meter hop" ship off the launchpad.

A1 and B1 both require the correct ship to return home. They still work if the lander is "terminated" from KSC before the returnship gets home.

Any thoughts or advice on if I should go with A1 or B1 as the template?

Hmmm, now that the EVA kerbals keep the parameters, I guess that makes A1 a pretty creative solution to not allowing another ship to do the flag-planting. I can't think of a reason it wouldn't work, so I vote A1!

Note that on this one:


[COLOR=#333333]PARAMETER
{[/COLOR]
[COLOR=#333333] name = ReturnHomeA1[/COLOR]
[COLOR=#333333] type = ReturnHome[/COLOR]
[COLOR=#ff0000] vessel = Landermission[/COLOR]
[COLOR=#333333] completeInSequence = true[/COLOR]
[COLOR=#333333]}[/COLOR]

vessel = Landermission doesn't actually do anything here - since the vessel attribute doesn't get read for this parameter type (it should be generating a warning on startup).

Link to comment
Share on other sites

Question - is there a list of items that are going to be deprecated (if any) in 7.0 ?

Given that I'm on the cusp of putting out the contract pack (probably tomorrow, long day coming up) I'd like to make it a little future-proof if possible ;)

Link to comment
Share on other sites

Question - is there a list of items that are going to be deprecated (if any) in 7.0 ?

Given that I'm on the cusp of putting out the contract pack (probably tomorrow, long day coming up) I'd like to make it a little future-proof if possible ;)

The SequenceNode parameter was deprecated in 0.6.7. Nothing for 0.7.0 will be deprecated - mostly was new stuff being added.

Link to comment
Share on other sites

Soo part test contracts started showing up again, no idea why, I had reinstalled a few mods, but it hadn't fixed the issue, so I was like screw it, got that gov funding mod and such and just went about my business with out them. Loaded the game up last night and all of a sudden I had part test contracts :confused:

Link to comment
Share on other sites

Soo part test contracts started showing up again, no idea why, I had reinstalled a few mods, but it hadn't fixed the issue, so I was like screw it, got that gov funding mod and such and just went about my business with out them. Loaded the game up last night and all of a sudden I had part test contracts :confused:

<shrug>.... that's the contract system for you... transparency is not a key feature. :(

Link to comment
Share on other sites

How do you create contracts for KSP?

Thanks,

Astrofox

Write C# code! Unless of course, you meant how to do it using Contract Configurator. :)

Start by reading through the wiki - you might then want to look at the contract packs listed in the first post as examples. If you have specific questions, feel free to post them on this thread or the general contract pack thread.

Link to comment
Share on other sites

So, could I use this to make a contract where the player has to fly to a space station and pick up a palette of Kerbal Space Program Issue Regulation Black Form Binders Request Form Forms?

Oh yes! Do it! I need more Kerbal Space Program Issue Regulation Black Form Binders Request Form Forms in my life.

Link to comment
Share on other sites

So, could I use this to make a contract where the player has to fly to a space station and pick up a palette of Kerbal Space Program Issue Regulation Black Form Binders Request Form Forms?
Oh yes! Do it! I need more Kerbal Space Program Issue Regulation Black Form Binders Request Form Forms in my life.

0.6.x - Yes, but only if the station is one that was set up as part of another contract.

0.7.0 - Yes, and it can be any station that meets the requirements you define.

However, I would be somewhat upset if the other half of that contract didn't involve bringing said forms back to the Administration building for long term storage.

Link to comment
Share on other sites

However, I would be somewhat upset if the other half of that contract didn't involve bringing said forms back to the Administration building for long term storage.

I'd be even more upset if it didn't reward you for an unfortunate re-entry "event" causing the loss of said form binder form forms on the way back. As long as the bearer walks away unharmed of course.

"Event" being, you know, "accidental use of forms as heat shield ablative material".

Link to comment
Share on other sites

Finally have the first release of my advanced progression contract pack ready:

http://forum.kerbalspaceprogram.com/threads/113119-Advanced-Progression-Contracts

(Please post any bug reports on the APC thread, not here)

Feel free to link, redistribute, flame, etc.

Congrats again on the release! The contract pack list in the first post has been updated with a link to your thread.

Link to comment
Share on other sites

I am thinking of making some contracts which will require the vessel to be destroyed (for example, crashing into the Mun). I don't see an easy way to do this from the docs.

Any ideas?

I'd first try the TargetDestroyed parameter. It's not a vessel parameter, so you can't have it work on the current vessel, but what you can do is set up a VesselParameterGroup that uses the define attribute to assign a name to the vessel that matches the parameters (ie. orbiting mun, unmanned, etc.). You can then use that name in the separate TargetDestroyed parameter.

A second (but not very good) option is to use VesselHasVisited, which give the option for a "die" on the Mun parameter. But it can't be tied to a vessel at all.

If neither of those options work for you, let me know and I can try to get something new for you.

Link to comment
Share on other sites

I'd first try the TargetDestroyed parameter. It's not a vessel parameter, so you can't have it work on the current vessel, but what you can do is set up a VesselParameterGroup that uses the define attribute to assign a name to the vessel that matches the parameters (ie. orbiting mun, unmanned, etc.). You can then use that name in the separate TargetDestroyed parameter.

A second (but not very good) option is to use VesselHasVisited, which give the option for a "die" on the Mun parameter. But it can't be tied to a vessel at all.

If neither of those options work for you, let me know and I can try to get something new for you.

I saw the TargetDestroyed, but didn't think it would work, I'll try it.

I first saw the VesselNotDestroyed, but that seemed to be a negative.

So, is this the right track:

CONTRACT_TYPE
{
name = FirstMunImpact
title = Crash a probe on the Mun!
description = We want to see the Mun closer, in preparation of landing on it. To do this, we need to send a probe to crash on the Mun.
This will be a monumental achievement.
notes = Complete the following:
synopsis = Launch an unmanned probe and have it crash onto the Mun.
completedMessage = Future generations will remember this day.
agent = Photographic Society of Kerbin
cancellable = false
declinable = false
prestige = Significant
targetBody = Mun
maxCompletions = 1
maxSimultaneous = 1
rewardScience = 100.0
rewardReputation = 80.0
rewardFunds = 120000.0
advanceFunds = 60000.0
weight = 99.0
REQUIREMENT
{
name = CompleteContract_test
type = CompleteContract
contractType = MunImpact
}

PARAMETER
{
name = VPG_test1
type = VesselParameterGroup
title = Vessel: Any; Duration: 1 year
duration = 1y
define = VPG_vessel_key1
vessel = VPG_vessel_key1

PARAMETER
{
name = VPG_TD_test1
type = TargetDestroyed
vessel = VPG_vessel_key1

}
}

Link to comment
Share on other sites

I saw the TargetDestroyed, but didn't think it would work, I'll try it.

I first saw the VesselNotDestroyed, but that seemed to be a negative.

So, is this the right track:

CONTRACT_TYPE
{
name = FirstMunImpact
title = Crash a probe on the Mun!
description = We want to see the Mun closer, in preparation of landing on it. To do this, we need to send a probe to crash on the Mun.
This will be a monumental achievement.
notes = Complete the following:
synopsis = Launch an unmanned probe and have it crash onto the Mun.
completedMessage = Future generations will remember this day.
agent = Photographic Society of Kerbin
cancellable = false
declinable = false
prestige = Significant
targetBody = Mun
maxCompletions = 1
maxSimultaneous = 1
rewardScience = 100.0
rewardReputation = 80.0
rewardFunds = 120000.0
advanceFunds = 60000.0
weight = 99.0
REQUIREMENT
{
name = CompleteContract_test
type = CompleteContract
contractType = MunImpact
}

PARAMETER
{
name = VPG_test1
type = VesselParameterGroup
title = Vessel: Any; Duration: 1 year
duration = 1y
define = VPG_vessel_key1
vessel = VPG_vessel_key1

PARAMETER
{
name = VPG_TD_test1
type = TargetDestroyed
vessel = VPG_vessel_key1

}
}

Nah, that wouldn't have worked that way, main problem being that you can't use both define and vessel together on VesselParameterGroup. For define, it means "tag/name the vessel that completes this parameter with this name". For vessel, it means "this can only be met by a vessel previously tagged with the given name. They aren't strictly mutually exclusive, but wont' work in this case.

Anyway, I'd realized that I didn't really like either of the options I gave you. So I added a VesselDestroyed. It'll be coming in 0.7.0, but I haven't done the documentation or even really tested it. But you can give it a go. The modified version of your contract would be:

CONTRACT_TYPE
{
name = FirstMunImpact
title = Crash a probe on the Mun!
description = We want to see the Mun closer, in preparation of landing on it. To do this, we need to send a probe to crash on the Mun.
This will be a monumental achievement.
notes = Complete the following:
synopsis = Launch an unmanned probe and have it crash onto the Mun.
completedMessage = Future generations will remember this day.
agent = Photographic Society of Kerbin
cancellable = false
declinable = false
prestige = Significant
targetBody = Mun
maxCompletions = 1
maxSimultaneous = 1
rewardScience = 100.0
rewardReputation = 80.0
rewardFunds = 120000.0
advanceFunds = 60000.0
weight = 99.0
REQUIREMENT
{
name = CompleteContract_test
type = CompleteContract
contractType = MunImpact
}

PARAMETER
{
name = VPG_test1
type = VesselParameterGroup
// nightingale - I'd let the title default itself in most cases
// title = Vessel: Any; Duration: 1 year
// nightingale 1 year??? in this case it'd mean that you need to wait 1 year after impact. Actually, maybe that is what you intended...
// duration = 1y

// nightingale - not useful, vessel will be dead.
// define = VPG_vessel_key1
// vessel = VPG_vessel_key1

PARAMETER
{
name = VPG_TD_test1
type = VesselDestroyed
}
}

You'll want to grab the dev version from this link

Link to comment
Share on other sites

Wow! I'm downloading and will test the modified cfg before going to sleep.

You're right, the duration was wrong, I meant that once accepted, the player had up to a year to finish it. But that's minor vs. my having a simple contract which I can then extend.

Thanks for the quick response and update.

Edit: The contract worked, although it isn't specifying the Mun yet. So I just took off and crashed to verify that the basic contract and your update did work.

Would it be possible to have (or is there already) a way to know where a ship was destroyed? My thoughts on this are, for example, on a planet, in atmosphere, in space. Rather than have too many values, it might make sense if you were to have two values; one to say where (ie: on a planet, atmosphere, in space) and one which would say which planet/orbital body was closest at the time of destruction. I would envision that for the second, you would have a value for each planet, asteroid (one for each class), etc.

Edited by linuxgurugamer
more thoughts
Link to comment
Share on other sites

Wow! I'm downloading and will test the modified cfg before going to sleep.

You're right, the duration was wrong, I meant that once accepted, the player had up to a year to finish it. But that's minor vs. my having a simple contract which I can then extend.

Thanks for the quick response and update.

For that, have a look at the deadline attribute on the CONTRACT_TYPE node.

- - - Updated - - -

Would it be possible to have (or is there already) a way to know where a ship was destroyed? My thoughts on this are, for example, on a planet, in atmosphere, in space. Rather than have too many values, it might make sense if you were to have two values; one to say where (ie: on a planet, atmosphere, in space) and one which would say which planet/orbital body was closest at the time of destruction. I would envision that for the second, you would have a value for each planet, asteroid (one for each class), etc.

The general philosophy for Contract Configurator has been that each parameter should do only one thing (although in recent versions some of the parameters have becoming quite big, but that's another story).

So for what you're looking for, I'd suggest something like this:

[COLOR=#3E3E3E]PARAMETER
[/COLOR]{
name = VesselParameterGroup
type = VesselParameterGroup

PARAMETER
{
name = ReachState
type = ReachState

targetBody = Mun
[COLOR=#333333][FONT=Consolas]situation = SUB_ORBITAL[/FONT][/COLOR]
}

PARAMETER
{
name = VesselDestroyed
type = VesselDestroyed

completeInSequence = true
}
}

Key points:

  1. ReachState allows you to set conditions for the speed, altitude, body, biome and/or situation.
  2. The completeInSequence attribute means "don't allow this parameter to complete until all the ones above it are complete.
  3. Be careful if you use the SUB_ORBITAL situation like I do in this example. If you crash, I have no idea what happens first - the situation changing to LANDED or the vessel being destroyed. Also, if you aim at the ground fast enough, I think you may also be able to get a collision course with the situation of ESCAPING. Things to consider in your design. :)

Link to comment
Share on other sites

You've been very helpful, I think I'm starting to get it.

A question about the syntax. The following two fragments of code are intended to do the same thing, which is (my intention, anyway) to have the contract_type work with either Minmus or Mun. Did I do it correctly? I'd prefer the first, since it is shorter and easier to maintain:

PARAMETER
{
name = Body3001
type = Any

PARAMETER
{
name = ReachState3001
type = ReachState
targetBody = HomeWorld().GetChildren()
situation = SUB_ORBITAL
}
}

PARAMETER
{
name = Body3001
type = Any

PARAMETER
{
name = ReachState3001
type = ReachState
targetBody = Minmus
situation = SUB_ORBITAL
}

PARAMETER
{
name = ReachState3002
type = ReachState
targetBody = Mun
situation = SUB_ORBITAL
}
}

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