Jump to content

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


nightingale

Recommended Posts

7 hours ago, Conventia said:

I just installed the new CC in a RP0 install. When I decline contracts, new ones don't seem to pop up in their place. Is this expected? With the previous version, declining a contract would almost always result in a new contract coming up in it's place. (I know this is probably a poor game play choice, but having 6 satellite contracts around Mars and the Sun doesn't help me when I can only do missions around Earth.)

Could be a bug, hard to say.  If you wait about 30 seconds, does one come up then?  Are there errors/exceptions in your log (if you're not sure, send the log and I'll take a look).

Link to comment
Share on other sites

Whew.

I have a contract pack that technically works and is usable in-game, so long as you don't have any mods with parts in them installed. I'm not quite ready to release but I'd love feedback if anybody wants to give it a try.

THIS WILL SCREW UP ANY GAMES YOU PLAY ON THE INSTALL. I think if you just uninstall everything will go back to normal, but don't guarantee anything. This is not "just" a contract pack; it eliminates R&D and puts ALL parts into their own contracts, that you must complete to unlock the part. It also basically makes the "Available" tab in Mission Control useless, but the new "All" tab that Contract Configurator supplies makes this pack pretty workable.

Technically, all parts are available from the start but the higher tier ones are pretty expensive. This is by design so don't tell me about it as if it's a bug :)

What I'm looking for is thoughts on pricing. Is it too low? Too high? I based the costs off of the cost to unlock the part in the stock game. I took that number and multiplied it by 10.

Also, some questions for @nightingale or anyone else with experience in contracts:

  • Is there a way to make this generic, so that when new parts are added in the stock game or a mod is installed, it "just works"? Right now I've got a huge config with one contract per part, and it's a bit daunting. I didn't write the whole thing, I did it with a likely-equally-daunting batch file (that I've included in the zip. It won't run at all if you try, unless you edit it. You have to know a decent bit about grep, sed, head, tail, and regular expressions to even have a chance at figuring it out. I did add comments though). Right now, I'd have to modify that batch file to find part configs from other mods and there are multiple reasons why that's not an ideal solution. I understand if this is too vague of a question. I'm not hopeful, mostly I'm just hoping :)
  • Why is my logo not coming up? It comes up when I don't have any ContractGroups but when I added them, it's now a white square.
  • Is there a way to put images in a contract description? I'd love to put a picture of the part in the contract. I also think the stock game should have these pictures on test contracts.

Download

Image of the "No Icon" problem.

 

 

Link to comment
Share on other sites

1 hour ago, nightingale said:

Could be a bug, hard to say.  If you wait about 30 seconds, does one come up then?  Are there errors/exceptions in your log (if you're not sure, send the log and I'll take a look).

It seems to refresh contracts on reload (consistently). Waiting sometimes results in a refresh but not always. I don't see any contract configurator errors, but I'll send the log anyways.

Link to comment
Share on other sites

Contract rewards changing, randomly. They'll get randomized when I load a saved game (either ones I've accepted or the ones listed as available, no difference), they'll get randomized when I recover (so I save right before and reload if I get a reward that's too low).

I looked in the output log when this happens and I don't see anything in there except for the Kopernicus stuff (as shown at bottom). Is this known? Should I be looking at a different log? Thanks for any help.

i.e.

Non-rocky from regular list:
(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 64)

    Jool 

<etc>

 

Link to comment
Share on other sites

Thanks man, as soon as I installed the update I had a tourism plus contract set to expire in 97 days. I'd guess that fits with the default 5-100 days. As far as I can tell, all of my contract modifications seem to work.

So that leads me to ask if you might use (cooldownDuration = ) for tourism Plus? Doing that might also allow for maxSimultaneous = 2.

What I meant was "cooldownDuration = Random(10d, 200d)" And so on...

Edited by DarkonZ
ooops
Link to comment
Share on other sites

11 minutes ago, Starfire70 said:

Contract rewards changing, randomly. They'll get randomized when I load a saved game (either ones I've accepted or the ones listed as available, no difference), they'll get randomized when I recover (so I save right before and reload if I get a reward that's too low).

Not a known issue.  Are you using Strategia?  Can you provide a log with debug turned on (instructions here).

5 hours ago, Conventia said:

It seems to refresh contracts on reload (consistently). Waiting sometimes results in a refresh but not always. I don't see any contract configurator errors, but I'll send the log anyways.

I'll have a look at this and let you know.

6 hours ago, 5thHorseman said:
  • Is there a way to make this generic, so that when new parts are added in the stock game or a mod is installed, it "just works"? Right now I've got a huge config with one contract per part, and it's a bit daunting. I didn't write the whole thing, I did it with a likely-equally-daunting batch file (that I've included in the zip. It won't run at all if you try, unless you edit it. You have to know a decent bit about grep, sed, head, tail, and regular expressions to even have a chance at figuring it out. I did add comments though). Right now, I'd have to modify that batch file to find part configs from other mods and there are multiple reasons why that's not an ideal solution. I understand if this is too vague of a question. I'm not hopeful, mostly I'm just hoping :)

Most definitely:

CONTRACT_TYPE
{
	name = PartAero
	group = PartsUnlimitedAero
    sortKey = 0020000
    genericTitle = Unlock the @part
    genericDescription = Use the @part to gain access to it for good.
	title = @part
    description = Unlock the @part
	synopsis = Use the @part to gain access to it for good.
	completedMessage = You now have access to the @part for good.
	prestige = Trivial
	declinable = false
    targetBody = Kerbin
	agent = Parts Unlimited Ltd.
	maxCompletions = 1
	minExpiry = 0
    maxExpiry = 0
	advanceFunds = -0020000
    rewardScience = 0
    rewardReputation = 0
    rewardFunds = 0
    failureFunds = 0
	failureReputation = 0

    DATA_EXPAND
    {
        type = AvailablePart
        part = AllParts().Where(p => p.Category() == Aero)

        hidden = true
    }

	PARAMETER
	{
		name = PartValidation
		type = PartValidation
		part = @/part
	}
	BEHAVIOUR
	{
		name = ExperimentalPart
		type = ExperimentalPart
		part = @/part
	}
	BEHAVIOUR
	{
		name = UnlockPart
		type = UnlockPart
		part = @/part
		unlockTech = true
	}
}

That version is just for the aero stuff, but should be a simple template for you to work off of.  Unfortunately, it doesn't work in 1.18.1 because it uncovered a bug in the part parser.  I've fixed it for the next release, in the meantime if you want to test that out, try the dev dll here.

6 hours ago, 5thHorseman said:
  • Why is my logo not coming up? It comes up when I don't have any ContractGroups but when I added them, it's now a white square.

It works for me, but I saw Texture Replacer doing stuff to it in my logs.  I'd double check the sizing of the scaled logo file (I forget the exact size it's supposed to be - check the stock ones to find out).

6 hours ago, 5thHorseman said:
  • Is there a way to put images in a contract description? I'd love to put a picture of the part in the contract. I also think the stock game should have these pictures on test contracts.

Not currently, although I agree that would be nice.  How I'd hack it:

  • Create one agency per part.
  • Use a picture of the part for the agency logo
  • Assign the correct agency for each part
22 minutes ago, DarkonZ said:

So that leads me to ask if you might use (cooldownDuration = ) for tourism Plus? Doing that might also allow for maxSimultaneous = 2.

Yup, good suggestion - mind raising it on GitHub for me?

Link to comment
Share on other sites

I'm sure this is already a known issue that has been discussed elsewhere in this thread, and I sincerely apologize for asking this again. 

