Recommended Posts

Aha MrChumley, I finally got to view your Imgur album (I'm at work so had to wait for down time) and I see the problem. Yes, you need to get a Kerbal out there. I don't suggest swimming. I suggest using those parts from the lander, maybe plus a few parts you'll find lying around KSC if you so choose (the reliant or swivel in particular may come in quite handy) to fly over there. at the very least, a couple Fleas separated by decouplers should do it.

Send a pilot over, land via parachute, and then fly the plane back. THEN claw it.

I will make the description a bit more verbose to remove some confusion.

So say HasLanded() == true, but for each one? I'm guessing it is similar to my other question about applying stuff to a list.

If that doesn't work maybe you could help me figure out what to do.

I have a series of contracts and I want them to be more or less completed in order. So I have requirements of complete x contract. The issue though is if someone were to install the pack in a existing game some contracts may not fire if someone has visited a certain body.

So my idea was to add another any requirement that if they have done x with any of this list of bodies, then it returns true.

So say HasLanded() == true, but for each one? I'm guessing it is similar to my other question about applying stuff to a list.

If that doesn't work maybe you could help me figure out what to do.

I have a series of contracts and I want them to be more or less completed in order. So I have requirements of complete x contract. The issue though is if someone were to install the pack in a existing game some contracts may not fire if someone has visited a certain body.

So my idea was to add another any requirement that if they have done x with any of this list of bodies, then it returns true.

(or for a marginal efficiency improvement, reverse the allMoonsWithSomething's check, and then check whether it has a Count() of 0 in your expression.

- - - Updated - - -

Edit 2: If there's a better way to do the above, I'm still interested, but now I'd like to know how you make a one-time contract that never reappears if you decline it?

Careful of those late edits - you edited well after I read your original post.

There isn't a better way - the contract system requires at least one parameter or it will fail. So to have "no" parameters, you need some sort of dummy parameter (and you can change the title to make it look better). Timer seems as good a choice as any.

I can't think of a way to make a contract that doesn't reappear if declined - mainly because the contract system doesn't store declined contracts (otherwise the save file would become massive). [#298] is coming up in 1.7.0 that will allow expressions to be fired when a contract is offered. You could hypothetically use that to set a flag and then prevent the contract from being offered again if that flag is set. But what'll likely happen is that the player will never see the contract - it'll come up and be withdrawn while they're timewarping and it'll never show up again.

Share this post

Link to post

Share on other sites

Careful of those late edits - you edited well after I read your original post.

There isn't a better way - the contract system requires at least one parameter or it will fail. So to have "no" parameters, you need some sort of dummy parameter (and you can change the title to make it look better). Timer seems as good a choice as any.

I can't think of a way to make a contract that doesn't reappear if declined - mainly because the contract system doesn't store declined contracts (otherwise the save file would become massive). [#298] is coming up in 1.7.0 that will allow expressions to be fired when a contract is offered. You could hypothetically use that to set a flag and then prevent the contract from being offered again if that flag is set. But what'll likely happen is that the player will never see the contract - it'll come up and be withdrawn while they're timewarping and it'll never show up again.

Thanks for the warning, I'll be more mindful of edits in the future!

That makes sense, I think the system I have in place works well enough (pretty sure it's not really an intended use for contracts!).

I'll give that a try when 1.7.0 is out and see if it's better. It's for a one-time optional contract, so further generation is a bit spammy but otherwise unproblematic.

Next question : Is there a straightforward way to provide RSS support for specific planets? Kerbin seems easy enough, using HomeWorld(), but what about others like Duna/Mars or Eve/Venus?

I.e. Currently I have targetBody = Duna, but want something that selects Duna or Mars depending on whether RSS is present. Think I've cracked it (see below), but I'm so new to this I prefer to ask

That or a Module Manager patch specifically tailored towards your contract pack are your best options. Depending on what you're going for, you can also try dividing up the planets in other ways without naming them (eg. all children of the homeworld, or everything with an sma less than the homeworld, etc.).

Share this post

Link to post

Share on other sites

Feature request: Would it be possible to split maxSimultaneous (in CONTRACT_GROUP) to allow separate values for maximum available (offered) and maximum active (accepted)?

For instance, I have contract1 and contract2 of the same group. maxAvailable is 2, so both show up in mission control, however maxActive is 1, so when one is accepted the other cannot be.

This is to get around issues I'm having with contracts that have similar objectives where I would like both to be visible and offered, but make it not possible for both to be completed in one go, though perhaps this is possible if I use define (in Parameter) better?

For now I think I'll use ActiveContract requirements. Actually that might work better anyway...

- - - Updated - - -

Actually I don't think that would work in this scenario:

contract1 and contract2 offered, both define vessel in parameters.

contract1 accepted, vessel1 launched, vessel = vessel1.

at this stage I'd like contract2 to be available, however under both circumstances it would be locked out until contract1 is completed, right?

So is there a way of setting a vessel in only one contract at a time (when both are active)?

i.e contract1 and contract2 accepted, vessel1 launched, tied to contract1 but not contract2

Share this post

Link to post

Share on other sites

Feature request: Would it be possible to split maxSimultaneous (in CONTRACT_GROUP) to allow separate values for maximum available (offered) and maximum active (accepted)?

For instance, I have contract1 and contract2 of the same group. maxAvailable is 2, so both show up in mission control, however maxActive is 1, so when one is accepted the other cannot be.

This is to get around issues I'm having with contracts that have similar objectives where I would like both to be visible and offered, but make it not possible for both to be completed in one go, though perhaps this is possible if I use define (in Parameter) better?

For now I think I'll use ActiveContract requirements. Actually that might work better anyway...

- - - Updated - - -

Actually I don't think that would work in this scenario:

contract1 and contract2 offered, both define vessel in parameters.

contract1 accepted, vessel1 launched, vessel = vessel1.

at this stage I'd like contract2 to be available, however under both circumstances it would be locked out until contract1 is completed, right?

So is there a way of setting a vessel in only one contract at a time (when both are active)?

i.e contract1 and contract2 accepted, vessel1 launched, tied to contract1 but not contract2

ActiveContract is the preferrred way of handling this.

Assuming that you are using different vessel identifiers for the two contracts, you can use the IsNotVessel parameter to make them mutually exclusive. If the parameters are similar enough though, it may cause trouble for the user, as they'll be unable to "choose" which of the two contracts the vessel should apply to (it'll mostly be the one that gets checked first, which will be the one that was accepted first... probably). So better than using IsNotVessel is finding some way to add a parameter that differentiates the two contracts. Can't give specific advice without more info, but HasCrew and PartValidation are good possibilities.

- - - Updated - - -

Oh, another option... if you want them to choose between both contracts, and then have the second one re-offered only when the first one's vessel gets defined you could do something like this (untested):

The two lines in bold need to match exactly. Otherwise CC will tell you that the group SandDinkerbalized doesn't exist. Also not sure how CC reacts to spaces in contract groups (but I've never tried it).

REQUIREMENT{name = CompleteContracttype = CompleteContract

contractType =}

What exactly is this line doing? I think this is a requirement that can never be met (so it will never show up) as there is no contract to fufill.

PARAMETER{name = TargetDestroyedtype = TargetDestroyed

// The vessel attribute is the *defined* name of the vessel that should// not be destroyed. This is a name of a vessel defined either with// the define attribute of a VesselParameterGroup parameter, or via a// SpawnVessel.//// It can be specified multiple times, but there must be at least one.

Share this post

Link to post

Share on other sites

I've taken my first tiny steps in trying to create some contracts. Mostly I'm basing these off of Kerbin of Fire contracts to see how I should I write them.

Ran into an issue: I have created a contract group and 1 contract. The contract group shows up in the Configurator, the contract itself doesn't.

What am I doing wrong?

<snip>

First off, I'll point you to the How-To page on the wiki. It has a couple sections that are crucial for someone using Contract Configurator for the first time - in particular using the debug window, which will most likely have the error message that lets you know what the problem here is.

Now, if you meant that it's not even showing up in the debug menu, then there's a couple things to check for (neither appear to be the problem here):

Make sure the root CONTRACT_TYPE node is correctly spelled - if it's not then it'll just be silently ignored

Make sure all your {} braces match up correctly. KSP's config file loader sometimes silently drops stuff if you miss an end brace.

That being said, I suspect when you load up the debug window I suspect you'll at least find an error for your CompleteContract requirement (the contractType is blank).

EDIT: Double ninja'd!!! But do check the debug window... it'll be invaluable as you continue to develop contracts.

- - - Updated - - -

<snip> Also not sure how CC reacts to spaces in contract groups (but I've never tried it). <snip>

It's allowed, but not recommended, as then you can't do @ContractGroup:someAttrtibute. It's actually why the displayName attribute was added:

preWaitText = Orbiting for a additional two days will provide us with some valuable data. waitingText = One more day should do. completionText = Excellent, this will be very helpful. rewardFunds = 5000 / @targetBody.Multiplier() rewardScience = 2 / @targetBody.Multiplier() } }

PARAMETER { name = ReturnHome type = ReturnHome } }

Ideally this gives you a optional objective to orbit for 2d. However, the duration never counts down and I never see the duration text.

So I thought I'd try putting the orbit as a parameter under the duration but then the duration just starts counting down right away.

preWaitText = Orbiting for a additional two days will provide us with some valuable data. waitingText = One more day should do. completionText = Excellent, this will be very helpful. rewardFunds = 5000 / @targetBody.Multiplier() rewardScience = 2 / @targetBody.Multiplier() } }

PARAMETER { name = ReturnHome type = ReturnHome } }

Ideally this gives you a optional objective to orbit for 2d. However, the duration never counts down and I never see the duration text.

So I thought I'd try putting the orbit as a parameter under the duration but then the duration just starts counting down right away.

Couple things:

You shouldn't use it as a child to the Orbit parameter - as the orbit parameter won't care about its child parameters.

The way it's supposed to work, is the Duration counter will start counting down after every sibling above it in the list is completed. So you should be able to do it like this:

I'm really confused as to what is happening. Anything under a child CONTRACT_GROUP doesn't show up at all whether it references this DATA node or not. I used the dev DLL you provided a few posts before.