wokka1 / Recipes

LUA application for DU which displays recipes and ingredients and calculates the cost/ore requirement, schematic requirement and talent proficiency needed for any of the 900 DU industry recipes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Recipes

LUA application for DU which displays recipes and ingredients. Requires 11 databanks, 3 screens (recommend m size), 3 Programme Boards.

This LUA suite of applications provides a list of all DU recipes, displays their details and a list of their required ingredients. For each ingredient, the application displays the number of items required and (if you have named your factory containers and mapped these to the corresponding ingredient name - see instructions below) the quantity of the relevant stock you have in store. Recipes can be filtered by All / Elements / Condumables / Parts / a user defined search field. Clicking on an ingredient for a recipe will display the details of that ingredient in the 2nd screen, along with a list of its ingredients (requirement number and stock). A third screen displays the total ore quantities (for each ore type) needed to manufacture the recipe selected and an estimate cost (this is based on manual entry of the current market prices for each ore). Third 3rd screen can also display the proficiency talents needed to manufacture the recipe and the industry schematics needed (and also idenfies if you have any of these in your current factory industries)

Latest Version

The latest support version is 1_4_0

Installation:

(it is very important that you link all databanks in the correct order for each PB, therefor I suggest arranging the databanks in the following order: a group of 8 databanks - the database, a single databank - the menu databank, another single databank - the comms databank, a final databank - the stores databank: if you dont have a stores databank in your factory simply use an another empty database).

You will also need to make sure that you have the dkjson.lua libary script in your DU lua library.

  1. The first Programming Board will be used to upload the database. Link this PB (in the following order) to the 8 database databank, then to the menu databank.

  2. Copy the content of the latest Database file in this repository and (using the rightclick/advanced/Paste Lua Code in game option for the PB) paste the content of the file into the first PB.

  3. Execute the code on this PB - it will take a minute or so to run completely (at the end it will list the databank and database IDs linked to the PB for you reference)

  4. Now we need to link the databank to the second PB, in the following order: the 8 database databanks, followed by the menu databank and finally the comms datbank. This PB acts as a 'server' for queries from the display PB.

  5. Next copy the content of the latest Server file in this repository (again using the LUA Paste Cope in game function) into the second PB (server PB).

  6. Finally, we need to link the screens and databanks to the third PB, in the following order: core, menu databank, screen 1, 2, 3, and the cooms databank

  7. Then copy the content of the latest Client file in this repository (again using the LUA Paste Cope in game function) into the third PB (client PB).

Running the Application

The UI should be relatively straight forward.

  1. Run the server PB and wait for the message 'Cache initialisation complete', then launch the client PB. After the client PB has loaded the recipe menus then the recipe list will be displayed on the main screen.

  2. Filter the content of the recipe list using the 4 buttons below the list (All/Elements/Consumable/Parts)

  3. Scroll up/down through the list of recipes using the arrow buttons below the list.

  4. Click on a specific recipe in the list displayed to select it - the recipe details will then be displayed (including the ore costs on the third screen)

  5. Click on a specific ingredient from the list of ingredients (to the right of the recipe list) to select it and display its details on the second screen.

  6. By default the application displays the ore cost of each recipe on the 3rd screen. By pressing the 'Schema' or 'Talent' buttons on the main screen you can change this to display the list of Schematics that are required for each recipe and/or the list of Industry Proficiency Talents (and their levels) you need in order to build this recipe.

  7. You can set up a user defined menu filter (for example to only display all the recipes that contain the word 'engine') by sending a command line instruction to the application (via the LUA chat). For example, a) press 'enter' and go to the LUA chat panel; b) type 'filter' and the string that you want to use as your user defined filter (e.g.'filter engine'); c) you will notice that the 'blank' menu filter button on the main screen now contains your search term; d) press this menu filter to only see recipes with the word 'engine' in them.

  8. you can add the current market prices for ores (via LUA parameters on the client PB) and these will be used to calculate the recipe cost

Mapping your factory containers to ingredients

Doing so will provide additional information for ingredient - the quantity of that ingredient you have in stores.

