Jump to content

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


nightingale

Recommended Posts

I have A problem!

So I have wired performance issues with KSP! And I noticed that it only appears in career mode!

At the end I pinpointed it to Contract Configurator!

Even on A fresh install of KSP Contract Configurator cuts my FPS in the space center screen from 120 down to like 40..

Am I the only guy experiencing this? kinda wired for a config mod Oo

Link to comment
Share on other sites

I have A problem!

So I have wired performance issues with KSP! And I noticed that it only appears in career mode!

At the end I pinpointed it to Contract Configurator!

Even on A fresh install of KSP Contract Configurator cuts my FPS in the space center screen from 120 down to like 40..

Am I the only guy experiencing this? kinda wired for a config mod Oo

What contract packs do you have installed? Is it only on a new game, or does it happen on existing games (there's a background load process that will happen for a minute or two on a new game to load some biome data that's used in some contracts).

Best guess is that it has to do with how KSP loads contracts. Once I get more info I may ask you to run with some custom debug settings to see if we can pinpoint where the issue is (and see if anything can be done about it).

Link to comment
Share on other sites

What contract packs do you have installed? Is it only on a new game, or does it happen on existing games (there's a background load process that will happen for a minute or two on a new game to load some biome data that's used in some contracts).

Best guess is that it has to do with how KSP loads contracts. Once I get more info I may ask you to run with some custom debug settings to see if we can pinpoint where the issue is (and see if anything can be done about it).

OK! Thanks for the tip! You are right after a few minutes the FPS come back up in a fresh install just with the configurator but in my current modded game with more mods and 10 contract packs the FPS are inconsistent.. I will do more testing and try to find out what is going on and than I report back!

Link to comment
Share on other sites

chrisl - I realized that this was an RP-0 question, so I found the contract that was causing the issue and did some testing with it. There was a bug where the state of the timer could get reset if there was lots of parameters and a scene change or vessel change. I've fixed the bug for 1.7.6.

In future you may want to mention that it's RP-0 (or better yet, link to the contract in question in GitHub). It'll help me investigate much quicker. :)

Is this fix part of the dev dll on github?

Link to comment
Share on other sites

I downloaded the dev dlls to try them out. They sort of work. I can get the duration going for my vessel in orbit, then return to KSC to speed up time. Then I can switch back to the vessel and the duration will have advanced correctly. It's a start but I still ran into a problem. My capsule is currently in orbit working to complete the 2nd half of the 2/LEO mission. It has to remain in orbit for another 9 days. But in 7 days, I have a new probe that will be ready to launch to fulfill another contract. When I got the other probe ready to launch (using KCT) I found that I needed to advance time a bit so I could launch into a specific orbit but due to an unrelated problem (sometimes when I put a craft on the launch pad, the game thinks it's launched even before I actually launch it resulting in my not being able to speed time correctly) I had to leave the launch pad and advance time from the tracking station. I had several hours pass while I waited for KSC to be in the correct position, then I switched back to my initial capsule to make sure it was still on track. Unfortunately, even though 7 days had passed and it looked like the timer was working properly, when I switched back to my capsule for this second look, the timer had been reset back to 9 days. It seems like the fix you included in the dev dll does keep the timer working if you jump to KSC and back to the vessel that is fulfilling the contract, but if you jump to another vessel, the timer can start over.

Link to comment
Share on other sites

I downloaded the dev dlls to try them out. They sort of work. I can get the duration going for my vessel in orbit, then return to KSC to speed up time. Then I can switch back to the vessel and the duration will have advanced correctly. It's a start but I still ran into a problem. My capsule is currently in orbit working to complete the 2nd half of the 2/LEO mission. It has to remain in orbit for another 9 days. But in 7 days, I have a new probe that will be ready to launch to fulfill another contract. When I got the other probe ready to launch (using KCT) I found that I needed to advance time a bit so I could launch into a specific orbit but due to an unrelated problem (sometimes when I put a craft on the launch pad, the game thinks it's launched even before I actually launch it resulting in my not being able to speed time correctly) I had to leave the launch pad and advance time from the tracking station. I had several hours pass while I waited for KSC to be in the correct position, then I switched back to my initial capsule to make sure it was still on track. Unfortunately, even though 7 days had passed and it looked like the timer was working properly, when I switched back to my capsule for this second look, the timer had been reset back to 9 days. It seems like the fix you included in the dev dll does keep the timer working if you jump to KSC and back to the vessel that is fulfilling the contract, but if you jump to another vessel, the timer can start over.

