Sign in to follow this  
rreeggkk

Rejector - v1.2.0

Recommended Posts

A simple plugin for Kerbal Space Program that will automatically reject contracts as they are created. It has a basic interface for editing the contracts that will be rejected. All rejection filters are per save.

If you have any suggestions or bugs feel free to leave them on the github page. Feel free to send pull requests if you want to help contribute.

Kerbal Stuff

Github Link

A brief overview:

This mod will allow you to filter out contracts that do not meet your requirements. Hate Part testing contracts? or base contracts? want contracts that pay more than they are worth? This mod will automatically reject contracts that you tell it to.

License:

This plugin is licensed under the MIT license. View the full license here.

Changelog:

Spoiler

Version 1.2.0:

Updated for KSP 1.0.5

Version 1.1.2:

Fixed Persistence Issue

Version 1.1.0

Rewrote majority of gui code (only suggestions remains)

Recompiled for 1.0.3

All windows (except for suggestions) will appear in the mission control screen

(Wow this fit really well after 1.0.9...)

Version 1.0.9

Hopefully fixed a bug causing the config not to save or load sometimes

Version 1.0.8

Added a settings window

Moved main mod enable/disable to settings window

Added suggestions enable/disable button

Added slider for rejection interval

Fixed issue with duplicate suggestions windows

Version 1.0.7

Fixed an error which caused the plugin not to work

Fixed the code so now it works the way KSP thinks it should work

Version 1.0.6

Recompiled for KSP 1.0

Version 1.0.5

Switched the declining/accepting of contracts to a 5 seconds timer. Contracts will now only be declined/accepted every 5 seconds. Added a window for suggested filters when you manually decline a contract.

Version 1.0.4

Added an option for auto-accepting.

Bug fixes related to the guis.

Version 1.0.3:

Added a filter for text. Allows for filtering by planet.

Changed filter saving method. Will require re-doing filters (sorry).

Version 1.0.2:

Added License file to download.

Version 1.0.1:

Fixed the GameData folder in download.

Version 1.0.0:

Original Upload

 

Pictures

 

Javascript is disabled. View full album
Edited by rreeggkk
update due to forum update

Share this post


Link to post
Share on other sites

Welcome to the forums, rreegkk!

I've temporarily removed the link to your download. Per the Add-on Posting Rules, you need to include a copy of the license in the download.

On topic, this is an interesting take on the objection so many players have to various contracts.

Share this post


Link to post
Share on other sites
Welcome to the forums, rreegkk!

I've temporarily removed the link to your download. Per the Add-on Posting Rules, you need to include a copy of the license in the download.

On topic, this is an interesting take on the objection so many players have to various contracts.

Actually yea - I'm looking forward to this when its released :D

Share this post


Link to post
Share on other sites

Hello, Nice work, I'm working on the same feature lol ;) but not released yet :P

Edited by Malah

Share this post


Link to post
Share on other sites

Great concept! Didn't work for me when I tried it though -- the main window went wonky in the Space Center scene for me.

Could you add a feature to reject as a function of target as well? I don't like all of the Kerbin contracts, so it would be nice to auto-reject them.

Share this post


Link to post
Share on other sites
Great concept! Didn't work for me when I tried it though -- the main window went wonky in the Space Center scene for me.

Could you add a feature to reject as a function of target as well? I don't like all of the Kerbin contracts, so it would be nice to auto-reject them.

Can you send me some pictures?

Also good idea i'll see what I can do to add that.

Share this post


Link to post
Share on other sites
Is there a default config that disallows testing launch clamps?

And my next question was going to be: can it auto-accept certain contracts, such as testing launch clamps landed at Kerbin?

Share this post


Link to post
Share on other sites
And my next question was going to be: can it auto-accept certain contracts, such as testing launch clamps landed at Kerbin?

Sure I can add in that feature.

I'd second the "reject by target". Getting annoyed by the mass of duna and ike contracts.

In the most recent version I have added in a way to do this by filtering through the text of the contract's title. However, according to KerbalStuff's statistics everyone is downloading the wrong version.

Share this post


Link to post
Share on other sites

Currently I am only able to deny based on contract type. If I try to use auto accept then it makes a rule to deny. The same happens if I try to auto accept 'contains text', jool for example. Auto accepting 'funds over X' works