To integrate (this requires a little knowledge of how to edit LUA code in a programming board in DU):

  1. edit the LUA code in the client PB. Access the unit.start code (with the first line: 'stringMap={}'). Scroll down though this LUA code until you reach the section containing 'storeMap'. 'storeMap' is a mapping between the internal names that the recipe application uses and the names of your factory containers. For example the line:

storeMap["Bsc RobA S"]="sbroboticarm"

maps the 'Basic Robotic Arm S' recipe in the application with a container in your factory called "sbroboticarm".

You will also need to provide information regarding the factory containers and their content. To do this scroll further down through the LUA code until you reach a line containing 'setupMaterialIndex'. This table contains information about the containers in your factory. For example:

setupMatierialIndex("sbroboticarm",{100, "s",0,20})

identifies a container named 'sbroboticarm' which is of size "s", the items in this container have a mass of 100 (each unit), 0 is the default stock (do not change this, always leave it as 0) - you can forget about the last value in this table as they are from a legacy implementation of my factory monitoring application.

n.b. in a future version of this application I will remove the need to enter the item mass in this table by taking it directly from the recipe for each item.

Known Issues

Users upgrading from a previous version of the recipe application will need to check the links on the client PB since these have changed in version 1_3_0. They need to be core, menudb, screen1, screen2, screen3, commsdb - in this order. If you are unsure, then remove the client PB and replace it following the installation instruction from 6 onwards.

Some users have identified that they do not have a copy of dksjon.lua in their library folder. This can be provided on request if you dont have it.

I believe that the time data for the new uncommon, advanced and rare industry recipes is incorrect - appologies, I will fix it soon. There may also be a few incorrect mass/volume data in some of the newer recipes. Please, if you notice any specificy data error, report them to me and I will endeavor to fix them.

Version

1_0_1: 1) fixed problem that stopped recipes with t4 ore from calculating the ore cost correctly. 2) trying to avoid the cpu overload error when first recipes selected are complex, doing this by initialising/prepopulating the cache with common recipes during server startup.

1_1_0: 1) now supports DU 0.23; 2) can provie schematic and talen information; 3) allows user defined menu filters; 4) some bug fixes

1_1_1: 1) fixed a database issue which caused some recipes to be duplicated; 2) added LUA parameters to set the background colours; 3) fixed a fault in the caching algorithm

1_2_0: 1) this pre-release update allows user to input (via LUA Parameters) their Productivity Talent Levels. The cost (ore costs) displayed are for a single litre/unit of the recipe product with the productivity bonus applied. I have so far implemented Productivity Talents for all recipe except Scrap and Honeycomb. Talent Productivity Levels can be changed via the LUA Parameters on the Server PB.

1_3_0: 1) The database now contains the new (DU 0.23) Uncommon, Advanced and Rare industries and XL containers, to load these you will need to redownload the latest database file and follow the installation instruction 2 and 3 above; 2) I have provided LUA Parameters so that users can change the Recipe Panel Background Colour, the Ingredient Panel Background Colour, the Panel Font Colour and the Highlight Line colour; 3) The schematic list now scans your factory for any loaded schematics and lists these against each requirement telling you if you already have this schematic somewhere in your factory; 4) I have removed the 'stores databank' from previous versions of this application and integrated the container monitoring code. Therefore, if you follow the instructions in the 'Mapping your factory containers to ingredients' section above then the application will display the number of ingredients that you have in stores against each requirement.

1_3_1: 1) Bug fix for recipe data for Limestone and Natron; 2) Added productivity talents for Ore refining in addition to Pures as I missed this in 1_3_0; 3) included Warp Cells in Consumables Menu

1_4_0: 1) added the new unc/adv/rar components needed to support the new tiered industries and the new adv/rare atmo/space engines; 2) a consequence of 1 is that I have needed to rework the menu handling routines as there are now around 1000 recipes and the menu databank became full and so wouldnt work.

About

LUA application for DU which displays recipes and ingredients and calculates the cost/ore requirement, schematic requirement and talent proficiency needed for any of the 900 DU industry recipes.

License:GNU General Public License v3.0