I have an RP-0 install that I have been running since KSP 1.12, and although several of the mods have since been upgraded without incident, many have not, and thus still remain in their original state. This includes my version of CC. When attempting the First Space Station contract, I encountered the now-known bug, but I was too lazy to upgrade and simply terminated the contract. Fast forward two months, and I had a Human Orbital (2/LEO) contract, which I preferred to use an already launched "station" (More a food container with docking ports on the side) to facilitate this mission. Unfortunately, upon completion of the orbital parameters, undocking reset the contract. A perusal of the Github releases showed that a recent release had fixed this issue. "Wonderful," I thought to myself. Very fortunately, I made a backup of my version of CC just in case anything happened. When I installed the new version and booted up KSP, I found that all contracts were divided into categories, and each category had a drop-down list of contracts (I'm not sure how long this has been the case, I've been using an old version of CC for a very long time and have had few issues with it). That wasn't a real issue. The issue was that, while the auto-accept contracts were behaving normally, every RP-0 contract had no description and no option to be accepted. Thus, I was left with only the contracts I had already accepted, one of which was corrupted. Sorry to bring this up, and I know others probably have done so already. Is there anything I can do to fix this? I'd love to be able to complete my 2/LEO contract without editing the save file, but I obviously don't want to destroy my game. Thanks so much for your response. 

Link to comment
Share on other sites

1 hour ago, nightingale said:

I'll have a look at this and let you know.

After playing more, I've noticed that entering the tracking station or completing a contract will spawn new contracts but warping or just waiting doesn't cause spawning to happen. Hopefully that helps you narrow it down.

Link to comment
Share on other sites

4 hours ago, nightingale said:

That version is just for the aero stuff, but should be a simple template for you to work off of.

I'll try it when I can. So it'll just automagically make a one-off contract for each part in the aero tab? That seems brilliant, and maybe I'll understand it one day :)

Though I vaguely recall using "@part" in my failed attempt at the Scavenger contract pack, and it gave the internal part name, not the external one. So it'll say something like "Unlock the noseCone" which is the internal part used by the code instead of "Unlock the Aerodynamic Nose Cone" which is the user-facing name of the part in the game.

4 hours ago, nightingale said:
  • Create one agency per part.
  • Use a picture of the part for the agency logo
  • Assign the correct agency for each part

Speaking of brilliant...

Link to comment
Share on other sites

Ah one more issue with the generic config:

 

	sortKey = 0020000
...
	advanceFunds = -0020000

These are specific to the parts, and are based on the part cost. Sortkey isn't a big deal (though it's nice) but I need the advanceFunds to be logically larger based on the stock prices.

Link to comment
Share on other sites

@gemini4 - Sounds like the same issue as @Conventia (which I haven't investigated yet).

4 hours ago, 5thHorseman said:

I'll try it when I can. So it'll just automagically make a one-off contract for each part in the aero tab? That seems brilliant, and maybe I'll understand it one day :)

It's all in the wiki (somewhere). :wink:

4 hours ago, 5thHorseman said:

Though I vaguely recall using "@part" in my failed attempt at the Scavenger contract pack, and it gave the internal part name, not the external one. So it'll say something like "Unlock the noseCone" which is the internal part used by the code instead of "Unlock the Aerodynamic Nose Cone" which is the user-facing name of the part in the game.

Yes, that was something else I just fixed when I was testing that sample out...  now it'll do the proper human-readable name (as of dev/1.18.2).

1 hour ago, 5thHorseman said:

Ah one more issue with the generic config:


	sortKey = 0020000
...
	advanceFunds = -0020000

These are specific to the parts, and are based on the part cost. Sortkey isn't a big deal (though it's nice) but I need the advanceFunds to be logically larger based on the stock prices.

Right - I didn't want to solve every problem for you.  For both, you can look at the methods available on the Part in Contract Configurator here.  My suggestion would be something like this:

	sortKey = @advanceFunds
	advanceFunds = @part.Cost() * 10