cGzT4FX.png

FAkYqxx.png

EDIT :

In the most recent version I have added in a way to do this by filtering through the text of the contract's title. However, according to KerbalStuff's statistics everyone is downloading the wrong version.

I downloaded mine through Ckan, is that the right one? I have the option but it does not work to accept, only deny.

Edited by John FX

Share this post


Link to post
Share on other sites

Very cool mod, I'll play with it soon and offer feedback if I can think of any. One question though:

...according to KerbalStuff's statistics everyone is downloading the wrong version.

What is the correct version? The changelog says 1.0.4 but KerbalStuff has 1.0.4b. Is that the correct version or is there a "c" or later letter?

Share this post


Link to post
Share on other sites
Currently I am only able to deny based on contract type. If I try to use auto accept then it makes a rule to deny. The same happens if I try to auto accept 'contains text', jool for example. Auto accepting 'funds over X' works

http://i.imgur.com/cGzT4FX.png

http://i.imgur.com/FAkYqxx.png

EDIT :

I downloaded mine through Ckan, is that the right one? I have the option but it does not work to accept, only deny.

Oh wow thanks for telling me about that. What seems to have happened is that I only made the accept text work for the quantity contracts.

Very cool mod, I'll play with it soon and offer feedback if I can think of any. One question though:

What is the correct version? The changelog says 1.0.4 but KerbalStuff has 1.0.4b. Is that the correct version or is there a "c" or later letter?

It is the 1.0.4b but the version text file did not have the b when I had released it. There will be a 1.0.4c out soon.

Share this post


Link to post
Share on other sites
Oh wow thanks for telling me about that. What seems to have happened is that I only made the accept text work for the quantity contracts.

It is the 1.0.4b but the version text file did not have the b when I had released it. There will be a 1.0.4c out soon.

Have you thought about simply suppressing Squad's contract system and having this one generate the contracts via filter? How heavy a load can the rejector handle when KSP spits out contracts and this constantly rejects them?

I'll definitely be giving this a try, thanks for making it!

Edited by regex

Share this post


Link to post
Share on other sites
Have you thought about simply suppressing Squad's contract system and having this one generate the contracts via filter? How heavy a load can the rejector handle when KSP spits out contracts and this constantly rejects them?

I'll definitely be giving this a try, thanks for making it!

I can try to see if this is possible, but I do not believe it to be.

EDIT: I may have found a solution

Edited by rreeggkk

Share this post


Link to post
Share on other sites
I can try to see if this is possible, but I do not believe it to be.

EDIT: I may have found a solution

See here for how Contract Configurator removes stock contracts from ever being generated.

Share this post


Link to post
Share on other sites
See here for how Contract Configurator removes stock contracts from ever being generated.

That won't work for me because I need to remove contracts not only on type but also on text and funds. I thought I had a solution, but it doesn't seem possible to actually override the ContractSystem.

Share this post


Link to post
Share on other sites
That won't work for me because I need to remove contracts not only on type but also on text and funds. I thought I had a solution, but it doesn't seem possible to actually override the ContractSystem.

True - it's a partial fix, at least you'd only be battling based on funds/text and not type. The only way I could think of to cheat the contract system in the way you need would be remove all contract types and provide your own singular contract type that wraps the real contract. But it's not easy as you can't just "return" a contract of the right type (because of the way the system works).... I think it could be done, but extremely ugly/hacky.

- - - Updated - - -

Come to think of it, if performance is the concern than maybe your best bet is to just set it up as a coroutine and yield after x rejections - that'll effectively put a cap on how many times per frame you can reject.

Share this post


Link to post
Share on other sites
True - it's a partial fix, at least you'd only be battling based on funds/text and not type. The only way I could think of to cheat the contract system in the way you need would be remove all contract types and provide your own singular contract type that wraps the real contract. But it's not easy as you can't just "return" a contract of the right type (because of the way the system works).... I think it could be done, but extremely ugly/hacky.

- - - Updated - - -

Come to think of it, if performance is the concern than maybe your best bet is to just set it up as a coroutine and yield after x rejections - that'll effectively put a cap on how many times per frame you can reject.

