DMagic

[1.4.x - 1.5.x] Contract Reward Modifier [v2.6] [3/14/2018]

Recommended Posts

Contract Reward Modifier V2.6

Download from Space Dock

Download from Curse Forge

Alternate Download: GitHub

 

Source is available at GitHub

Formerly a part of Contracts Window +, Contract Reward Modifier provides an in-game UI for modifying all contract reward and penalties, as well as allowing for limits to be placed on the number of contracts offered for each type. All values can also be set using a global config file in your GameData folder.

FdXv5C1.jpg

The Contract Reward Modifier window presents a set of sliders that allow for changes to all contract and parameter reward amounts, as well as several other options.

Contract and Parameter Type Selection

  • At the top of the window are two drop down buttons that allow for the selection of different contract and parameter types.
    • A special Global Settings selection is available for both Contract and Parameter Types.
    • Values can be set with the sliders under the global settings; these will be applied to all Contract/Parameter Types after pushing the Apply To All button.
  • All addon contract and parameter types should be available here.
  • Contract Configurator types are pushed to the bottom of the list to avoid any potential spoilers revealed by contract names.

 

Sliders

  • The sliders below control the amount given for each different reward and penalty type.
  • Strategy values are not directly affected by these sliders, i.e. setting science to 0.1% won't affect the science rewards given while using the science strategy.
  • The sliders are half-way log-scale; the left half of the slider allows for 0.1 - 100% of the original value, while the right half allows for 100-1000% of the original.
  • Contract duration can be adjusted from 10-1000%, but will only affect newly offered contracts.
  • The maximum number of offered and active contracts of a type can be specified; any contracts beyond this amount will be rejected when the system tries to offer new contracts.
    • All Contract Configurator contracts are can only be set to allow 1 or more contracts to be offered.

 