Let me know if there's anything else you want in those expressions and I can add it if it's reasonable (for example, the unlock cost appeared to be missing).

Link to comment
Share on other sites

26 minutes ago, nightingale said:

@gemini4 - Sounds like the same issue as @Conventia (which I haven't investigated yet).

It's all in the wiki (somewhere). :wink:

Yes, that was something else I just fixed when I was testing that sample out...  now it'll do the proper human-readable name (as of dev/1.18.2).

Right - I didn't want to solve every problem for you.  For both, you can look at the methods available on the Part in Contract Configurator here.  My suggestion would be something like this:


	sortKey = @advanceFunds
	advanceFunds = @part.Cost() * 10

Let me know if there's anything else you want in those expressions and I can add it if it's reasonable (for example, the unlock cost appeared to be missing).

Sometimes I need it all done for me :)

Thanks for the sample code. I can't tell you how much it helps. For some reason an explanation frequently does nothing for me while a (well-crafted) code snippet can work wonders on my brain.

Also: knowing it's possible (instead of what I assumed, that it was so niche that nobody would have even thought of it but me) helps, so I know I'm not just hitting my head on a brick wall. It's more like drywall, my head well penetrate it eventually.

Link to comment
Share on other sites

Getting this error when entering and then hanging out in Mission Control :

Spoiler

[UIMasterController] RemoveCanvas:ResearchAndDevelopment
 
(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 64)

[8/28/2016 12:24:38 PM] [TimeControl(2.26052): ]: <Info> (TCGUI.onShowUI) - Unhiding GUI for Settings Lock
 
(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 64)

UIMasterController: ShowUI
 
(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 64)

Game Paused!
 
(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 64)

NullReferenceException: Object reference not set to an instance of an object
  at ContractConfigurator.Util.MissionControlUI.OnSelectContract (KSP.UI.UIRadioButton button, CallType callType, UnityEngine.EventSystems.PointerEventData data) [0x00000] in <filename unknown>:0
  at ContractConfigurator.Util.MissionControlUI.HandleRemovedContract (Contracts.Contract c) [0x00000] in <filename unknown>:0
  at ContractConfigurator.Util.MissionControlUI.OnContractFinished (Contracts.Contract c) [0x00000] in <filename unknown>:0
  at EventData`1[Contracts.Contract].Fire (Contracts.Contract data) [0x00000] in <filename unknown>:0
  at Contracts.Contract.SetState (State newState) [0x00000] in <filename unknown>:0
  at Contracts.Contract.Update () [0x00000] in <filename unknown>:0
  at ContractConfigurator.ContractPreLoader.Update () [0x00000] in <filename unknown>:0 
 
(Filename:  Line: -1)

NullReferenceException: Object reference not set to an instance of an object
  at ContractConfigurator.Util.MissionControlUI.OnSelectContract (KSP.UI.UIRadioButton button, CallType callType, UnityEngine.EventSystems.PointerEventData data) [0x00000] in <filename unknown>:0
  at ContractConfigurator.Util.MissionControlUI.HandleRemovedContract (Contracts.Contract c) [0x00000] in <filename unknown>:0
  at ContractConfigurator.Util.MissionControlUI.OnContractFinished (Contracts.Contract c) [0x00000] in <filename unknown>:0
  at EventData`1[Contracts.Contract].Fire (Contracts.Contract data) [0x00000] in <filename unknown>:0
  at Contracts.Contract.SetState (State newState) [0x00000] in <filename unknown>:0
  at Contracts.Contract.Update () [0x00000] in <filename unknown>:0
  at ContractConfigurator.ContractPreLoader.Update () [0x00000] in <filename unknown>:0 
 
(Filename:  Line: -1)

