Jump to content

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


nightingale

Recommended Posts

Hi all! I'm wondering if it's possible to set a time-from-launch requirement for a contract parameter. I'm working on a Career mod with BDArmory and FAR in mind, to challenge players to build progressively more sophisticated jet fighters that mirror the performance of real-life counterparts throughout history. For one such contract, I want the player to build something similar to the first supersonic interceptors, like the F-104 Starfighter. These planes were designed to get up to high altitudes as fast as possible to intercept enemy bombers at a moment's notice.

So along those lines, I'd like to stipulate that the player must reach an altitude of 5,000m within 90 seconds of launch (as in mission start, not takeoff) to complete the contract. But after reading through the docs on GitHub, I'm not seeing a built-in way to do that. My backup plan is to just ask the player to sustain a minimum climb rate for x number of seconds, but that's not really ideal, since one could just take their sweet time to get up to a high rate of speed in level flight before they start climbing.

It seems like it should be possible to do this through an extended/custom parameter, but that looks to be way beyond my current abilities. Would anyone be willing to help me out?

Link to comment
Share on other sites

1 hour ago, SpiralOut said:

Hi all! I'm wondering if it's possible to set a time-from-launch requirement for a contract parameter. I'm working on a Career mod with BDArmory and FAR in mind, to challenge players to build progressively more sophisticated jet fighters that mirror the performance of real-life counterparts throughout history. For one such contract, I want the player to build something similar to the first supersonic interceptors, like the F-104 Starfighter. These planes were designed to get up to high altitudes as fast as possible to intercept enemy bombers at a moment's notice.

So along those lines, I'd like to stipulate that the player must reach an altitude of 5,000m within 90 seconds of launch (as in mission start, not takeoff) to complete the contract. But after reading through the docs on GitHub, I'm not seeing a built-in way to do that. My backup plan is to just ask the player to sustain a minimum climb rate for x number of seconds, but that's not really ideal, since one could just take their sweet time to get up to a high rate of speed in level flight before they start climbing.

It seems like it should be possible to do this through an extended/custom parameter, but that looks to be way beyond my current abilities. Would anyone be willing to help me out?

It's a bit of a hack, but could you just set the mission deadline to something like 2 minutes? That way as soon as they accept the contract they have a limited time to roll out the aircraft and reach altitude. There's a certain amount of realism there too :D

That wouldn't work for anyone using KCT, but it might do as a work around if there isn't any other way to do that.

Link to comment
Share on other sites

1 hour ago, SpiralOut said:

So along those lines, I'd like to stipulate that the player must reach an altitude of 5,000m within 90 seconds of launch (as in mission start, not takeoff) to complete the contract. But after reading through the docs on GitHub, I'm not seeing a built-in way to do that. My backup plan is to just ask the player to sustain a minimum climb rate for x number of seconds, but that's not really ideal, since one could just take their sweet time to get up to a high rate of speed in level flight before they start climbing.

Try Timer and ReachState in an All wrapper

Edit: actually I think you don't need the All

Edited by severedsolo
Link to comment
Share on other sites

Just a quick heads up that I'm going to be travelling for work (boo) and then for vacation (yay), so I'll be somewhat unavailable for the next two weeks.  Just to leave you guys hanging, here's a very early preview of the next big feature that I've been working on for Contract Configurator:

gOZwxO2.png

Link to comment
Share on other sites

Hi all! I got an error message from the plugin. It reads as follow:

Exception occured while saving contract parameter 'RecoverKerbal' in contract 'KerbinSideJobs.VIKRecruit':
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[System.String,System.Boolean].get_Item (System.String key) [0x00000] in <filename unknown>:0
  at ContractConfigurator.Parameters.RecoverKerbalCustom.OnParameterSave (.ConfigNode node) [0x00000] in <filename unknown>:0
  at ContractConfigurator.Parameters.ContractConfiguratorParameter.OnSave (.ConfigNode node) [0x00000] in <filename unknown>:0

as asked I posted the error message.

thank you for this great mod.

 

Link to comment
Share on other sites

18 hours ago, nightingale said:

Just a quick heads up that I'm going to be travelling for work (boo) and then for vacation (yay), so I'll be somewhat unavailable for the next two weeks.  Just to leave you guys hanging, here's a very early preview of the next big feature that I've been working on for Contract Configurator:

You b@5t#rd! :D Oh well, we all need vacations sooner or later.

