nightingale

[1.8.x+] Contract Configurator [v1.28.0] [2019-10-17]

Recommended Posts

I am thinking about working into this (great) mod to create a ContractPack about reaching certain depths (or maybe certain points) in the oceans on Laythe and Eve. Its something that i really missed, especially since there are a few quite functional mods that allow the construction of submarines. Thanks to nightinggales work i might be able to do this even with my not-so-great programming skills.

Does anyone know if such a thing already exists? I didnt find anything yet, but i really don't want to do any redundant work. Also, if there is anything similar it would be nice to have it for inspiration.

Edited by Levv

Share this post


Link to post
Share on other sites

@Levv - check the second post of this thread, it should be mostly up to date.  If I remember there was a basic one for highest/lowest points in the solar system, and one or two maritime ones, which may have dependencies on mods that aren't supported on current KSP versions.

Share this post


Link to post
Share on other sites

I'm having problems with the KEES contracts from Nehemia Engineering Orbital Science . The contract is not recognising the 'recovery' portion of the contract after landing and capsule recovery. This may be due to a glitch in NEOS so I'm crossposting there as well.

Link to the log: 
https://www.dropbox.com/s/00wopjfzoucjhfd/output_log 2DEC2016.txt?dl=0

Any light you can shine on this would be helpful as this pack is very useful in the early game.

Share this post


Link to post
Share on other sites
5 hours ago, Sudragon said:

I'm having problems with the KEES contracts from Nehemia Engineering Orbital Science . The contract is not recognising the 'recovery' portion of the contract after landing and capsule recovery. This may be due to a glitch in NEOS so I'm crossposting there as well.

Link to the log: 
https://www.dropbox.com/s/00wopjfzoucjhfd/output_log 2DEC2016.txt?dl=0

Any light you can shine on this would be helpful as this pack is very useful in the early game.

Kees doesn't use contract configurator, it uses the stock contract system.

Share this post


Link to post
Share on other sites
2 minutes ago, severedsolo said:

Kees doesn't use contract configurator, it uses the stock contract system.

Hmmmmm.

Share this post


Link to post
Share on other sites

I have a question about how Contract Configurator coverts CelestialBody to a string.

I am trying to make a generic progression for pack. Whenever I have a celestial body that is the Mun or the Sun, when it gets converted to a string (in a title or description for example) there is an extra 'the' in front. Is it possible to have a way to strip off that?

for example, I have the following psudeo-config:

CONTRACT_GROUP
{
	name = GenericContracts
	displayName = Generic Contracts
	DATA
	{
		type = CelestialBody

		sunBody = Sun
	}
}

CONTRACT_TYPE
{
    name = LowSunFlyby
	group = contracts

	title = Low @GUBMcontracts:sunBody Flyby!
	description = The @GUBMcontracts:sunBody is super bright. Must get closer.
}

This has the output of:

Low the Sun Flyby!

The the Sun is super bright. Must get closer.

Share this post


Link to post
Share on other sites

@SirBriguy - Use @GUBMcontracts:sunBody.Name() to get the name of the celestial body without "the" in front.  Or alternatively, use "Low flyby of @GUBMcontracts:sunBody!" for that particular example.

Share this post


Link to post
Share on other sites

Just a heads up, not sure if this was covered before but when using the Galileo Planetary Pack you will get a nulref with Contract configurator that spams due to the body 'Sun' not being found.

My fix for this was to go into the science folder and modify the solarscience.cfg file to change 'sun' to Ciro and poof, worked fine. But without that change the nulref will just spam indefinitely.

Not sure of the fix but thought I should note the issue here in case anyone else runs into this or if there is a way to 'fix' this.

 

Share this post


Link to post
Share on other sites
Just now, nightingale said:

@TheReadPanda - Thanks for the heads up, that was already raised under #607, and will be fixed for the next release.

I also noted this fix in the Galileo thread as it seemed over there they were unsure of the fix and were just suggesting removing contract configurator... which would be a sad solution indeed!!!

Share this post


Link to post
Share on other sites
2 minutes ago, nightingale said:

"Doctor, my arm hurts when I bend it like this."

"I'll get the amputation saw."

Gotta admit, that put a smile on my face. Thanks. :D

Share this post


Link to post
Share on other sites

Weird bug... not even sure whether to put it on Github in case I'm doing something wrong.

NextUnreachedBody() - when you start a new game, this correctly returns Mun.