The solution to the issue should've been fairly generic, so might be there's another problem happening here. I'll take a look and let you know.

Link to comment
Share on other sites

Can I ask what governs when a contract is withdrawn? I'm having some issues with contracts being withdrawn before I've even seen them, and I'm curious to know why this is, and if withdrawn contracts are ever offered again.

If you haven't seen them, how do you know they've been withdrawn? :)

This is something that is part stock, and part up to the contract author. There are optional fields to specify a minimum and maximum expiry period, and any contract generated gets an expiry within that range (unless they aren't specified, and then it should have no expiry). This expiry is the amount of time the contract will stick around before being withdrawn.

Now, the thing to keep in mind, is that the contracts are pretty random. So as long as their requirements are met, the contract (or a very similar one will get offered again). Easiest thing to do if you're looking for something specific is to just cancel the ones you don't like until the "right" one comes up.

Link to comment
Share on other sites

Quick question (I'm fairly certain I know the answer):

If I had a main contract group, then two sub groups, but for whatever reason, the player decides not to install any contracts from one of the sub-groups, CC won't care right? It will just throw an error in the log and carry on?

Edited by severedsolo
Link to comment
Share on other sites

Quick question (I'm fairly certain I know the answer):

If I had a main contract group, then two sub groups, but for whatever reason, the player decides not to install any contracts from one of the sub-groups, CC won't care right? It will just throw an error in the log and carry on?

Correct, I think there was a warning for an empty group. Even if it's an error, won't actually affect anything.

Link to comment
Share on other sites

Hey Nightingale, thanks for the suggestion on the asteroids, I was able to get them working just how I wanted, I even figured out how to change the size of them. But now I have come across a problem with adding the part test module to other parts, mainly the orbital survey scanner and surface scanner. I added the proper module to the parts in question via module manager, and wrote a simple contract to run the tests for debugging purposes. However the option to run the tests never shows up on the parts, even with environments set to any for the module and the child nodes of the run_test parameter completed(uploaded before adding the child nodes, just pretend they are in there). I've provided the link to the files I wrote as well as the whole rest of the mod, if you or anyone else gets a chance to look at it. Am I just using the parameter wrong or is that not fully implemented yet? As always thanks in advance. Link: http://s000.tinyupload.com/index.php?file_id=03636414289440759411

Link to comment
Share on other sites

When setting up a contract, is there a way to determine the player's current prestige and adjust the requirements and rewards based on that? For instance, if you wanted a contract to be available at any prestige level, but wanted to make it harder to complete and have higher rewards if the player has a higher prestige. Or would you have to create different contracts for each prestige level?

Link to comment
Share on other sites

I get this error when loading into the game

Exception occured while loading ScenarioModule 'ContractPreLoader':System.NullReferenceException: Object reference not set to an instance of an object

at Contracts.ContractSystem.GetParameterType (System.String typeName) [0x00000] in <filename unknown>:0

at Contracts.Contract.Load (Contracts.Contract contract, .ConfigNode node) [0x00000] in <filename unknown>:0

at ContractConfigurator.ContractPreLoader.OnLoad (.ConfigNode node) [0x00000] in <filename unknown>:0

Any help is appreciated and also, great job on this one, it's mods like these that make everyone's life easier

Link to comment
Share on other sites

Hey Nightingale, thanks for the suggestion on the asteroids, I was able to get them working just how I wanted, I even figured out how to change the size of them. But now I have come across a problem with adding the part test module to other parts, mainly the orbital survey scanner and surface scanner. I added the proper module to the parts in question via module manager, and wrote a simple contract to run the tests for debugging purposes. However the option to run the tests never shows up on the parts, even with environments set to any for the module and the child nodes of the run_test parameter completed(uploaded before adding the child nodes, just pretend they are in there). I've provided the link to the files I wrote as well as the whole rest of the mod, if you or anyone else gets a chance to look at it. Am I just using the parameter wrong or is that not fully implemented yet? As always thanks in advance. Link: http://s000.tinyupload.com/index.php?file_id=03636414289440759411

The PartTest parameter is just a thin wrapper around the stock parameter, so I don't have much visibility into how it works. But from looking at your files, I'm guessing the problem is that you have useStaging = True. Since the surface scanner isn't staged, I think doing it that way may not enable the "Run Test" clickable option, which is what you'll need. I don't have KSP available to me right now, so I can't test it out.

- - - Updated - - -

When setting up a contract, is there a way to determine the player's current prestige and adjust the requirements and rewards based on that? For instance, if you wanted a contract to be available at any prestige level, but wanted to make it harder to complete and have higher rewards if the player has a higher prestige. Or would you have to create different contracts for each prestige level?

Nope, but should be easy enough to create, raised [#325]. It'll run at contract offer time (meaning if a player's prestige reputation changes significantly, the values will be off). Likely it'll return a number in the [-1000, 1000] range if I remember correctly how it works in game.

Unrelated, I haven't forgotten about your other issue, raised [#324] so I don't lose it.

EDIT: The correct term is reputation. Prestige is the number of stars for the contract.

- - - Updated - - -

I get this error when loading into the game

Any help is appreciated and also, great job on this one, it's mods like these that make everyone's life easier

I'll need to add some improved error handling for that, raised [#326]. I'm assuming this happened after you upgraded? Does it keep happening or is it just a one time thing. From looking at the code, I believe this will just be a one-time thing and shouldn't have a major impact (but let me know if that's inaccurate).

- - - Updated - - -

And as an aside, been suffering from a little bit of KSP burnout for the past few weeks, so I've been a bit slower to respond, and haven't been doing any modding. I'll get a 1.7.6 release out with this fixes soon-ish, and once I get all the Crusader Kings 2 and Europa Universalis 4 out of my system I'll resume work on other more secret KSP-related projects.

Link to comment
Share on other sites

And as an aside, been suffering from a little bit of KSP burnout for the past few weeks, so I've been a bit slower to respond, and haven't been doing any modding. I'll get a 1.7.6 release out with this fixes soon-ish, and once I get all the Crusader Kings 2 and Europa Universalis 4 out of my system I'll resume work on other more secret KSP-related projects.

Haha, good luck with that, I dont know about EUIV but CK2 is just phenomonal time sink.

And as for the error code, i did not dare leaving the mod on as i was scared by the error notification although I had a feeling that it might be like you said, one time thing. But if you think it probably wont affect the gameplay i'll plug it back in and have a go with it. I'll hold you resposible if something goes awry..not.

Anyway, no matter if you are grown tired of the game, you've done amazing stuff for this game by making this mod. Have fun with CK2 and hope to see you back again :)

Link to comment
Share on other sites

Alrighty, new release time (release #100, according to GitHub!). Just a few minor bug fixes for this one. Download now!

Contract Configurator 1.7.6

  • Added Reputation function to get the player's current reputation.
  • Fixed issue with Duration parameter possibly resetting state incorrectly when switching scenes/vessels (thanks chrisl).
  • Minor cleanup of science experiment definitions.
  • Improved error handling for rare contract pre-loader load exceptions (thanks Laffe).

Link to comment
Share on other sites

I noticed that CosmoBros base construction pack was failing validation, and went to fix it to him. I found this:


notes = Put a new outpost on any planet(Orbited) surface.

It looks like CC thinks that he is using an expression? Obviously not what he meant from context. Not sure if you could add something to support it? I'm going to make a change to the wording in the meantime.

Also:


title = @/targetVessel1 Crew Ship

Not sure what CC's problem is with that one? It looks ok to me (bad english aside, but you can't blame him for that one, he is German I believe). My log is going "invalid identifier, Crew" I cleaned it up anyway, but I can't see why that would fail.

I may have more... I fixed one batch of problems, and a whole load more cropped up.

Edited by severedsolo
Link to comment
Share on other sites

I noticed that CosmoBros base construction pack was failing validation, and went to fix it to him. I found this:


notes = Put a new outpost on any planet(Orbited) surface.

It looks like CC thinks that he is using an expression? Obviously not what he meant from context. Not sure if you could add something to support it? I'm going to make a change to the wording in the meantime.

That should be doable. Raised [#327].

Also:


title = @/targetVessel1 Crew Ship

Not sure what CC's problem is with that one? It looks ok to me (bad english aside, but you can't blame him for that one, he is German I believe). My log is going "invalid identifier, Crew" I cleaned it up anyway, but I can't see why that would fail.

I may have more... I fixed one batch of problems, and a whole load more cropped up.

There was a reason for having something that starts with an @ treated special for strings, but I can't remember what it is (it might've been a backwards compatibility thing). The workaround if that was the string you wanted to use is to double quote it:

title = "@/targetVessel1 Crew Ship"

Link to comment
Share on other sites

If you haven't seen them, how do you know they've been withdrawn? :)

I have sneaky save file viewing powers.

This is something that is part stock, and part up to the contract author. There are optional fields to specify a minimum and maximum expiry period, and any contract generated gets an expiry within that range (unless they aren't specified, and then it should have no expiry). This expiry is the amount of time the contract will stick around before being withdrawn.

This definitely isn't the issue; the minimum expiry specified is at least one day for all the contracts I'm concerned with.

Now, the thing to keep in mind, is that the contracts are pretty random. So as long as their requirements are met, the contract (or a very similar one will get offered again). Easiest thing to do if you're looking for something specific is to just cancel the ones you don't like until the "right" one comes up.

That's precisely what I've been doing, up to a point though, as most of the contracts currently on offer are contracts I want to do at some point. This issue really relates specifically to whitecat's historic missions pack; I'm seemingly not being offered contracts at the correct point, and on viewing my save file it looks like they've been 'withdrawn' before ever being offered. I've found that If I manually remove the contract's entry from my save file it forces the game to offer it again, although this is still somewhat hit and miss.

Much appreciation for the reply!

Link to comment
Share on other sites

I have sneaky save file viewing powers.

This definitely isn't the issue; the minimum expiry specified is at least one day for all the contracts I'm concerned with.

That's precisely what I've been doing, up to a point though, as most of the contracts currently on offer are contracts I want to do at some point. This issue really relates specifically to whitecat's historic missions pack; I'm seemingly not being offered contracts at the correct point, and on viewing my save file it looks like they've been 'withdrawn' before ever being offered. I've found that If I manually remove the contract's entry from my save file it forces the game to offer it again, although this is still somewhat hit and miss.

Much appreciation for the reply!

Ah, that's a different story then. What you're seeing is the way that Contract Configurator's pre-loader works. It'll pre-load contracts and set their state internally to Withdrawn. It does this so that when the system requests a new contract there isn't a stutter (as it will already have one generated and ready to go). So if you're seeing those in the save, that means it's next to come up.

With one exception though - contracts are tied to specific prestige levels. So if you don't have room for a 3-star contract (because your reputation is too low, or it's fill with the uncancellable "Explore X" contracts), then you won't see those contracts until something changes.

Link to comment
Share on other sites

Thanks for the tip, I realized I had that set wrong just after uploading and corrected it. Since I'm still having trouble with it, I decided to test the parameter on a stock engine(before and after editing activatethroughstage via module manager) and the landing gear but still the menu to test them won't show up, I even tried setting activateonevent to false to see if that would help, but no change. I'd really like to get this to work, otherwise I'll have to rewrite and restructure five of the contracts I've written so far, if not just scrap them altogether, so I really appreciate the replies.

Link to updated contract and a screenshot for examples of what I'm talking about: http://s000.tinyupload.com/index.php?file_id=09708793771682744399

Edited by Sticky32
Link to comment
Share on other sites

That should be doable. Raised [#327].

There was a reason for having something that starts with an @ treated special for strings, but I can't remember what it is (it might've been a backwards compatibility thing). The workaround if that was the string you wanted to use is to double quote it:

title = "@/targetVessel1 Crew Ship"

I used parentheses for the @/targetbody command in my contract titles instead of double quotes and it worked just fine as well, though they do show up in the name.

This is in reply to severedsolo.

Edited by Sticky32
Link to comment
Share on other sites

Thanks for the tip, I realized I had that set wrong just after uploading and corrected it. Since I'm still having trouble with it, I decided to test the parameter on a stock engine(before and after editing activatethroughstage via module manager) and the landing gear but still the menu to test them won't show up, I even tried setting activateonevent to false to see if that would help, but no change. I'd really like to get this to work, otherwise I'll have to rewrite and restructure five of the contracts I've written so far, if not just scrap them altogether, so I really appreciate the replies.

Link to updated contract and a screenshot for examples of what I'm talking about: http://s000.tinyupload.com/index.php?file_id=09708793771682744399

Found the problem. It relies on the contract being the stock PartTest contract to actually enable the "Run Test" option on the part. So I'll have to do something to automatically turn it on/off to work around that limitation. Raised [#328].

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