Enjoy the time off and we'll all be waiting patiently (right, everyone?) for your return.

Link to comment
Share on other sites

18 hours ago, nightingale said:

Just a quick heads up that I'm going to be travelling for work (boo) and then for vacation (yay), so I'll be somewhat unavailable for the next two weeks.  Just to leave you guys hanging, here's a very early preview of the next big feature that I've been working on for Contract Configurator:

gOZwxO2.png

What am I looking at here? Is this a WYSIWYG editor for contracts? Enjoy your vacation! :D 

Link to comment
Share on other sites

1 hour ago, SpiralOut said:

What am I looking at here? Is this a WYSIWYG editor for contracts? Enjoy your vacation! :D 

Noooo, no WYSIWYG editor.  That's the prototype for the new contract view in mission control (to hopefully address the question "how do I get contract X to show", among other things).

Link to comment
Share on other sites

6 hours ago, paelleon said:

Hi all! I got an error message from the plugin. It reads as follow:

Exception occured while saving contract parameter 'RecoverKerbal' in contract 'KerbinSideJobs.VIKRecruit':
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[System.String,System.Boolean].get_Item (System.String key) [0x00000] in <filename unknown>:0
  at ContractConfigurator.Parameters.RecoverKerbalCustom.OnParameterSave (.ConfigNode node) [0x00000] in <filename unknown>:0
  at ContractConfigurator.Parameters.ContractConfiguratorParameter.OnSave (.ConfigNode node) [0x00000] in <filename unknown>:0

as asked I posted the error message.

thank you for this great mod.

 

Raised #527.

Link to comment
Share on other sites

Hello,

I havn't found my answer on the topic or in the documentation so I allow myself to ask this question :

I want to make flyby contract (for RP-0 and RSS Expansion) for dual body : Pluto/Charon or Ida/Dactyl eg.
 - So I need to specify both bodies into the ReachState parameter : are the bodies separated by comma, or have I to make a list of strings?
 - For the CollectScience parameter, are many bodies allowed? Else, is there a way to specify to collect science on the first body or the second one?

Thanks for your help!

Link to comment
Share on other sites

1 hour ago, hargn said:

Hello,

I havn't found my answer on the topic or in the documentation so I allow myself to ask this question :

I want to make flyby contract (for RP-0 and RSS Expansion) for dual body : Pluto/Charon or Ida/Dactyl eg.
 - So I need to specify both bodies into the ReachState parameter : are the bodies separated by comma, or have I to make a list of strings?
 - For the CollectScience parameter, are many bodies allowed? Else, is there a way to specify to collect science on the first body or the second one?

Thanks for your help!

On a plane waiting to take off, so apologies for the brevity.

ReachState - just have two targetBody lines.

CollectScience - only one body.  Wrap in an Any parameter to have a choice of two.

Link to comment
Share on other sites

Ok, thanks @nightingale,

No problems for the CollectScience wraped into the Any statement.
But to be sure about the ReachState when you say to use two targetBody lines, is this example valid?

PARAMETER
{
	name = ReachState
	type = ReachState
	targetBody = Pluto
	targetBody = Charon
	maxAltitude = 20000000
	disableOnStateChange = true
}

 

Link to comment
Share on other sites

6 hours ago, hargn said:

Ok, thanks @nightingale,

No problems for the CollectScience wraped into the Any statement.
But to be sure about the ReachState when you say to use two targetBody lines, is this example valid?


PARAMETER
{
	name = ReachState
	type = ReachState
	targetBody = Pluto
	targetBody = Charon
	maxAltitude = 20000000
	disableOnStateChange = true
}

 

Yup, you got it.

Link to comment
Share on other sites

I am trying to write a satellite contract that requires a synchronous orbit. Is there an easy function that allows me to pull the sidereal period of a body to be orbited?

Thanks again for your great mod!

Link to comment
Share on other sites

11 hours ago, pap1723 said:

I am trying to write a satellite contract that requires a synchronous orbit. Is there an easy function that allows me to pull the sidereal period of a body to be orbited?

Thanks again for your great mod!

Nothing that gets the sidereal period directly, but should be possible using expressions and the available attributes.

Link to comment
Share on other sites

I love this mod, and the variety of interesting contract packs for it. It is REALLY cool to have goals set for me that I might not have thought of myself.

 