Addon Settings

  • By default the values only go down to 0.1%; there is an option to allow for nearly 0% (0.00000001%) using the Allow 0% Values toggle.
    • Using this may cause odd rounding errors and prevent further adjustments from being made to any active contracts/parameters of that type.
  • A toggle option is available to Alter Active Contracts as well as newly offered contracts.
    • Turning this on and off while adjusting values may cause problems with reward values.
    • Be default it is off; but you should stick with either turning it on, or leaving it off; don't go back and forth.
  • If Blizzy78's Toolbar is installed you can switch between it and the stock app launcher using the Use Stock Toolbar toggle.
  • There is also toggle to completely Disable All Toolbars.

    • This can be used if you have set the values you want and don't need the toolbar icon taking up space.
    • Toolbars can be re-enabled by changing the disableToolbar field to True at the top of the config file.
  • Contract/Parameter amounts can be reverted to the default values set in your config file using the Reset Values button.
  • The current values can be saved to the global config file in your GameData folder using the Save To Config button.

    • Values saved to the config file will serve as the default for current save games.
    • New save files (or save files that haven't been loaded while Contract Reward Modifier has been installed) will set all contract and parameter values using the config file settings.
    • The config file-only disableSaveSpecificValues field allows you to bypass any values set in your save files; all values stored in the save files will be deleted.
    •  

An annotated example of the config file layout is shown here.

 
ContractValuesNode
{
disableToolbar = False //Prevents the toolbar button from loading if set to True
disableSaveSpecificValues = False //Prevents any save-specific settings from being loaded if set to True
allowZero = False //Allows values to be set to near-zero; this can be overridden in a save file
alterActive = False //Allows currently active contracts to be altered; this can be overridden in a save file
stockToolbar = True //If Blizzy78's Toolbar is installed this can be used to use it instead of the stock app launcher; this can be overridden in a save file
warnedZero = False //Prevents the warning popup when activating "Allow Zero" in-game; this can be overridden in a save file
warnedToolbar = False //Prevents the warning popup when disable the toolbar in-game; this can be overridden in a save file
warnedAlterActive = False //Prevents the warning popup when activating "Alter Active Contracts" in-game; this can be overridden in a save file
ContractTypeConfigs
{
Item //An example of a contract type
{
typeName = CollectScience //The contract types name; this is found in the game code and must match the real name exactly
fundReward = 0.5 //The reward and penalty values can be set from 0 to 10; this corresponds to 0 - 1000%, or a 0 - 10X multiplier.
fundPenalty = 1.8 //Values set to 0 in the config file will be replaced by 0.0000000001
fundAdvance = 1.2
repReward = 0.7
repPenalty = 1.3
scienceReward = 0
durationTime = 0.6 //Duration time values below 0.1 (10%) are not allowed; anything below that will be increased to 0.1
maxOffer = 4 //Values can be set to 0 to prevent any offers of this type
maxActive = 6 //A value of 100 means no limit on offered or active contracts
contractConfiguratorType = False //Contract Configurator contracts require special handling; this value should not be altered by hand
}
}
ParameterTypeConfigs //Each parameter type has its own set of values
{
Item
{
typeName = CollectScience //Parameter type name
fundReward = 0.2 //Reward and penalty values are set the same as described above
fundPenalty = 3.5
repReward = 0.3
repPenalty = 4.0
scienceReward = 0.2
contractConfiguratorType = False //The same as described above
}
}
}

 

--------------------

btn_donate_SM.gif Consider donating if you like what you see here. * Money will not go directly to development or upkeep of this addon

--------------------

Change Log:

v2.6
- Updated for KSP 1.4

v2.5
- Updated for KSP 1.3

v2.4
- Updated for KSP 1.2
- Update Toolbar wrapper
- Fix support for Contract Configurator
       - CC contracts only modified when the contract is accepted, not when offered
- Ignore contract weighting when blocking contracts
- Fix some Unity initialization errors

v2.3
- Updated for KSP 1.1.1
- Fixed an issue that prevented the window from being used immediately after first starting KSP

v2.2
- Updated for KSP 1.1

v2.1
- Updated for KSP 1.0.5
- Don't apply the contract decline penalty when blocking contracts over the limit
- Update the default config file with new contract and parameter types; remove deprecated types
- Some UI tweaks
- Fix some potential loading errors
- Fix a potential problem with the close button icon
- Remove some log spam when using mods that add new contracts

v2.0
- Updated for KSP 1.0

v1.3
- Bug fix for blocking contract offers beyond the limits you've set
    - Contracts added from the Alt+F12 debug menu will no longer be block
    - Only contracts added through the automatic Contract System will be blocked now

v1.2
- Update for compatibility with Contract Configurator 0.7.0

v1.1
- Initial release

This addon uses TriggerAu's KSP Plugin Framework code

Released under the MIT License

Edited by DMagic
KSP 1.5 support

Share this post


Link to post
Share on other sites
Good stuff, congrats on the release!

Thanks.

As a side note, Contract Configurator contracts are theoretically supported as of version 7.0, but this may need updating when that is released. For now any CC contract types will simple be ignored; CC parameter types should be fine.

Share this post


Link to post
Share on other sites
As a side note, Contract Configurator contracts are theoretically supported as of version 7.0, but this may need updating when that is released. For now any CC contract types will simple be ignored; CC parameter types should be fine.

And I'm expecting to get 0.7.0 out tonight or tomorrow, so there won't be too long to wait on this.

Share this post


Link to post
Share on other sites

Version 1.2 is out.

It is just a minor compatibility update for Contract Configurator. Contract Rewards Modifier was trying to get to CC's contract type list before CC could generate it, so this update just makes it wait a bit before trying to access the list.

All CC contract types should show up at the bottom of the Contract Type list and be limited to at least 1 offered and active contracts. They also won't update in real time if you have Contracts Window +, all other contract types should, but the update values will be shown after the next scene change.

Share this post


Link to post
Share on other sites

Nice one. Convenient GUI is definitely an advantage :wink:

Share this post


Link to post
Share on other sites

Version 1.3 is out on Kerbal Stuff.

It fixes a problem where contracts added through the standard, automatic system were not being blocked properly when you've set limits on the amount of active or offered contracts of a certain type.

As a side effect of fixing this, you can now add contracts beyond the your limits using the Alt+F12 debug menu.

Share this post


Link to post
Share on other sites

So, um, is there something I should know about? :kiss:

There seems to be a lot of downloads for Version 1.2 and not so many for 1.3. I'm wondering if there is some bug in 1.3 that I'm not aware of.

VS5z1EJ.jpg

Share this post


Link to post
Share on other sites

Version 2.0 is out and updated for KSP 1.0, everything seems to be working ok.

Share this post


Link to post
Share on other sites

I have a problem with version 2.0, namely the science sliders are a bit wonkey. the first time I put the sliders down it doesnt change any contract, but after that theye are affected.

For example, I have a contract that offers 6 science. I put the slider to 0.1 and the contract still offers 6 science. I put the slider back to 100 and now the contract offers 6000 science. Putting slider back to 0.1 and it's back to 6 science.

Share this post


Link to post
Share on other sites
I have a problem with version 2.0, namely the science sliders are a bit wonkey. the first time I put the sliders down it doesnt change any contract, but after that theye are affected.

For example, I have a contract that offers 6 science. I put the slider to 0.1 and the contract still offers 6 science. I put the slider back to 100 and now the contract offers 6000 science. Putting slider back to 0.1 and it's back to 6 science.

Did you have the "Alter Active Contracts" option turned on when you started adjusting the sliders. If you have it turned off, then move the sliders around, then turn it on and start moving the sliders weird things will happen (really it just doesn't have any way of "remembering" what the previous settings were).

You should either turn that option on or leave it off, don't fiddle with it, as is stated in the instructions in the first post.

To fix it, you can turn off the active contracts option, reset the science slider to 100%, then turn it back on, then you should be able to adjust the values and get results that make sense. You can essentially exploit the system doing this, getting nearly infinitely large rewards, but you might as well just use the cheat options if you're going to do that.

Share this post


Link to post
Share on other sites

I had it on before I started adjusting, but nice to know how to fix it :)

edit: I installed again and tested with a new game, it works fine now. Guess something didnt install correct the first time as another problem I had is gone now as well, after "completing" a record contract(speed/ altitude) it would not actually complete, but would get copied in the contract dropdown, then copy again when the parameter for the next one would trigger so at 750 m/s and 50km altitude for example I'd have 4 or 5 "go 250 m/s" and a bunch of the altitude as well. Thought it was caused by either this plugin or contract window, but that "bug" is gone now as well.

guess something did not install correct first time. Off to enjoy a game with not so much science spam from contracts now :)

