I have just uploaded version 0.05 to the Nexus mod site and Steam
www.nexusmods.com/xrebirth/mods/466/
http://steamcommunity.com/sharedfiles/f ... =626271301
Station Production Limiting works with X Rebirth 3.61, 4.00 and 4.10 RC3
YouTube Videos v0.01
X Rebirth Station Production Limiting mod 101
https://youtu.be/k1YB-gXAkRQ
X Rebirth Station Production Limiting mod 201
https://youtu.be/1hG6Uhb-I9A
X Rebirth Station Production Limiting mod 301
https://youtu.be/woTcIDXW_P4
Changes from v0.04
Compensate for format of game version string changing in 4.10 RC3 and add extra paranoia when checking version to prevent crashing the GUI
Changes from v0.03
Production Limiting menu was always using the default production method even with OL stations which caused food to be displayed as a primary resource instead of Bofu. Although it displayed food while setting the Limiting factor it actually correctly returned Bofu so this was actually cosmetic. Added a work around that should cope with omicron, devries and xenon production methods
Changes from v0.02
"increased paranoia" by doing more input and API return value checking in lua scripts. I hope this will help to cope with weird and wonderful game scenarios, duff stations, API calls that unexpectedly fail and other oddities
Changes from v0.01
Add the minimum primary wares that are needed to start a production batch and a station Storage column to Production Limiting menu.
Unfortunately that changes what the Production Limiting menu looks like and breaks all of the videos a bit

Improve onUpdate to only update the screen if something has changed
Add station storage to onUpdate
Compensated for changes to API calls in 4.00
Objective
To provide a way to limit a stations production of wares
How to Use
Select the Station whose production module you wish to limit and click on Details
Expand the Production modules section
Select the Production module that you want to limit and click on Details
The Production Limiting section lists all of the wares that this module can produce
Click on the configuration icon (spanner) to the left of the ware that you want to limit
Now use the slider in the Production Limiting menu to set the production limiting or brake factor. 0% does nothing and 100% will stop all production for this module
Click on OK to accept the limit or Back to abandon any changes
This ware will now be limited
To change your mind return to the Production Limiting menu at any time
Setting the limit to 0% and clicking on OK will remove a production limit
If you want to use the Configuration menu then click on the top left icon (spanner) on the Production Limiting menu
If you set the Global Debug to 1 or 2 and look in the debug log then you will see some additional information that shows what is happening under the bonnet.
You will need a log file tailing program such as SnakeTail (http://snakenest.com/snaketail) to watch the end of the debug.log
The Station Production Limiting mod
Allows for limiting of individual production lines on player stations
Allows different limits to be placed on each production module on each station and across different player stations
Supports the Turret, URV and Missile Forges which produce multiple products by limiting one or more of the potential products
If a product is 100% limited then the production cycle still runs but the production module, on average, produces nothing and consumes nothing
Reduces consumption of Primary and Secondary wares to go with the reduction in Products
Multi-lingual with support for Russian, French, Italian, Spanish, English and German
Setting Limits
A production limit can be set at any time and will return un-needed resources at the start of the cycle (if production is running) but the product totals (stock adjustment) will only update at the end of a working production cycle
The Production Limiting menu works in the same way as the Encyclopedia menu and does not show the effect of Product Efficiency (Specialists etc) but it will take that into account when it adjusts the production quantities
The Production Limiting menu only shows Primary Resources due to space limitations but it will limit the use of secondary resources when
it adjusts the production quantities
As resources cannot be produced or consumed in fractions of units this mod attempts to limits the factor to values that consume and create
complete units of wares
Configuration menu
Lets you dynamically set the Debug level.
The higher of the Global or Station setting takes effect for that station
If you set the Global Debug to 1 or 2 and look in the debug log then you will see some additional information that shows what is happening under the bonnet.
You will need a log file tailing program such as SnakeTail (http://snakenest.com/snaketail) to watch the end of the debug.log
Lets you log the configuration to the Logbook
Allows you to remove most of the data that this mod uses
How it works
This is a work around to the station managers production software
It relies on the station manager moving some wares around for it and adjusting the total production at the end of each batch as the production module software doesn't realise that some of its resources have been put back into stock
The full set of wares is still needed to start off a modified production cycle.
Within about 10 seconds of production starting the manager restocks a proportion of the wares which prevents the production module from producing the full amount of product and reduces the wares that it consumes
At the end of the production cycle the manager has to adjust the stock levels of product as the production module thinks that it has produced more than it actually has.
The net result of the station managers work is to reduce the total amount of a specific ware that is produced and to reduce the wares that it consumes.
Missile, URV and Turret Forges
These produce more than one product by cycling betweeen the available products.
The products can be individually limited and the limits can be set at any time.
The limits for a specific product won't take effect until that product gets to its production slot.
Known issues
The full set of wares is still needed to start off a production cycle
The Production Limiting screen works in the same way as the Encyclopedia screen and does not show the effect of Product Efficiency (Specialists etc) but it will take that into account when it adjusts the production quantities
The Production Limiting screen only shows Primary Resources due to space limitations but it will limit the use of secondary resources when it adjusts the production quantities
The Production Limiting screen slider value display has some rounding issues and only shows to the nearest integer
The debug information for the Missile, URV and Turret Forges does not correctly identify if a specific product is being produced - it reports them all as in the same state - cosmetic
Clearing the limits still leaves an empty list and a single blank value on each manager and the players BlackBoards. There is no lua Delete BlackBoard entry that I know of at the moment
ToDo
Module level debuging
Fully clean up player and Manager Blackboards
Alter the production rates on the main production menu to show the effects of the production limit
Production Limit menu maybe put up a warning at the top of the screen if you are missing the resources to start a production cycle
jth
-- moved this down to put release info above
I am thinking about digging into the feasability of applying a throttle factor to each production module of a station. I have been through the request thread and I think its some of item 5 from a post by Hardcard on Wed 15th June 2014 (its about half way down page 23)
I think that production can be currently stopped by an existing mod that fiddles the hull percentage which is a neat idea.
but would like to add a 0 - 100 % capability via a slider that would reduce production to say 50% using 50% of the resources over the same length of time
It would be a combined UI mod for the slider and somewhere to put the throttle percentage plus some interaction with the production script to apply it. Could probably store the config in the station manager blackboard and wipe it if they get re-assigned.
If I can get that working then I might look at turning on and off selling of secondary resources and controlling the point at which the station starts to sell them.
has anyone else gone down this path ?
Any pointers on where the station ware production code is ?
Thoughts anyone ?
jth