I am having a reoccurring problem, though. It happens with contracts of all sorts that require me to dock with, and stay docked with a vessel for some amount of time, like the "bring tourists to visit station" contracts. After docking, the mission parameter "vessl: xxx station" remains unchecked, and there is a note in blue text saying "no vessel currently matching parameters", which persists even if I undock and re-dock.

 

Basically, mission parameters that have to be completed on a specific vessel seem to break, and decide that the vessel in question doesn't exists, especially if docking is involved.

 

Do you have any ideas as to what I ought to look into, or what information would be useful to send to you? Thanks for you time, and for the cool mod! :)

Link to comment
Share on other sites

I'm having trouble with completing contracts.  the ones on this flight were observations.  I did the crew report and the waypoints would advance but they would not show as complete, therefore the mission could not be completed.  There are some null references in the logs.

KSP.log

output_log.txt

Link to comment
Share on other sites

8 hours ago, Tokamak said:

I love this mod, and the variety of interesting contract packs for it. It is REALLY cool to have goals set for me that I might not have thought of myself.

 

I am having a reoccurring problem, though. It happens with contracts of all sorts that require me to dock with, and stay docked with a vessel for some amount of time, like the "bring tourists to visit station" contracts. After docking, the mission parameter "vessl: xxx station" remains unchecked, and there is a note in blue text saying "no vessel currently matching parameters", which persists even if I undock and re-dock.

 

Basically, mission parameters that have to be completed on a specific vessel seem to break, and decide that the vessel in question doesn't exists, especially if docking is involved.

 

Do you have any ideas as to what I ought to look into, or what information would be useful to send to you? Thanks for you time, and for the cool mod! :)

For now I'd raise a GitHub issue with a ksp.log.  There's some extra debug that is helpful on the ContactVesselTracker class (set it to verbose).  There are instructions in the wiki (normally I'd send a link, but currently I'm out of town with limited access).

2 hours ago, icedown said:

I'm having trouble with completing contracts.  the ones on this flight were observations.  I did the crew report and the waypoints would advance but they would not show as complete, therefore the mission could not be completed.  There are some null references in the logs.

KSP.log

output_log.txt

Sounds like you're describing the stock contracts - you may have better luck posting a topic in the support forum.

Link to comment
Share on other sites

@nightingale can you confirm that the All parameter is coded to accept the "optional = true" statement?

 

This is how I'm using mine:

 

//Navigate to new waypoint and plant flag
    PARAMETER
    {
        name = All
        type = All
        title = optional: plant a flag near the tower
        
        PARAMETER
        {
            name = VisitWaypoint
            type = VisitWaypoint
            index = 3
            title = walk your pilot to the Island Air Tower waypoint
            
            distance = 5
            hideOnCompletion = true
            
            completeInSequence = true
            disableOnStateChange = false
            hideChildren = true
            
        }
        
        PARAMETER
        {
            name = PlantFlag
            type = PlantFlag
            title = and plant a flag
            
            targetBody = Kerbin
            
            completeInSequence = true
            disableOnStateChange = true
        
        }
        
        completeInSequence = false
        disableOnStateChange = true

        optional = true
        
    }

Edited by inigma
Link to comment
Share on other sites

1 hour ago, inigma said:

@nightingale can you confirm that the All parameter is coded to accept the "optional = true" statement?

This is how I'm using mine:

<snip>

Should be, since it's not in the parameter itself that the optional checks are performed.  I assume you're having a problem somewhere?

Link to comment
Share on other sites

1 hour ago, nightingale said:

Should be, since it's not in the parameter itself that the optional checks are performed.  I assume you're having a problem somewhere?

I worked around it for now. Setting up a Requirement for astronaut complex 2 for flag planting. Not optional, but required if one has the building. It makes more sense anyways to do it. I've not run into any other issue. Disregard for now.

Link to comment
Share on other sites

2 hours ago, nightingale said:

Contract Configurator seems to be working in 1.1.3 without issue, although I will be releasing an update soon anyway (likely tonight).

unfortunately:

88hzQ0K.png

EDIT:  KSP.log:  https://gist.githubusercontent.com/anonymous/31dc8c0425c12c6216b3147f1d95e49d/raw/1bf7f82ec70c2cc8894d44016b7cdd6b2a325309/KSP.log

Also if it helps, I'm not remotely where I'd be flying by Venus, and I'm doing Moon impactor contracts, so that was definitely not an accepted contract.  I think I remember seeing it in my available list though.

Edited by Jim DiGriz
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...