Edited by mudkest

Share this post


Link to post
Share on other sites

It seems to me that this mod is going to let me get rid of all those part testing contracts that I despise. That's exciting!

Share this post


Link to post
Share on other sites

I tried to use this mod to stop KSP from giving me rescue Kerbal contracts, but when I changed the slider for that type, nothing happened and the game still offered me those contracts at the same rate.

A while later, all contracts stopped completely even though the max offered for every other contract type is 10 according to this.

Share this post


Link to post
Share on other sites
I tried to use this mod to stop KSP from giving me rescue Kerbal contracts, but when I changed the slider for that type, nothing happened and the game still offered me those contracts at the same rate.

A while later, all contracts stopped completely even though the max offered for every other contract type is 10 according to this.

Do you have the log files?

Share this post


Link to post
Share on other sites

Do you mean the KSP.log file or the Contract ModifierConfig.cfg?

Share this post


Link to post
Share on other sites
Do you mean the KSP.log file or the Contract ModifierConfig.cfg?

KSP_Data/output_log.txt is the log file.

Share this post


Link to post
Share on other sites

Hmm, how about the save file?

Also, you should probably remove DDSLoader, I don't think there is any reason to keep that around anymore. Though I'm pretty sure that isn't causing this problem.

When Contract Reward Modifier blocks a contract it generates a log file: Contract of type[*] over the limit; blocking contract, or something to that effect.

That message doesn't show up anywhere in the log file, so CRM isn't actually blocking anything, at least not during the period covered by this log file. There is a contract completion message, new contracts are generally created whenever you complete a contract, so I would have expected to see that log message pop up there.

