Jump to content

[1.8.x] Contracts Window + [v9.4] [11/1/2019]


DMagic

Recommended Posts

Version 5.0 is out, get it on Kerbal Stuff.

Everything seems to be working in KSP 1.0.

I also fixed some issues where contracts with the same name would change positions, and I made the contract reward values display in a much more efficient manner.

Link to comment
Share on other sites

Aww yis! Running stock I immedietly ran into a deep longing for this mod. Can't live without it :D

Yeah, I figured this would be the best one to get updated first.

It also updates with new contracts added while in flight, so those automatically accepted achievement contracts show up (and the old ones can be deleted) as soon you finish the last one.

Link to comment
Share on other sites

I've only just discovered this mod (very helpful btw!), but for me the "Mission Lists" are not persistent. I assume this isn't intentional?

I can add missions to lists as I desire, but every scene change resets all lists to be empty (though the lists themselves persist). So if I add the missions I want to do to a list in the VAB or SPH, I have to re-add them once I actually launch. If I have to abort/revert to change the craft, I have to add them again.

I'm on version 5.0 (installed via CKAN), obviously with KSP 1.0.

Edit: one thing I wanted to add is that I find it somewhat confusing that the icons associated with a contract are shown ABOVE the title. Especially since clicking the title collapses the contract, I'd like to also hide those displays. Could there maybe be a switch in the options, that moves them below?

Edited by Creat
Link to comment
Share on other sites

This might well be an error: see lines 124 - 146 in module contractContainers.cs


