Jump to content

Contract Packs for Contract Configurator - General Thread


nightingale

Recommended Posts

Nightingale

I have a pack request,

Can you creat a pack for resupply missions? I'm thinking start it with a build a station in LKO to hold x amount of kerbals. Then have a contract show up say every half Kerbin year to resupply it with TAC life support. Then maybe a mun station with an annual resupply. Then minmus and so on and so on through the solar system.

This would be so awesome

Cross-posting this here from the Contract Configurator thread.

I've updated the first post with this idea.

Link to comment
Share on other sites

  • 3 weeks later...

Hello, I'm trying to build a few contracts for testing KW Rocketry parts. But I'm having some trouble with the PartTest-parameter:


CONTRACT_TYPE:NEEDS[KWRocketry]
{
name = Test Maverick-1D
title = Test Maverick-1D
description = The new KW Maverick-1D twin-nozzle liquid fuel engine ...
synopsis = Test the new Maverick-1D engine during take-off.
completedMessage = We've got all our data, good work!

cancellable = true
declinable = true
prestige = Trivial
targetBody = Kerbin
maxCompletions = 1
maxSimultaneous = 1
rewardScience = 5.0
rewardReputation = 1.0
rewardFunds = 12000.0
failureFunds = 20000.0
advanceFunds = 8000.0

BEHAVIOUR
{
name = ExperimentalPart
type = ExperimentalPart

part = KW1mengineMaverick1D
add = True
remove = True
}
PARAMETER
{
name = PartTest
type = PartTest
part = KW1mengineMaverick1D
}
REQUIREMENT
{
name = TechResearched
type = TechResearched
tech = advRocketry
}
}

When accepted, the contract successfully adds the new engine-part and I can also check if my vessel contains the "KW1mengineMaverick1D" part. However the PartTest does not work: When the engine is activated during staging, the parameter does not change. I'm having the same problem with other non-stock parts. Is there something that can be done to get non-stock parts working or is this a problem in the KW Rocketry mod? Is there another way to check if a specific part got activated or is active?

Link to comment
Share on other sites

;1764929']Hello' date=' I'm trying to build a few contracts for testing KW Rocketry parts. But I'm having some trouble with the PartTest-parameter:


<snip>

When accepted, the contract successfully adds the new engine-part and I can also check if my vessel contains the "KW1mengineMaverick1D" part. However the PartTest does not work: When the engine is activated during staging, the parameter does not change. I'm having the same problem with other non-stock parts. Is there something that can be done to get non-stock parts working or is this a problem in the KW Rocketry mod? Is there another way to check if a specific part got activated or is active?[/quote']

Note that the PartTest parameter is just a wrapper around the stock one - so this is how stock behaves. :)

From taking a quick, peek, it looks like the part being tested must have the ModuleTestSubject part module.

Anyway, you need to add this to the part in question (either yourself via ModuleManager, or request that the maintainers of KW put it in their part(s)):

MODULE
{
name = ModuleTestSubject

// nowhere: 0, srf: 1, ocean: 2, atmo: 4, space: 8
environments = 8

useStaging = False
useEvent = True
}

I believe this is what stock uses as its selection criteria for picking parts for stock part test contracts (unverified). Most likely that's what that bitmask is all about. From guessing, set useStaging if it's a "stageable" part (like an engine), and I think useEvent will always need to be true.

Link to comment
Share on other sites

I've started to write a few new contracts, replacing the stock rescue-contract (rescue kerbals stranded on the mun, in interplanetary space and so on): https://github.com/mmoench/LostInSpace

However I have run into a problem with the SpawnVessel-function: I want to spawn a vessel landed on a planet, so I got the correct orbit, longitude/latitude and altitude from my savegame but once the physics start loading for the created vessel it immediately explodes. As far as I can tell the problem is caused by the "hgt" parameter of the vessel. A newly spawned vessel looks like this in a savegame:


...
VESSEL
{
pid = 6d2ae98086a3449491c3e8403ea910eb
name = Duna-Can I
type = Base
sit = LANDED
landed = True
landedAt = Duna
splashed = False
met = 289577855.994085
lct = 289577855.994085
root = 0
lat = -2.95000043331974
lon = 14.8598804022645
alt = 3641.76569247659
hgt = -1
nrm = 0,1,0
rot = 0.1396868,0.6668477,-0.5509097,0.4819753
CoM = 0,0,0
stg = 0
prst = False
ref = 0
ctrl = False
ORBIT
{
SMA = 150517.960272814
ECC = 1
INC = NaN
LPE = 164.64105881645
LAN = 26.2400394046032
MNA = 3.14159265358979
EPH = 289577858.454083
REF = 6
}
...

If I replace the "hgt = -1" with for example "hgt = 4.5", the vessel stops exploding. I don't know what the "hgt" (height?) specifies but is there a way we can set this value for landed vessels?

Link to comment
Share on other sites

;1766155']I've started to write a few new contracts' date=' replacing the stock rescue-contract (rescue kerbals stranded on the mun, in interplanetary space and so on): [url']https://github.com/mmoench/LostInSpace

However I have run into a problem with the SpawnVessel-function: I want to spawn a vessel landed on a planet, so I got the correct orbit, longitude/latitude and altitude from my savegame but once the physics start loading for the created vessel it immediately explodes. As far as I can tell the problem is caused by the "hgt" parameter of the vessel. A newly spawned vessel looks like this in a savegame:


...
VESSEL
{
pid = 6d2ae98086a3449491c3e8403ea910eb
name = Duna-Can I
type = Base
sit = LANDED
landed = True
landedAt = Duna
splashed = False
met = 289577855.994085
lct = 289577855.994085
root = 0
lat = -2.95000043331974
lon = 14.8598804022645
alt = 3641.76569247659
hgt = -1
nrm = 0,1,0
rot = 0.1396868,0.6668477,-0.5509097,0.4819753
CoM = 0,0,0
stg = 0
prst = False
ref = 0
ctrl = False
ORBIT
{
SMA = 150517.960272814
ECC = 1
INC = NaN
LPE = 164.64105881645
LAN = 26.2400394046032
MNA = 3.14159265358979
EPH = 289577858.454083
REF = 6
}
...

If I replace the "hgt = -1" with for example "hgt = 4.5", the vessel stops exploding. I don't know what the "hgt" (height?) specifies but is there a way we can set this value for landed vessels?

Funny, Arachnidek brought this up in the contract configurator thread too. Right now there's no way to tweak that - but it looks like you've found at least part of the problem. I'll take a look in the next few days and see what I can come up with.

Link to comment
Share on other sites

  • 2 weeks later...

Quick question. The "random" function in CC, what is the syntax here? I've looked through the wiki, and from what I can figure, I should be able to (as an example) put:

 rewardFunds = Random(100.0, 100000.0)

However, all I get is a message basically saying it can't validate "R" (ie it doesn't understand random) what am I doing wrong here?

Link to comment
Share on other sites

Quick question. The "random" function in CC, what is the syntax here? I've looked through the wiki, and from what I can figure, I should be able to (as an example) put:

 rewardFunds = Random(100.0, 100000.0)

However, all I get is a message basically saying it can't validate "R" (ie it doesn't understand random) what am I doing wrong here?

You're using the wrong version! The release version (0.6.7) doesn't support expressions. The new version (0.7.0) is coming out in the next couple days with support for that. There's a pre-release version (0.6.90) from a couple days you can look at if you want to try it out early.

Link to comment
Share on other sites

Ah, that would explain a lot :D - I'm guessing the same thing applies for the VesselIsType parameter? Thanks for that.

As an aside... I'm working on something similar to the base/orbital station re-supply mission you mention in the first page. My basic aim is to have the player build up a station with a series of modules (habitation module, power module, etc) and then run crew rotations and re-supply missions approximately every 30 days.

Link to comment
Share on other sites

Ah, that would explain a lot :D - I'm guessing the same thing applies for the VesselIsType parameter? Thanks for that.

VesselIsType should be working. If it says NEW in the wiki it was introduced in 0.6.x. If it says coming soon it'll be for 0.7.0.

As an aside... I'm working on something similar to the base/orbital station re-supply mission you mention in the first page. My basic aim is to have the player build up a station with a series of modules (habitation module, power module, etc) and then run crew rotations and re-supply missions approximately every 30 days.

Cool! Can't wait to see what you come up with!

Link to comment
Share on other sites

Nightingale,

I'm making good progress on the Ranger/Surveyor contracts I'm working on.

I have a question regarding the RANDOM_WAYPOINT in the WaypointGenerator.

Is it possible to generate a random name instead of hard-coding it? Or even a counter would be fine.

It would be even nicer if I could incorporate the name into the contract description as is done with some stock contracts I've seen.

Another alternative would be to select a name from a list of supplied names.

Thanks

LinuxGuruGamer

Link to comment
Share on other sites

Nightingale,

I'm making good progress on the Ranger/Surveyor contracts I'm working on.

I have a question regarding the RANDOM_WAYPOINT in the WaypointGenerator.

Is it possible to generate a random name instead of hard-coding it? Or even a counter would be fine.

It would be even nicer if I could incorporate the name into the contract description as is done with some stock contracts I've seen.

Another alternative would be to select a name from a list of supplied names.

Thanks

LinuxGuruGamer

The expression options for strings are quite limited, as it's more of a symbol replacement than a true expression. But if you leave the name out, it will generate it using the same code that generates names for the survey contracts. Would that be sufficient? If not, I can try to add better expression handling for strings post-0.7.0.

Getting the waypoint name into the title is supposed to work, but because it's in a child config node in this case it doesn't. :( Can you raise a GitHub issue?

Link to comment
Share on other sites

The expression options for strings are quite limited, as it's more of a symbol replacement than a true expression. But if you leave the name out, it will generate it using the same code that generates names for the survey contracts. Would that be sufficient? If not, I can try to add better expression handling for strings post-0.7.0.

Getting the waypoint name into the title is supposed to work, but because it's in a child config node in this case it doesn't. :( Can you raise a GitHub issue?

Github issue raised.

No need for better expression handling for strings for me, as long as the generated name gets in there, that would be fine.

Thanks

Link to comment
Share on other sites

As I've been working on my contracts, I've had to do the reload several times.

Almost every time I do a reload, the game quits.

It's not memory, the game is only using about 1.5 gig at the time I do the reload.

This is running on OSX, KSP 32 bit.

I don't see anything in the log file.

I initially thought it was because of a bad contract with a recursive loop, but this is happening even when all contracts load successfully.

I then loaded the same contract pack on my Windows system (KSP 32 bit). I did not see the same problem.

Any ideas? What would you need from me for this?

Link to comment
Share on other sites

As I've been working on my contracts, I've had to do the reload several times.

Almost every time I do a reload, the game quits.

It's not memory, the game is only using about 1.5 gig at the time I do the reload.

This is running on OSX, KSP 32 bit.

I don't see anything in the log file.

I initially thought it was because of a bad contract with a recursive loop, but this is happening even when all contracts load successfully.

I then loaded the same contract pack on my Windows system (KSP 32 bit). I did not see the same problem.

Any ideas? What would you need from me for this?

Ouch, that is a tough one - I only run Windows at the moment, so there's no real way I can reproduce it. Let's start with the output_log.txt and KSP.log from the crash directory... I'll see if anything interesting is in there.

During development I *have* had some crashes from mono when using pretty heavy expressions.... mono didn't seem to like the amount of try/catch/finally blocks I was using (but I couldn't correlate with any other mono bug reports on the internet, or make it happen with any reliability).

Another test - if it's reliably reproducible, can you do a module manager reload (alt-f11)? Part of the contract configurator reload is to do the module manager load, so it'd be nice to rule that out.

Link to comment
Share on other sites

Ouch, that is a tough one - I only run Windows at the moment, so there's no real way I can reproduce it. Let's start with the output_log.txt and KSP.log from the crash directory... I'll see if anything interesting is in there.

During development I *have* had some crashes from mono when using pretty heavy expressions.... mono didn't seem to like the amount of try/catch/finally blocks I was using (but I couldn't correlate with any other mono bug reports on the internet, or make it happen with any reliability).

Another test - if it's reliably reproducible, can you do a module manager reload (alt-f11)? Part of the contract configurator reload is to do the module manager load, so it'd be nice to rule that out.

Doing the module manager reload caused the crash, so I'll head over there

Thanks

Link to comment
Share on other sites

  • 7 months later...

I decided to write some SSTO/spaceplane contracts, and have had some initial (apparent) success, but I still have questions about the syntax and its results. Is this still the best place to ask, or has the discussion moved elsewhere?

Link to comment
Share on other sites

Cool, thanks! I’ll start with my first-flight contract, which is basically “Get your spaceplane from the KSC to space and back again.” I want those to be completed in order, so the player can’t take off, land, and THEN boost to orbit in order to get the completion. Here’s how I set up my parameters:

    PARAMETER
    {
        name = VesselParameterGroup
        type = VesselParameterGroup
        define = Spaceplane

        PARAMETER
        {
            name = Launch
            type = ReachState
            situation = FLYING
            title = Take off from the KSC runway
            completeInSequence = true
            disableOnStateChange = true
        }

        PARAMETER
        {
            name = Spaaaaace
            type = ReachSpace
            title = Reach space, however briefly
            completeInSequence = true
            disableOnStateChange = true
        }

        PARAMETER
        {
            name = Land
            type = ReachState
            situation = LANDED
            biome = Runway
            title = Land on the KSC runway
            completeInSequence = true
        }

    }

 

The question here is, am I using completeInSequence and disableOnStateChange correctly, or redundantly, or Just Plain Wrong™?

If I’ve made the structure weird, let me know that too. I read the documentation and looked at the source for a number of contract packs, and I saw a bunch of different approaches to structuring the parameters. I wasn’t sure if there was a meaningful difference between what I did above and something like this:

    PARAMETER
    {
        name = VesselParameterGroup1
        type = VesselParameterGroup
        define = Spaceplane
        PARAMETER {
            // first step parameters in here
        }
    }
    PARAMETER
    {
        name = VesselParameterGroup2
        type = VesselParameterGroup
        define = Spaceplane
        PARAMETER {
            // second step parameters in here
        }
    }
    PARAMETER
    {
        name = VesselParameterGroup3
        type = VesselParameterGroup
        define = Spaceplane
        PARAMETER {
            // third step parameters in here
        }
    }

 

Thanks!

Edited by meyerweb
Cleaned up forum migration errors (Unicode and hyperlinking were both botched—sigh)
Link to comment
Share on other sites

The first way is almost 100% the way I would recommend. The completeInSequence on the very first element is redundant, but won't affect anything if you have it in.

The second way uses a feature (vessel saving/tracking) that I'd always intended for inter-contract tracking rather than intra-contract tracking - ie. doing multiple contracts with one vessel. It's not wrong per se, but I think it ends up being less clear to the players than if you can do it all in one VesselParameterGroup (so I recommend that whenever possible). Also, the last two would need to be "vessel =" instead of "define =" to work properly.

Link to comment
Share on other sites

Thanks, Nightingale! My next question is about the formatting of objectives. Mine look like this:

Screen%20Shot%202015-10-20%20at%2016.14.35.png

Any idea why the Vessel says “Spaceplane (new)” when I only defined “Spaceplane” as the value? Or, for that matters, why it shows up as an Objective at all? And why the sub-objectives show up under the first real objective? What I’d really like to see is something like this:

Screen%20Shot%202015-10-20%20at%2016.14.35-edited.png

Is that possible? I’m okay with losing the double-line spacing, but I’d really like to see just those things.

Edited by meyerweb
Cleaned up forum migration errors (Unicode and hyperlinking were both botched—sigh)
Link to comment
Share on other sites

Thanks, Nightingale! My next question is about the formatting of objectives. Mine look like this:

http://meyerweb.com/eric/ksp/screenshots/Screen%20Shot%202015-10-20%20at%2016.14.35.png

Any idea why the Vessel says “Spaceplane (new)†when I only defined “Spaceplane†as the value? Or, for that matters, why it shows up as an Objective at all? And why the sub-objectives show up under the first real objective? What I’d really like to see is something like this:

http://meyerweb.com/eric/ksp/screenshots/Screen%20Shot%202015-10-20%20at%2016.14.35-edited.png

Is that possible? I’m okay with losing the double-line spacing, but I’d really like to see just those things.

Let's see:

  1. Remove the "define = Spaceplane", you only need/want that if you're planning on having a follow-up contract that targets this exact vessel. That'll get rid of the "Spaceplane (new)" part. You can't removing the grouping though - just because that's how it tracks all the child parameters states across vessels.
  2. For the sub-objectives of the "Take off from the runway" parameter, those are there because I try to default to giving the player as much information as possible (it's more relevant if you have stuff like an altitude or speed requirement). You can turn that off in ReachState by setting "hideChildren = true".
  3. Also, just realized you're going to have to change your ReachSpace to a ReachState. I need to document the ReachSpace better, but it's a progression based parameter that will turn true once the player reaches space for the very first time. So it's only useful in a very specific situtation (maybe I should get rid of it completely, it's so situational).

Link to comment
Share on other sites

You’re the greatest, Nightingale—thank you again! I made the changes—thanks for the heads-up on ReachSpace—and I think it works a lot better now. I rebalanced the rewards a bit, and I’ll ponder the hideChildren tradeoffs.

But for now, I need to actually complete that contract to make sure it’s achievable! I always crash spectacularly on touchdown, and that’s with the Kramax Autopilot bringing me in. I’m starting to suspect I need something sturdier than the LY-10 Small Landing Gear…

Edited by meyerweb
Cleaned up forum migration errors (Unicode and hyperlinking were both botched—sigh)
Link to comment
Share on other sites

Since this thread has gotten some recent activity, i thought I would throw in asking if there's been any progress made on a GPS-based pack?

IIRC, nightingale, you and someone else had possibly started something?

I have a very basic version (one contract, requires Figaro) right now. I've wanted to rework it to be a bit more generic (remove the figaro dependency), but it hasn't been a high priority. If anyone wants to work on it, I'd be happy to provide the files.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

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