Have you tried adding contract manually, through the Alt + F12 debug menu. CRM won't block contracts added that way, so you can check if there is some other problem by trying that.

Share this post


Link to post
Share on other sites

In all fairness, it is probably a user error somewhere along the line.

I have managed to get it to keep sending more contracts, but the Rescue Kerbal contracts keep appearing.

I selected the Rescue Kerbal contract in the contract reward modifier menu and set the max offered slider to 0 and then saved to config.

Share this post


Link to post
Share on other sites

There is something weird in the log file about CRM not finding a handful of contract types, I think the rescue missions were one of them. Maybe try deleting the config file and copying the default file from the download package. It should be able to automatically add contract types that aren't in the config file, but maybe something is going wrong there.

Share this post


Link to post
Share on other sites

Hi! I love this mod! I am having a problem. When I load my game, my version checker is telling me that "Contract Reward Modifier" is a mod made for an earlier version of KSP. I am afraid to use this mod until this is corrected. I'll keep checking for an updated version. Thank you!

Contract Reward Modifier V2.0

Download from Kerbal Stuff

Alternate Download: MediaFire

Source is available at GitHub

Formerly a part of [THREAD=91034]Contracts Window +[/THREAD], Contract Reward Modifier provides an in-game UI for modifying all contract reward and penalties, as well as allowing for limits to be placed on the number of contracts offered for each type. All values can also be set using a global config file in your GameData folder.

http://i.imgur.com/FdXv5C1.jpg

The Contract Reward Modifier window presents a set of sliders that allow for changes to all contract and parameter reward amounts, as well as several other options.

Contract and Parameter Type Selection

  • At the top of the window are two drop down buttons that allow for the selection of different contract and parameter types.
    • A special Global Settings selection is available for both Contract and Parameter Types.
    • Values can be set with the sliders under the global settings; these will be applied to all Contract/Parameter Types after pushing the Apply To All button.

    [*]All addon contract and parameter types should be available here.

    [*]Contract Configurator types are pushed to the bottom of the list to avoid any potential spoilers revealed by contract names.

Sliders

  • The sliders below control the amount given for each different reward and penalty type.
  • Strategy values are not directly affected by these sliders, i.e. setting science to 0.1% won't affect the science rewards given while using the science strategy.
  • The sliders are half-way log-scale; the left half of the slider allows for 0.1 - 100% of the original value, while the right half allows for 100-1000% of the original.
  • Contract duration can be adjusted from 10-1000%, but will only affect newly offered contracts.
  • The maximum number of offered and active contracts of a type can be specified; any contracts beyond this amount will be rejected when the system tries to offer new contracts.
    • All Contract Configurator contracts are can only be set to allow 1 or more contracts to be offered.