NullReferenceException: Object reference not set to an instance of an object
  at ContractConfigurator.Util.MissionControlUI.OnSelectContract (KSP.UI.UIRadioButton button, CallType callType, UnityEngine.EventSystems.PointerEventData data) [0x00000] in <filename unknown>:0
  at ContractConfigurator.Util.MissionControlUI.HandleRemovedContract (Contracts.Contract c) [0x00000] in <filename unknown>:0
  at ContractConfigurator.Util.MissionControlUI.OnContractFinished (Contracts.Contract c) [0x00000] in <filename unknown>:0
  at EventData`1[Contracts.Contract].Fire (Contracts.Contract data) [0x00000] in <filename unknown>:0
  at Contracts.Contract.SetState (State newState) [0x00000] in <filename unknown>:0
  at Contracts.Contract.Update () [0x00000] in <filename unknown>:0
  at ContractConfigurator.ContractPreLoader.Update () [0x00000] in <filename unknown>:0 
 
(Filename:  Line: -1)

 

Loggitude: https://dl.dropboxusercontent.com/u/59567837/output_log_CC_nre.txt

Edited by AccidentalDisassembly
named the wrong building
Link to comment
Share on other sites

The log doesn't say much as this behavior from what I can see in the debug window. Is there a physical log file this is saved to?

Here are some screenshots showing what I'm talking about. Just took 2 tourists over the southern mountains.

http://imgur.com/a/schWw

The reward displayed on the contract was about 100k, but the actual reward I received was about 200k (looking at the difference in my spesos at the beginning and the end), and yet the report on the contract displays a reward of 21k. %)

 

Edited by Starfire70
Link to comment
Share on other sites

Thanks! @nightingale, I emailed the log to you.

Is there some secret to attaching files on here? I tried 'insert other media', 'insert existing attachment' which took me to a popup page that made it appear like I need to upload these files elsewhere before they show up as available to insert.

Edited by Starfire70
Link to comment
Share on other sites

1 minute ago, Starfire70 said:

@nightingale No worries, no rush. It's annoying, but nothing more than that. Let me know if you want me to try something or need anything else from me to help figure it out.

You can grab the dev dll and let me know if that fixes your issue. :)

@AccidentalDisassembly@Conventia, @gemini4 - I think these problems all stem from the same issue - if you guys don't mind taking the dev version for a test drive as well it would be appreciated.

Link to comment
Share on other sites

On 8/28/2016 at 1:05 AM, nightingale said:

Let me know if there's anything else you want in those expressions and I can add it if it's reasonable (for example, the unlock cost appeared to be missing).

I would like the unlock cost. Looking over part costs, they don't scale with tech level like unlock costs do.

Looking over the stuff in part config files, the only other things that I could see being useful to me would be "mass" and "maxAmount" of each resource, though neither of those is critical.

Link to comment
Share on other sites

On 8/3/2016 at 8:05 PM, Bombaatu said:

I've stopped getting any rescue contracts on new games. Has anyone else seen this issue? I don't even see them as available in the list of stock contracts in the CC UI. 

I have this issue too.  Since I started a fresh career in 1.1.3 I no longer get rescue missions. I've landed kerbals on Mun and Minmus and have space stations around Kerbal and Minmus.  Not a single rescue mission.  As an experiment I loaded my save in a pure stock game, and though of course all my ships and stations were missing, with lots of missing parts errors, I was able to run the game on a couple of days to generate new contracts, and a rescue mission immediately spawned.

Edited by Chippy the Space Dog
Link to comment
Share on other sites

@5thHorseman - New stuff for next release in Part expressions:

int UnlockCost() The cost to unlock a part when part entry purchase is required.
List<Resource> Resources() Returns a list of all resources that this part can hold.
double ResourceCapacity(Resource) The part's capacity for holding the given type of resource.

@Chippy the Space Dog - What contract packs do you have installed?  If I remember correctly, there's one or two that disable rescue contracts (but I forget which).  In the space centre, click the Contract Configurator icon, and then check whether the RecoverAsset line is disabled or not (you can mouseover to see what disabled it, and click it to re-enable for that save).

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