However, once you've reached Mun, it doesn't seem to update itself after that, even on game restarts. It's permanently stuck on Mun.

So, I thought it was going to be because the progression system wouldn't unlock the next body til you'd done so much around the previous one, so I wrote a little plugin which basically just spams the log with the result of "FinePrint.Utilities.ProgressUtilities.GetNextUnreached(1).FirstOrDefault().name" -  as you can see, KSP is saying "next body is Minmus" but CC is saying "nope, still on Mun".

VR42ph6.png

and the contract if you need it: http://pastebin.com/4ZFqfmNE

Share this post


Link to post
Share on other sites

@severedsolo - That one's on me - I set up the hook wrong, so it's caching the result after the first time it's called and never checking it again.  Fixed for the next release.

Share this post


Link to post
Share on other sites

New release, with lots of minor fixes (including better support for Galileo), and new minor features for contract authors.  Download here.

Contract Configurator 1.22.0

  • Added HasAntenna parameter (thanks Kerbas-ad-astra).
  • Added Vessel.AntennaTransmitPower() and Vesse.AntennaRelayPower() (thanks Kerbas-ad-astra).
  • Contract weights for celestial bodies are now set by Contract Configurator (affecting the likelihood of stock contracts generating for the given body).
  • Added minArgumentOfPeriapsis and maxArgumentOfPeriapsis to Orbit parameter.
  • Added horizontalDistance to VisitWaypoint.
  • Make references to 'Sun' generic in SolarScience.cfg to fix Galileo compatibility (thanks SirBriguy).
  • Added Sun() function to get the Sun in a non-name specific way.  Assumes a single star.
  • Change enum parsing to be case insensitive.
  • Change Vessel Identifier parsing to allow a wider range of characters.
  • Fixed format text for funding message in mission control (thanks JPLRepo).
  • Fixed issue with NextUnreachedBody() call caching results (thanks severedsolo).

Share this post


Link to post
Share on other sites

I have issue with CC 1.22.0, on loading my save I got this error message :

Quote

Exception occured while loading ScenarioModule 'PersistentDataStore':
System.Exception: Error parsing statement.
Error occurred near '*':
[ Vessel35853104-bcf9-449c-a797-d541e3f1f35d ]
..............................................* <-- HERE ---> System.ArgumentException: Expected ',' or ']', got end of statement.
  at ContractConfigurator.ExpressionParser.ExpressionParser`1[ContractConfigurator.VesselIdentifier].ParseList[List`1] () [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at ContractConfigurator.ExpressionParser.ExpressionParser`1[System.Collections.Generic.List`1[ContractConfigurator.VesselIdentifier]].ParseExpression (System.String key, System.String expression, ContractConfigurator.ExpressionParser.DataNode dataNode) [0x00000] in <filename unknown>:0
  at ContractConfigurator.ExpressionParser.ExpressionParser`1[System.Collections.Generic.List`1[ContractConfigurator.VesselIdentifier]].ParseExpressionGeneric (System.String key, System.String expression, ContractConfigurator.ExpressionParser.DataNode dataNode) [0x00000] in <filename unknown>:0
  at ContractConfigurator.PersistentDataStore.OnLoad (.ConfigNode node) [0x00000] in <filename unknown>:0

I did manually edit my persistent.sfs recently but the save was loading fine afterwards (with CC 1.21.0). The only ship I edited was "Space Hotel Station" and the problem here refer to "ASS Minmus Sat" (no joke it was built for a Astronomical Science Society 's contract).

Here is a zip with the persistent.sfs + output.log, a screenshot of my GameData folder and a list of my contract pack :

  • CleverSat
  • FieldResearch
  • KerbinSpaceStation
  • Spacetux/RoverMissions
  • Tourism

Share this post


Link to post
Share on other sites

Also got an error after updating. I've done no manual edits of my save.

Quote

Exception occured while loading ScenarioModule 'PersistentDataStore':
System.Exception: Error parsing statement.
Error occurred near '*':
[ Vessel4c2fd4af-72ef-4530-81c8-e2ede14f65b7, Vesseld843be27-6d38-449d-9b7a-ba4302535c3d ]
..........................................................................................* <-- HERE ---> System.ArgumentException: Expected ',' or ']', got end of statement.
  at ContractConfigurator.ExpressionParser.ExpressionParser`1[ContractConfigurator.VesselIdentifier].ParseList[List`1] () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at ContractConfigurator.ExpressionParser.ExpressionParser`1[System.Collections.Generic.List`1[ContractConfigurator.VesselIdentifier]].ParseExpression (System.String key, System.String expression, ContractConfigurator.ExpressionParser.DataNode dataNode) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.ExpressionParser.ExpressionParser`1[System.Collections.Generic.List`1[ContractConfigurator.VesselIdentifier]].ParseExpressionGeneric (System.String key, System.String expression, ContractConfigurator.ExpressionParser.DataNode dataNode) [0x00000] in <filename unknown>:0 
  at ContractConfigurator.PersistentDataStore.OnLoad (.ConfigNode node) [0x00000] in <filename unknown>:0 

 