Addon Settings

  • By default the values only go down to 0.1%; there is an option to allow for nearly 0% (0.00000001%) using the Allow 0% Values toggle.
    • Using this may cause odd rounding errors and prevent further adjustments from being made to any active contracts/parameters of that type.

    [*]A toggle option is available to Alter Active Contracts as well as newly offered contracts.

    • Turning this on and off while adjusting values may cause problems with reward values.
    • Be default it is off; but you should stick with either turning it on, or leaving it off; don't go back and forth.

    [*]If [THREAD=60863]Blizzy78's Toolbar[/THREAD] is installed you can switch between it and the stock app launcher using the Use Stock Toolbar toggle.

    [*]There is also toggle to completely Disable All Toolbars.

    • This can be used if you have set the values you want and don't need the toolbar icon taking up space.
    • Toolbars can be re-enabled by changing the disableToolbar field to True at the top of the config file.

    [*]Contract/Parameter amounts can be reverted to the default values set in your config file using the Reset Values button.

    [*]The current values can be saved to the global config file in your GameData folder using the Save To Config button.

    • Values saved to the config file will serve as the default for current save games.
    • New save files (or save files that haven't been loaded while Contract Reward Modifier has been installed) will set all contract and parameter values using the config file settings.
    • The config file-only disableSaveSpecificValues field allows you to bypass any values set in your save files; all values stored in the save files will be deleted.

An annotated example of the config file layout is shown here.


ContractValuesNode
{
disableToolbar = False //Prevents the toolbar button from loading if set to True
disableSaveSpecificValues = False //Prevents any save-specific settings from being loaded if set to True
allowZero = False //Allows values to be set to near-zero; this can be overridden in a save file
alterActive = False //Allows currently active contracts to be altered; this can be overridden in a save file
stockToolbar = True //If Blizzy78's Toolbar is installed this can be used to use it instead of the stock app launcher; this can be overridden in a save file
warnedZero = False //Prevents the warning popup when activating "Allow Zero" in-game; this can be overridden in a save file
warnedToolbar = False //Prevents the warning popup when disable the toolbar in-game; this can be overridden in a save file
warnedAlterActive = False //Prevents the warning popup when activating "Alter Active Contracts" in-game; this can be overridden in a save file
ContractTypeConfigs
{
Item //An example of a contract type
{
typeName = CollectScience //The contract types name; this is found in the game code and must match the real name exactly
fundReward = 0.5 //The reward and penalty values can be set from 0 to 10; this corresponds to 0 - 1000%, or a 0 - 10X multiplier.
fundPenalty = 1.8 //Values set to 0 in the config file will be replaced by 0.0000000001
fundAdvance = 1.2
repReward = 0.7
repPenalty = 1.3
scienceReward = 0
durationTime = 0.6 //Duration time values below 0.1 (10%) are not allowed; anything below that will be increased to 0.1
maxOffer = 4 //Values can be set to 0 to prevent any offers of this type
maxActive = 6 //A value of 100 means no limit on offered or active contracts
contractConfiguratorType = False //Contract Configurator contracts require special handling; this value should not be altered by hand
}
}
ParameterTypeConfigs //Each parameter type has its own set of values
{
Item
{
typeName = CollectScience //Parameter type name
fundReward = 0.2 //Reward and penalty values are set the same as described above
fundPenalty = 3.5
repReward = 0.3
repPenalty = 4.0
scienceReward = 0.2
contractConfiguratorType = False //The same as described above
}
}
}

--------------------

https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif Consider donating if you like what you see here. * Money will not go directly to development or upkeep of this addon

--------------------

Change Log:

v2.0
- Updated for KSP 1.0

v1.3
- Bug fix for blocking contract offers beyond the limits you've set
- Contracts added from the Alt+F12 debug menu will no longer be block
- Only contracts added through the automatic Contract System will be blocked now

v1.2
- Update for compatibility with Contract Configurator 0.7.0

v1.1
- Initial release

This addon uses TriggerAu's KSP Plugin Framework code

Released under the MIT License

Share this post


Link to post
Share on other sites

Have a question about the scope of the mod. Is it meant to only affect contracts, or all multipliers (like the sliders when creating a new game)? For an example is it meant to affect building upgrade cost (a result of FundsLossMultiplier I think?). When I was trying it out briefly, it didn't appear to affect the science gain after recovering a vessel, hence my question :)

Share this post


Link to post
Share on other sites
Have a question about the scope of the mod. Is it meant to only affect contracts, or all multipliers (like the sliders when creating a new game)? For an example is it meant to affect building upgrade cost (a result of FundsLossMultiplier I think?). When I was trying it out briefly, it didn't appear to affect the science gain after recovering a vessel, hence my question :)

No, it's all separate from those difficulty sliders. You could use it for separating building upgrade costs (I think Kerbal hiring costs are also affected) from contract penalties. Just leave the stock slider at 100% (or whatever value), then change the global contract funds and/or rep penalty sliders to something higher.

The science gains from vessels returns and experiments also aren't affected by this mods sliders. You could do something similar to what is described above though, use the stock science slider to set values for experiments and adjust the contract sliders from this mod accordingly.

And all of the stock difficulty settings can be changed in your save file after starting. They are all found near the very top of the file, I think the values aren't given as percentages, so if you have science returns at 60% it will show as 0.6 in the save file.

Share this post


Link to post
Share on other sites
Is this working in 1.0.5? I just tried to alter some contracts I'd already accepted and nothing happened when I clicked Apply to All.

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.