[COLOR=#569CD6][FONT=Consolas]private[/FONT][/COLOR][COLOR=#DCDCDC][FONT=Consolas] [/FONT][/COLOR][COLOR=#569CD6][FONT=Consolas]void[/FONT][/COLOR][COLOR=#DCDCDC][FONT=Consolas] [/FONT][/COLOR][COLOR=#00FFFF][FONT=Consolas]contractPenalties[/FONT][/COLOR][COLOR=#DCDCDC][FONT=Consolas]([/FONT][/COLOR][COLOR=#ADD8E6][FONT=Consolas]Contract[/FONT][/COLOR][COLOR=#DCDCDC][FONT=Consolas] c)[/FONT][/COLOR] {
[COLOR=lightblue]CurrencyModifierQuery[/COLOR] currencyQuery [COLOR=#b4b4b4]=[/COLOR] [COLOR=lightblue]CurrencyModifierQuery[/COLOR][COLOR=#b4b4b4].[/COLOR][COLOR=cyan]RunQuery[/COLOR]([COLOR=lightblue]TransactionReasons[/COLOR][COLOR=#b4b4b4].[/COLOR][COLOR=violet][B]ContractPenalty[/B][/COLOR], ([COLOR=#569cd6]float[/COLOR])c[COLOR=#b4b4b4].[/COLOR][COLOR=violet]FundsFailure[/COLOR], [COLOR=#b5cea8]0f[/COLOR], c[COLOR=#b4b4b4].[/COLOR][COLOR=violet]ReputationFailure[/COLOR]);

[COLOR=violet]fundsPenString[/COLOR] [COLOR=#b4b4b4]=[/COLOR] [COLOR=#d69d85]""[/COLOR];
[COLOR=#569cd6]if[/COLOR] (c[COLOR=#b4b4b4].[/COLOR][COLOR=violet]FundsFailure[/COLOR] [COLOR=#b4b4b4]!=[/COLOR] [COLOR=#b5cea8]0[/COLOR]); // <---- Next line is now unconditional!!! is this intended?
[COLOR=violet]fundsPenString[/COLOR] [COLOR=#b4b4b4]=[/COLOR] [COLOR=#d69d85]"- "[/COLOR] [COLOR=#b4b4b4]+[/COLOR] c[COLOR=#b4b4b4].[/COLOR][COLOR=violet]FundsFailure[/COLOR][COLOR=#b4b4b4].[/COLOR][COLOR=cyan]ToString[/COLOR]([COLOR=#d69d85]"N0"[/COLOR]);
[COLOR=#569cd6]float[/COLOR] fundsPenStrat [COLOR=#b4b4b4]=[/COLOR] currencyQuery[COLOR=#b4b4b4].[/COLOR][COLOR=cyan]GetEffectDelta[/COLOR]([COLOR=lightblue]Currency[/COLOR][COLOR=#b4b4b4].[/COLOR][COLOR=violet][B]Funds[/B][/COLOR]);
[COLOR=#569cd6]if[/COLOR] (fundsPenStrat [COLOR=#b4b4b4]!=[/COLOR] [COLOR=#b5cea8]0f[/COLOR])
{
[COLOR=violet]fundsPenString[/COLOR] [COLOR=#b4b4b4]=[/COLOR] [COLOR=#569cd6]string[/COLOR][COLOR=#b4b4b4].[/COLOR][COLOR=cyan]Format[/COLOR]([COLOR=#d69d85]"- [/COLOR][COLOR=#80ff80]{0:N0}[/COLOR][COLOR=#d69d85] ([/COLOR][COLOR=#80ff80]{1:N0}[/COLOR][COLOR=#d69d85])"[/COLOR], c[COLOR=#b4b4b4].[/COLOR][COLOR=violet]FundsFailure[/COLOR] [COLOR=#b4b4b4]+[/COLOR] fundsPenStrat, fundsPenStrat);
}

[COLOR=violet]repPenString[/COLOR] [COLOR=#b4b4b4]=[/COLOR] [COLOR=#d69d85]""[/COLOR];
[COLOR=#569cd6]if[/COLOR] (c[COLOR=#b4b4b4].[/COLOR][COLOR=violet]ReputationFailure[/COLOR] [COLOR=#b4b4b4]!=[/COLOR] [COLOR=#b5cea8]0[/COLOR])
[COLOR=violet]repPenString[/COLOR] [COLOR=#b4b4b4]=[/COLOR] [COLOR=#d69d85]"- "[/COLOR] [COLOR=#b4b4b4]+[/COLOR] c[COLOR=#b4b4b4].[/COLOR][COLOR=violet]ReputationFailure[/COLOR][COLOR=#b4b4b4].[/COLOR][COLOR=cyan]ToString[/COLOR]([COLOR=#d69d85]"N0"[/COLOR]);
[COLOR=#569cd6]float[/COLOR] repPenStrat [COLOR=#b4b4b4]=[/COLOR] currencyQuery[COLOR=#b4b4b4].[/COLOR][COLOR=cyan]GetEffectDelta[/COLOR]([COLOR=lightblue]Currency[/COLOR][COLOR=#b4b4b4].[/COLOR][COLOR=violet][B]Reputation[/B][/COLOR]);
[COLOR=#569cd6]if[/COLOR] (repPenStrat [COLOR=#b4b4b4]!=[/COLOR] [COLOR=#b5cea8]0f[/COLOR])
{
[COLOR=violet]repPenString[/COLOR] [COLOR=#b4b4b4]=[/COLOR] [COLOR=#569cd6]string[/COLOR][COLOR=#b4b4b4].[/COLOR][COLOR=cyan]Format[/COLOR]([COLOR=#d69d85]"- [/COLOR][COLOR=#80ff80]{0:N0}[/COLOR][COLOR=#d69d85] ([/COLOR][COLOR=#80ff80]{1:N0}[/COLOR][COLOR=#d69d85])"[/COLOR], c[COLOR=#b4b4b4].[/COLOR][COLOR=violet]ReputationFailure[/COLOR] [COLOR=#b4b4b4]+[/COLOR] repPenStrat, repPenStrat);
}
}
[COLOR=#DCDCDC][FONT=Consolas][/FONT][/COLOR]

Link to comment
Share on other sites

This great mod seems to work fine with KSP 1.0. The only glitch I've found is the replacement of stocks button: it works but it doesn't stick, when I restart the game, the replacement is cancelled again.

Oh yeah, I forgot about testing that. To be honest, the whole stock-toolbar-replacement thing is sort of a disaster (not to mention how the stock toolbar itself is less than ideal...) and I might just get rid of the option.

I've only just discovered this mod (very helpful btw!), but for me the "Mission Lists" are not persistent. I assume this isn't intentional?

I can add missions to lists as I desire, but every scene change resets all lists to be empty (though the lists themselves persist). So if I add the missions I want to do to a list in the VAB or SPH, I have to re-add them once I actually launch. If I have to abort/revert to change the craft, I have to add them again.

Does this happen all of the time, or just when going from the editor, to launch, then reverting?

The only issues I've seen with loading are when you have some of those initial "achievement" contracts in your list. It doesn't seem to like those and it reverts to its fallback loading method, this causes a one or two second delay in loading, but should still load mission lists correctly.

Edited by DMagic
Link to comment
Share on other sites

Oh yeah, I forgot about testing that. To be honest, the whole stock-toolbar-replacement thing is sort of a disaster (not to mention how the stock toolbar itself is less than ideal...) and I might just get rid of the option.

As I noticed you use some of TriggerAu's code in this, you should see what he's done with Alternate Resource Panel when it comes to swapping the stock toolbar. I've used ARP in that manner since he released it without issue; there may be a trick or two in there if you haven't investigated it already.

Link to comment
Share on other sites

Does this happen all of the time, or just when going from the editor, to launch, then reverting?

The only issues I've seen with loading are when you have some of those initial "achievement" contracts in your list. It doesn't seem to like those and it reverts to its fallback loading method, this causes a one or two second delay in loading, but should still load mission lists correctly.

The specific ones I wanted in a mission were two surveys I wanted to do together (so not the achievement-style auto-added contracts from the beginning). I added them in the SPH, clicked launch, and they were already un-assigned again. Later the same with the VAB. Then I'd assign them (just before launch, but on the pad/runway), fly/test some things and (eventually) I might revert, and they'd be gone from the category once again. I added them often, and they were gone on basically every scene change.

For some reason, it hasn't happened in a while though. Maybe those contracts were just 'special' somehow? At the moment the issue seems resolved for me (at least everything I've stuck somewhere actually stayed there).

As a second (slightly more worrying consideration) I also had some issues with contracts disappearing completely (specifically the 2500 m/s achievement-style contract). Since this is the only mod I've got that handles contracts, it may or may not have anything to do with that. I've made a thread about it here, but haven't gotten any replies yet (and I suspect I won't). Really, no idea how that could happen and I really don't think it's this mod, but I thought I might just as well mention it just the same.

Link to comment
Share on other sites

I'll look into this more when I get the time. I need to figure out what's going on with achievement contracts anyway.

I've seen exactly the same thing with the 2500m/s contract. I didn't go fast enough to complete it, but it disappeared after changing scenes. I'm wondering if it's something about that contract in particular, or something about all of the achievement contracts. I can't think of any reason why Contracts Window + would cause this, but I'll look into it.

Link to comment
Share on other sites

I've looked into the achievement contracts a bit for Contract Configurator, here's what I've found out:

  1. There's a new boolean field on the Contract type call AutoAccept.
  2. If AutoAccept is true, when the contract is offered, it will immediately be accepted (note that it will still fire the OnOffered event) before it transitions to accepted.

The above can lead to odd situations if you have lots of contracts that are available at the start of the game (like my unit tests for Contract Configurator) - if the record contract doesn't get offered in the first go 'round, it won't make it to the accepted list.

Anyway, playing around with it, I didn't see anything that would explain the behaviour of the contracts not completing (I assume that has nothing to do with the auto-accept nature). I'm fairly certain that it kicks off based on the various ProgressTracking events, which would either be OnProgressAchieved, OnProgressReached or OnProgressComplete. There would *have* to be discrete steps at which those fire, maybe the steps for the contracts and progress tracking are out of sync? That's my best guess....

Link to comment
Share on other sites

As far as I can tell the contracts that have "autoaccept = true" don't seem to count toward your max. active contracts counts. So that's a plus.

More relevantly though, I know that contract was accepted for me as I has it in my active contract list (see screenshot in my other thread), so that part had worked. I assume something went wrong with the completion trigger somehow, since the quicksave and (later) reload just caused it to vanish. I'd presume it was in some sort of intermediate state, not that I have any idea what specifically might have caused it or what made it "intermediate". I'd assume that when writing the quicksave, it didn't pass some sanity tests or something and the entry was possibly just discarded? Very likely this is something Squad themselves have to look into.

Link to comment
Share on other sites

Version 5.1 is out; get it on Kerbal Stuff.

It has been updated for KSP 1.0.2.

A few bugs were fixed; active progress node contracts should no longer cause a delay in loading, a problem with the contract penalty display has been fixed, and the stock contract app replacement function has been fixed.

I also added the ability to partially drag the window off screen.

Link to comment
Share on other sites

You can use the pin option (upper right in the window). It will move the contract to the top, or under anything that is already pinned.

Edit (oops): Well the pin option is above each contract.

Edited by DudewHorns
Link to comment
Share on other sites

This probably isn't related to this mod at all, but it is related to one of your releases. I don't have any contract packs made by you, so I am unsure where it comes from. The issue is with a contract wanting tests done in low or high kerbin orbit. I tried doing the two LKO ones twice on polar orbits (on my scanning sat) below 200km. They did not complete. Since 70km - 200km is generally considered to be LKO, I assume there is a specific orbital altitude you are asking for. I cannot for the life of me understand why people are making contracts with vague parameters. It is really frustrating... Why not just say, "...from an orbit of 150km above Kerbin"?

To relate the issue to this mod, is it possible to have contracts window + or an extension pull the exact objectives for easy access? This would make this mod a must have since there are so many contracts with vague parameters.

screenshot0.jpg

Link to comment
Share on other sites

This probably isn't related to this mod at all, but it is related to one of your releases. I don't have any contract packs made by you, so I am unsure where it comes from. The issue is with a contract wanting tests done in low or high kerbin orbit. I tried doing the two LKO ones twice on polar orbits (on my scanning sat) below 200km. They did not complete. Since 70km - 200km is generally considered to be LKO, I assume there is a specific orbital altitude you are asking for. I cannot for the life of me understand why people are making contracts with vague parameters. It is really frustrating... Why not just say, "...from an orbit of 150km above Kerbin"?

Just to clarify, you did recover these experiments after conducting them, right? The contract does say, "Science experiments with little to no transmission value may need to be returned to Kerbin to complete each parameter."

Also, this particular contract would have come from the DMagic Orbital Science addon, the one that adds extra scientific experiments. If you did recover the experiments and it didn't complete the contract, you will need to let DMagic know about it, as he would be able to help you out.

Edited by Drake1500
Link to comment
Share on other sites

Just wondering is there anyway to lock or pin the location of the window after replacing the stock contract button? Its position is reset every time you launch a vessel.

The window position and size is persistent. Different locations are stored for different scenes however (space center, tracking station, editor, and flight). Replacing the stock contract button shouldn't affect that, but given how buggy this option is I wouldn't discount it.

Bah, no, I did not return them. They were attached to scanning sats. However, my point remains valid. Vague mission parameters are a pain.

The contract note that Drake1500 referred to could be clearer, but there is also a description in the mission synopsis, which appears when you accept the contract.

If you want to know where the experiments transition from low to high orbit (or flight) there is a listing of the altitudes on the wiki somewhere. But generally the experiment results give a clear indication of this in their title (report in space near Kerbin vs. report from in space high over Kerbin).

Link to comment
Share on other sites

I lost all of my active and archived contracts, I think it happened after either a quickload in space, switching a vessel from a long distance, a kerbal from a rescue contract being killed by USI-LifeSupport or maybe ShipManifest trouble.

Can you see anything in the log that might narrow it down?

https://www.dropbox.com/sh/3sth7matznes7tv/AACb9Hngcennw12ZuBGNexG2a?dl=0

Link to comment
Share on other sites

I lost all of my active and archived contracts, I think it happened after either a quickload in space, switching a vessel from a long distance, a kerbal from a rescue contract being killed by USI-LifeSupport or maybe ShipManifest trouble.

Can you see anything in the log that might narrow it down?

https://www.dropbox.com/sh/3sth7matznes7tv/AACb9Hngcennw12ZuBGNexG2a?dl=0

You've posted this in a couple mod threads without knowing if that is the mod causing the issue. There is a forum Support (Modded Installs) precisely for this. Instead you have maybe pasted it once in the correct thread but definitely multiple times in threads it has nothing to do with.

Edited by futrtrubl
Link to comment
Share on other sites

You've posted this in a couple mod threads without knowing if that is the mod causing the issue. There is a forum Support (Modded Installs) precisely for this. Instead you have maybe pasted it once in the correct thread but definitely multiple times in threads it has nothing to do with.

I posted it where I had a suspicion it could be coming from. If I had posted this randomly in every mod I use ...

Link to comment
Share on other sites

  • 3 weeks later...

Is there any way to rename missions/contract lists after you've created them? I can't see any way to currently do this, aside from deleting a mission, creating a new one with the name you want, and then adding all the contracts to the new mission.

I like to group contracts together based on which launch(es) will be fulfilling them, but sometimes I don't have a good descriptive name when I start grouping them, or the mission changes.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

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