Share this post


Link to post
Share on other sites

Hot fix for the issue reported above by @Li0n and @Tybot.  Download here.

Contract Configurator 1.22.1

  • Fixed issue with vessel identifier parsing introduced in 1.22.0 (thanks Li0n).

Share this post


Link to post
Share on other sites
10 minutes ago, nightingale said:

Fixed issue with vessel identifier parsing introduced in 1.22.0 (thanks Li0n).

I confirm, the save now loads fine. Thanks for the super quick support :)

Share this post


Link to post
Share on other sites

New release to fix the above bug.  Download here.

Contract Configurator 1.22.2

  • Fix argumentOfPeriapsis issue (thanks Intrepidrd).

Share this post


Link to post
Share on other sites

Hi @nightingale, first of all I would like to thank you for awesome mods. I would like to ask your help. I'm using Contract Configurator with 'Historic Missions Contract Pack', with the help of your Debug Tool I've found many mistakes in the contracts, things like the wrong names of planets and moons (Earth, Moon, Venus, Mars, etc. instead of the names of the Kerbol system celestial bodies), and other minor problems that a managed to correct. But I'm a noob in this matters and there are 3 things that I don't really know how to solve. I know this is not the place to ask help about other mod but the owner,  Whitecat106, hasn't responded in his page for quite sometime (his last entry was in July 26). 
In this contract:

CONTRACT_TYPE
{
    name = SoyuzT-6
    group = SoyuzMission
    title = SoyuzT-6
    notes = Lets dock with Salyut-7.
    synopsis = Launch the SoyuzT-6
    description = Soyuz T-6 was a manned spaceflight to Earth orbit to the Salyut 7 space station in 1982. Along with two Russians, the crew included a Frenchman, Jean-Loup Chretien.
    completedMessage = Mission Success!
    prestige = Trivial
    minExpiry = 1
    maxExpiry = 30
    agent = The Soyuz Program
    deadline = 10000
    maxCompletions = 1
    cancellable = true
    declinable = true
    targetBody = HomeWorld()
    rewardScience = 0
    rewardReputation = 50
    rewardFunds = 1000
    failureReputation = 75
    failureFunds = 50000
    advanceFunds = 30000

PARAMETER
{
	name = SoyuzT-6
	type = VesselParameterGroup
	title =  Launch the SoyuzT-6 into low kerbin orbit.
	define = SoyuzT-6


PARAMETER
{
	name = Orbit
	type = Orbit
	minPeA = 140000
	targetBody = HomeWorld()
	disableOnStateChange = true
}
}

PARAMETER
{
	name = Docking
	type = Docking
	vessel = SoyuzT-6
	vessel = Salyut-7
	disableOnStateChange = true
	defineDockedVessel = SoyuzT-6

PARAMETER
{
	name = Duration
	type = Duration
	duration = 7d 5h
	preWaitText = Dock with Salyut-7
        waitingText = Performing Experiments
        completionText = Experiments complete.
}
}
PARAMETER
{
	name = ReturnHome
	type = ReturnHome
	completeInSequence = true
}


REQUIREMENT
{
        name = PreviousMission
	type = CompleteContract
	contractType = Soyuz-40
	minCount = 1
	maxCount = 1
	cooldownDuration = 16d
}
REQUIREMENT
{
	name = CheckSoyuzMission
	type = Expression
	expression = HM_DOS6_Ready == 1
}

}

I get this error:

[Error] ContractConfigurator.ExpressionRequirement: CONTRACT_TYPE 'SoyuzT-6',
REQUIREMENT 'CheckSoyuzMission' of type 'Expression': missing required attribute 'title'.

---------------

in this other one:

CONTRACT_TYPE
{
	name = STS-41-G
	group = SpaceShuttleMission
	title = STS-41-G
	notes = So someone important wants a trip to space... look your best!
	synopsis = Perform the ninth orbital flight of a space shuttle.
	description = STS-41-G was the 13th flight of NASA's Space Shuttle program and the sixth flight of Space Shuttle Challenger. Challenger launched on 5 October 1984, and conducted the second shuttle landing at Kennedy Space Center on 13 October. It was the first shuttle mission to carry a crew of seven, including the first crew with two women (Sally Ride and Kathryn Sullivan), the first American EVA involving a woman (Sullivan), and the first Canadian astronaut (Marc Garneau).
	completedMessage = Mission Success!
	prestige = Trivial
	minExpiry = 1
	maxExpiry = 30
	agent = The Space Shuttle Program
	deadline = 30
	maxCompletions = 1
	cancellable = true
	declinable = true
	targetBody = HomeWorld()
	rewardScience = 10
	rewardReputation = 50
	rewardFunds = 50000
	failureReputation = 75
	failureFunds = 50000
	advanceFunds = 50000
	PARAMETER
	{
		name = STS-41-G
		type = VesselParameterGroup
		title = Launch the Space Shuttle Challenger into LKO and land it safely on the runway.
		notes = Carry the Kanadian Space Agencys Kerbonaut Marc Kerman into orbit and perform materials bay experiments.
		define = STS-41-G
		duration = 8d 5h
		PARAMETER
		{
			name = LKO
			type = Orbit
			targetBody = HomeWorld()
			situation = ORBITING
			maxAltitude = 220000
			disableOnStateChange = true
		}
		PARAMETER
		{
			name = HasCrew
			type = HasCrew
			minCrew = 6
			maxCrew = 7
			disableOnStateChange = true
		}
		PARAMETER
		{
			name = KSAPass
			type = HasPassengers
			count = 1
			index = 0
			title = Bring Marc Kerman from the Kanadian Space Agency to observe the mission
		}
		PARAMETER
		{
			name = CollectScience
			type = CollectScience
			targetBody = HomeWorld()
			situation = InSpaceLow
			experiment = mobileMaterialsLab
			recoveryMethod = RecoverOrTransmit
		}
		PARAMETER
		{
			name = NewVessel
			type = NewVessel
			hidden = true
		}
}
		PARAMETER
		{
			name = ReturnHome
			type = ReturnHome
			title = Safely Land the Shuttle.
		}
	REQUIREMENT
	{
		name = PreviousMission
		type = CompleteContract
		contractType = STS-41-D
		minCount = 1
		maxCount = 1
		cooldownDuration = 10d
	}
	REQUIREMENT
	{
		name = PartUnlocked
		type = PartUnlocked
		part = science_module
	}
	BEHAVIOUR
	{
		name = SpawnPassenger
		type = SpawnPassengers
		count = 1
		passengerName = Marc Kerman
		kerbalType = Tourist
		gender = Male
	}
}

I get this warning:

[WARNING] ContractConfigurator.Behaviour.SpawnPassengersFactory: The passengerName
and gender attributes are obsolete since Contract Configurator 1.9.0, use kerbal instead.

 

I also get this warning in some contract 'folders': [WARNING] ContractConfigurator.ContractConfigurator: Multiple assemblies with name 'ContractConfigurator' found!

If you could help me I would be very grateful. :)

Edited by PmThay

Share this post


Link to post
Share on other sites
44 minutes ago, PmThay said:

[Error] ContractConfigurator.ExpressionRequirement: CONTRACT_TYPE 'SoyuzT-6',
REQUIREMENT 'CheckSoyuzMission' of type 'Expression': missing required attribute 'title'.

It's as simple as it sounds - you need a line in the REQUIREMENT node with :

title = <Description of what is needed for the requirement to be met>

 

45 minutes ago, PmThay said:

[WARNING] ContractConfigurator.Behaviour.SpawnPassengersFactory: The passengerName
and gender attributes are obsolete since Contract Configurator 1.9.0, use kerbal instead.

Wouldn't worry too much about this one - obsolete stuff doesn't tend to get removed (Nightingale may disagree with me though, but I still use the old style passenger spawning)

Share this post


Link to post
Share on other sites

@PmThay - I thought that there were two versions of Historic Missions (one for stock, one for RSS).  Or maybe it was two directories in the download and you had to pick one?

Otherwise, pretty much what @severedsolo said.

The obsolete stuff is fine, although occasionally if I'm adding something new and stuff that's been obsolete for a long time makes it difficult I will rip it out.  But I wouldn't expect that to happen here.

Share this post


Link to post
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.