I won't say that the problem is performance but the problem is the fact that the Mission Control gui won't respond unless the contracts are all generated. That probably will be a better way to get around the problem though. The hacky way seems like it wouldn't work that well.

Share this post


Link to post
Share on other sites

I doubt this is easy or even possible but I have been told my modders that I should suggest things and let them decide how possible they are :)

I'd love, in the contracts window, when I click "X", to instead of just denying the contract get a little popup window. Or ideally have 2 "X"es, one to cancel the contract and one to set up a cancel filter. The filter would have a menu with all possibilities for that contract. For example, you have a contract up to put a satellite in an equatorial orbit around Mun. You click the "cancel and filter" button and you get a menu:

Auto-Deny All:

  • Mun contracts.
  • Satellite contracts.
  • Equatorial Satellite contracts.
  • Mun Satellite contracts.
  • Mun Equatorial Satellite contracts.

Share this post


Link to post
Share on other sites
I doubt this is easy or even possible but I have been told my modders that I should suggest things and let them decide how possible they are :)

I'd love, in the contracts window, when I click "X", to instead of just denying the contract get a little popup window. Or ideally have 2 "X"es, one to cancel the contract and one to set up a cancel filter. The filter would have a menu with all possibilities for that contract. For example, you have a contract up to put a satellite in an equatorial orbit around Mun. You click the "cancel and filter" button and you get a menu:

Auto-Deny All:

  • Mun contracts.
  • Satellite contracts.
  • Equatorial Satellite contracts.
  • Mun Satellite contracts.
  • Mun Equatorial Satellite contracts.

Ill see what I can do about this. As far as I can tell it should be possible.

Share this post


Link to post
Share on other sites
I doubt this is easy or even possible but I have been told my modders that I should suggest things and let them decide how possible they are :)

I'd love, in the contracts window, when I click "X", to instead of just denying the contract get a little popup window. Or ideally have 2 "X"es, one to cancel the contract and one to set up a cancel filter. The filter would have a menu with all possibilities for that contract. For example, you have a contract up to put a satellite in an equatorial orbit around Mun. You click the "cancel and filter" button and you get a menu:

Auto-Deny All:

  • Mun contracts.
  • Satellite contracts.
  • Equatorial Satellite contracts.
  • Mun Satellite contracts.
  • Mun Equatorial Satellite contracts.

This sounds very very good to me. Maybe the filter popup could be activated through right clicking the contract itself, then you don't need to move the mouse all the way to the other side of the screen to deny and set up a filter.

I would like to suggest also having the ability to filter for science, funds or rep values.

Also the ability to make it an auto accept filter.

One thought on the 'no available contract freeze'. If the plugin waited for say 5 seconds (maybe set this in settings) and it still found itself denying every contract that was created, maybe allow any contract at that point?

Share this post


Link to post
Share on other sites
This sounds very very good to me. Maybe the filter popup could be activated through right clicking the contract itself, then you don't need to move the mouse all the way to the other side of the screen to deny and set up a filter.

I would like to suggest also having the ability to filter for science, funds or rep values.

Also the ability to make it an auto accept filter.

One thought on the 'no available contract freeze'. If the plugin waited for say 5 seconds (maybe set this in settings) and it still found itself denying every contract that was created, maybe allow any contract at that point?

Ill do both just to make it easier. Also sure I can add the value filters. I can also make it so that if you press the accept button it will ask you if you want to auto accept. If I don't find a better solution I will probably just make it decline bad contracts every so often instead of when they are generated.

Share this post


Link to post
Share on other sites
If I don't find a better solution I will probably just make it decline bad contracts every so often instead of when they are generated.

I like that. Maybe with a timer. :D

Share this post


Link to post
Share on other sites

First of all, thx for making that mod! Great addition to the game.

I ran into some problems that were not stated yet.

-when I reject a mission and leave the mission control building, it comes up with suggestions to filter by. That would be great, but there are always seven identical windows showing up. Also I get suggestions for filtering missions that I already filter! Sometimes filtered missions appear nontheless and I reject them. The mod should detect that I already filter them and not suggest (again seven times) to filter them.

But besides that it´s working great on 1.0.2

Keep up that good work, the idea is great!

Share this post


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

Sign in to follow this