DMagic

[1.2.x] Contracts Window + [v7.3] [12/14/2016]

265 posts in this topic

One Request: Can it have the option to show the name of the contracting entity, possibly its flag, too? Sometimes, I want to have the mission flag match the flag of whichever organization is footing the bill for it, and in the stock game, I have to go back to Mission Control to get that information.

Share this post


Link to post
Share on other sites

A few updates on this.

I've made a very rough mockup of a new contract configuration window, something that would allow you to tweak the reward/penalty amounts as well as a few other options for each contract type. In principle this is fairly simple. Just watch for new contracts and adjust their values as needed. I haven't implemented any of that, and I would need to take into account strategies, but this should work fairly simply. Any changes to the rewards etc... for any contract would take place after other types of configs (ie FinePrint's config file, which adjusts values while the contract is being generated, not after), but there is no reason why any mod Contract type and/or Parameter type shouldn't be adjustable.

This is a mockup of the config window, the new button on the main window is used to open it. All of the contract/parameter rewards/penalties are adjusted with some kind of mutant log-scale slider. From 0-100% is linear, from 101-1000% is log scale, to push the less useful, really high amounts together toward the right side. This allows for easy adjustment of all these values. Along the bottom are sliders to set the max amount of contracts offered for a given type (contracts offered after reaching this amount would just be deleted before you ever see them, hopefully), and to adjust the max amount of active contracts of that type and its duration once accepted (obviously some special cases will be needed for the contracts that don't expire).

kd8sjgL.jpg

Each contract and parameter type can be selected through two scrollable drop-down menus.

u6VOx1V.jpg

Obviously many improvements need to be made to the UI and to make the options clearer. But this should provide a nice, graphical interface to adjust all contract and parameter types, stock and addon. These will also be save-game specific, so you can make separate configurations for each game (and I might make a global config file, so that you can adjust the baseline settings for everything, rather than resetting them for every new save file).

Nothing has really been implemented yet, so this probably won't be coming until after 0.90.

I have also been thinking about adding some kind of indicator for the contracting agency as has been requested several times. I'm thinking that some kind of pop-up window, similar to the part preview window in the editor, could be used to display the agency and flag for each contract without needing to stuff all of that info into the main window somewhere.

Share this post


Link to post
Share on other sites

Someone confirm this works in 0.90, the tiny contract list thing keeps resetting whenever my ship releases controls for 10 seconds (due to one mission's parameters) and amongst other things it's annoying...

(DMagic a sooo much stuff to work on, i can almost say the same of his other mods! I want them all! He's spoiling us ;) )

Share this post


Link to post
Share on other sites

Small amount of testing I have done seems to be working but that is far from conclusive.

Share this post


Link to post
Share on other sites

This is a mockup of the config window, the new button on the main window is used to open it. All of the contract/parameter rewards/penalties are adjusted with some kind of mutant log-scale slider. From 0-100% is linear, from 101-1000% is log scale, to push the less useful, really high amounts together toward the right side. This allows for easy adjustment of all these values. Along the bottom are sliders to set the max amount of contracts offered for a given type (contracts offered after reaching this amount would just be deleted before you ever see them, hopefully), and to adjust the max amount of active contracts of that type and its duration once accepted (obviously some special cases will be needed for the contracts that don't expire).

It would be helpful for the numbers to be directly editable as well. So that way you don't have to get your mouse click on the slider exactly right.

Share this post


Link to post
Share on other sites

Finally, I have the contract config sliders successfully updating all available contracts and parameters when changed. :confused:

S7MjPLt.gif

There are still a few issues. I can't create value where there is none, so this won't allow for adding science or rep to a parameter that doesn't have any to begin with. There is also the related problem of what happens when a value is zeroed out. Once a value is set to zero there is no longer any simple way to determine what its original value was and therefore no way to change it back to a non-zero value. I think I'll have a toggle button to allow for 0% values and have it set to 1% or 0.1% as the lowest value by default.

I also need to fix the duration setting so that it affects existing contracts and not just newly offered ones.

There is a little 'A' icon in the contract title bar now; it opens a small popup window displaying the agency flag and name. It only needs a little work to make the window position itself correctly.

Then I need to see about fixing the part preview function in the editor and maybe adding stock toolbar support...

Share this post


Link to post
Share on other sites
Then I need to see about fixing the part preview function in the editor and maybe adding stock toolbar support...

If you manage to completely replace stock contracts app, that would be rad!

Share this post


Link to post
Share on other sites

Version 3.0 is released; get it on Kerbal Stuff.

Several updates have been made in this release; see the first post for the complete changelog.

It has been updated for KSP 0.90 to account for the editor scene changes, the part preview function has been disabled for now.

The requested agency preview has been added as a small icon above each contract title. Click it to reveal the agency flag and name, click anywhere else inside the contract window to dismiss this popup.

Strategy effects are shown in the rewards section now. This uses the same technique as the mission control center description, where the base level + strategy amount is shown followed by the strategy amount in parenthesis.

Stock toolbar support has been added. There is a toggle option to switch between Blizzy's toolbar and the stock app launcher. There is also an option to replace the stock contracts app. The stock icon will not change, but it will no longer open up the tiny, useless stock app. It is possible that there may be issues when replacing the stock app, let me know if anyone finds any problems.

The contract configuration window has also been added. Its functionality is mostly as has been described before and more can be seen in the first post. Basically it allows for contract reward and penalty amounts to be adjusted for each contract type, the settings will stored in each save file. Any addon contracts/parameters should be recognized and allow for adjustments (it is possible that the contract/parameter type names might be ambiguous for some of these, this depends on the mod author). There are a handful of stock contract and parameter types that are unused, but still show up here, as someone else may be using them (there is also one broken stock parameter type that has been specifically excluded from the list). A global config file is planned for a later version, but for now every save file will start out with the default values.

Be aware that allowing for 0% values, or toggling the option to adjust active contracts on and off may cause problems. It is best to stick with the 0.1% minimum value and to choose to either adjust active contracts or only adjust newly offered contracts and not change the option.

1 person likes this

Share this post


Link to post
Share on other sites
DMagic,

Thank you for this mod. Its now added to the list of mods I won't play without.

I would like to ask for a feature request. Is there a way to mark a contract with the mission/ship name that has been assigned to fulfill it? It could be as simple as adding a notes field to the contract listing.

For me it would be like the cherry on top! Help me keep track of all the birds in the air.

Thanks!

Probus

This might be useful, but it would be just another thing to cram into an already overcrowded UI.

Share this post


Link to post
Share on other sites

thanks for a great mod :) A request though, is it possible to get some sort of "master slide" with the contract configuration? set science for all cotnracts to 50%, or fund to 150% for all parameters?

Share this post


Link to post
Share on other sites
thanks for a great mod :) A request though, is it possible to get some sort of "master slide" with the contract configuration? set science for all cotnracts to 50%, or fund to 150% for all parameters?

That's what the difficulty settings menu when you first start a game is for.

A global settings config file, something that would allow you to define and save values for each contract/parameter type for all save games is something that is planned, but this not quite the same as just adding another slider to effect every type.

Share this post


Link to post
Share on other sites

Love this mod much easier to use in-flight than standard contracts window. The only problem I have with it I cant leave it open, even when just using it as a contract viewer in basic mode. For some reason it kills my frame rate. Is it just me? I'm using the latest update and it is as bad as the last.

Share this post


Link to post
Share on other sites

Would it be possible to have a filter that shows contracts able to be fulfilled with the current craft (based on parts/modules)?

Share this post


Link to post
Share on other sites

Hey DMagic, I've got a couple bugs/requests for you. Head over to this post in the Contract Configurator thread for the background.

  1. When a parameter has no title (I assume the check is for null/empty), the stock contracts app does not display that parameter OR any of its child parameters. I rely on this behaviour to secret away and hide a parameter that needs to be there to display the orbits, but may not be desirable as an actual contract parameter. Would it be possible to do the same logic in Contracts Window + to be consistent with stock?
  2. In the stock app, when a parameter with child parameters is completed, it stops displaying the child parameters. To be honest the behaviour is annoying, but since I have to assume users are potentially using the stock app, I have many cases where I change the parameter title to show some details from the children when it's complete (so the user can still see it). This results in it getting displayed twice in Contracts Window +. So again - could Contracts Window + be changed to behave like stock (not because I like the behaviour, but for consistency).

Thanks!

Share this post


Link to post
Share on other sites

I tried the remove stock contract button option and now I can't access the VAB or SPH (clicking the building does nothing), and if I open any of the other buildings I can't exit out of them. Also the only way I can quit KSP is by using Alt+F4. I've tried unclicking the option, removing the mod, loading a backup from before I installed the mod, but nothing seems to work. If I start a new game everything works fine in it until I click the option, then the save is broken. What I don't understand is how this is affecting backups, surely they should be fine?

These are the logs from when I tried removing the mod and loading a backup from before I installed the mod: output log, ksp log

Share this post


Link to post
Share on other sites
I tried the remove stock contract button option and now I can't access the VAB or SPH (clicking the building does nothing), and if I open any of the other buildings I can't exit out of them. Also the only way I can quit KSP is by using Alt+F4. I've tried unclicking the option, removing the mod, loading a backup from before I installed the mod, but nothing seems to work. If I start a new game everything works fine in it until I click the option, then the save is broken. What I don't understand is how this is affecting backups, surely they should be fine?

These are the logs from when I tried removing the mod and loading a backup from before I installed the mod: output log, ksp log

The logs are saying that the stock contract system is having some error while saving, which prevents the scene from changing:


NullReferenceException: Object reference not set to an instance of an object
at Contracts.Contract.Save (.ConfigNode node) [0x00000] in <filename unknown>:0
at Contracts.ContractSystem.OnSave (.ConfigNode gameNode) [0x00000] in <filename unknown>:0
at ScenarioModule.Save (.ConfigNode node) [0x00000] in <filename unknown>:0
at ProtoScenarioModule..ctor (.ScenarioModule module) [0x00000] in <filename unknown>:0
at ScenarioRunner.GetUpdatedProtoModules () [0x00000] in <filename unknown>:0
at Game.Updated () [0x00000] in <filename unknown>:0
at GamePersistence.SaveGame (System.String saveFileName, System.String saveFolder, SaveMode saveMode) [0x00000] in <filename unknown>:0
at VehicleAssemblyBuilding.OnClicked () [0x00000] in <filename unknown>:0
at SpaceCenterBuilding.EnterBuilding () [0x00000] in <filename unknown>:0
at SpaceCenterBuilding.OnLeftClick () [0x00000] in <filename unknown>:0
at SpaceCenterBuilding+

I have no idea how the stock contract app button could cause this effect. And I'm not sure how your backup system works (it looks like there is some kind of automated backup), but I'm guessing that something in save file is being altered. If the Contracts Window + .dll isn't present then it can't be directly causing this, but obviously something is happening.

Can you post your save file, the backup and one with Contracts Window + installed?

Share this post


Link to post
Share on other sites
The logs are saying that the stock contract system is having some error while saving, which prevents the scene from changing:


NullReferenceException: Object reference not set to an instance of an object
at Contracts.Contract.Save (.ConfigNode node) [0x00000] in <filename unknown>:0
at Contracts.ContractSystem.OnSave (.ConfigNode gameNode) [0x00000] in <filename unknown>:0
at ScenarioModule.Save (.ConfigNode node) [0x00000] in <filename unknown>:0
at ProtoScenarioModule..ctor (.ScenarioModule module) [0x00000] in <filename unknown>:0
at ScenarioRunner.GetUpdatedProtoModules () [0x00000] in <filename unknown>:0
at Game.Updated () [0x00000] in <filename unknown>:0
at GamePersistence.SaveGame (System.String saveFileName, System.String saveFolder, SaveMode saveMode) [0x00000] in <filename unknown>:0
at VehicleAssemblyBuilding.OnClicked () [0x00000] in <filename unknown>:0
at SpaceCenterBuilding.EnterBuilding () [0x00000] in <filename unknown>:0
at SpaceCenterBuilding.OnLeftClick () [0x00000] in <filename unknown>:0
at SpaceCenterBuilding+

I have no idea how the stock contract app button could cause this effect. And I'm not sure how your backup system works (it looks like there is some kind of automated backup), but I'm guessing that something in save file is being altered. If the Contracts Window + .dll isn't present then it can't be directly causing this, but obviously something is happening.

Can you post your save file, the backup and one with Contracts Window + installed?

I'm using the S.A.V.E. mod to do backups, I've got it set to backup everytime KSP saves and every 10 mins I think, and it seems to work by copying the contents of the current save folder to a timestamped folder in another directory.

Here's the backup save you wanted and here's a save with Contract Window + installed, unfortunately the save with Contract Window + installed is not the same game as the backup because as soon as I click the remove stock contract button, KSP wont save at all.

Share this post


Link to post
Share on other sites
I'm using the S.A.V.E. mod to do backups, I've got it set to backup everytime KSP saves and every 10 mins I think, and it seems to work by copying the contents of the current save folder to a timestamped folder in another directory.

Here's the backup save you wanted and here's a save with Contract Window + installed, unfortunately the save with Contract Window + installed is not the same game as the backup because as soon as I click the remove stock contract button, KSP wont save at all.

Well, I've discovered two bugs, but neither produces the errors you are seeing.

It seems that the replace stock contract app function is indeed broken (a last minute change thoroughly screwed that up...), and the strategy rewards were mixing up rep and science values.

Both are simple fixes and I'll release an update soon.

I can't, however, replicate the error log you are seeing just by activating the replace stock contract app button. I did see those errors while trying out your save file, but that was because some of your contracts use agents that I don't have. Squads agency code is very fragile, and if a contract is assigned to an agent that doesn't exist, or that did exist but was deleted, it will completely destroy your save file.

I made a short tutorial on how to handle this type of thing in my [thread=64972]Orbital Science thread[/thread] (scroll down a bit to the FAQ section and expand the spoiler tag about removing DMagic Orbital Science), but I don't see how this would be the issue on your end. According to your log files those agents should be present and loaded correctly.

Your save files break like this only after selecting the replace stock contract app button? I can't explain how that would happen, but I would love to know if anyone else is running into this same problem.

- - - Updated - - -

Version 3.1 is up on Kerbal Stuff.

It fixes bugs with replacing the stock contract toolbar button and correctly displays the science and reputation strategy modifiers.

Share this post


Link to post
Share on other sites

Your save files break like this only after selecting the replace stock contract app button? I can't explain how that would happen, but I would love to know if anyone else is running into this same problem.

Hmmm, very strange, I guess it could be another mod interacting weirdly with yours, I'll have a look see if I can see anything, and I'll try out the update and see what happens.

Thanks for your help.

- - - Updated - - -

Just tried the update with a new save file and it works perfectly, though I think I'll stick with not using the stock replacement option because the window disappears if you select one of the other stock windows (like the resource bars or the message bar)

Share this post


Link to post
Share on other sites

add an actual number of reputation to the reputation bar (when hover over or a replacement of a bar)

Share this post


Link to post
Share on other sites

I have also one feature request: filter contracts by actual planet/moon. I have 3 temperature scans on Mun and 3 on Minmus and I need to to figure out the height for the scan. Filtering by moon would help me in this situation a lot.

Edit: Alternatively it would be nice to see contract for a waypoint. (I.e., selecting/clicking a waypoint would show contract that it belongs to)

Edited by ebik

Share this post


Link to post
Share on other sites

Heya,

First off, great mod! It's great to be able to see the additional information about a contract from anywhere.

I've got a minor issue though - if I have the Contracts+ window open in the VAB or SPH, my framerate and the editor slows to a crawl. Other mods which open windows don't have this issue for me.

Debian x64, KSP 0.90 x64, Contracts Window + 3.1, various other mods. Nothing of interest in the log files.

EDIT: Some additional testing:

- I saw this issue in other scenes as well

- brand new install with CW+ as the only mod does NOT show the issue (or it's so slight as to be unnoticeable)

- after a restart (computer + KSP), the issue is not noticeable in my fully modded install either.

So for now, don't worry about it until I can repro. Sorry about wasting time.

Edited by micha

Share this post


Link to post
Share on other sites

Version 3.2 is out; get it on Kerbal Stuff

There are a few fixes for the stock app launcher button. The button now works as a toggle instead of an on/off switch, this prevents you from having to press twice when loading a new scene with the contracts window open (the on/off highlight state of the app launcher button might not match the open/closed state of the window...).

When replacing the stock contracts app launcher button other windows should no longer close the contracts window. You might have to switch scenes once after replacing the stock app once for this to take effect.

This update also prevents nameless contract parameters from being displayed and and prevents the child parameters of completed parent parameters from being displayed; these are mostly used for Contract Configurator contracts.

Share this post


Link to post
Share on other sites

Hello, I think this will be really huge if through your interface, we can have the possibility to decline or accept new contracts :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now