Skip to content

Latest commit

 

History

History
141 lines (122 loc) · 7.05 KB

README.md

File metadata and controls

141 lines (122 loc) · 7.05 KB

DU-Container-Monitor

OVERVIEW
This code is destined to Dual Universe game.
This is a Container monitor for pure and ore materials. It can be used to monitor container percentages and it readouts. It was design to have a Container Hub element side each item.

This HUD was designed for a Large Transparent Screen(or two). Each screen can gather 20 materials. It uses a Zone detector to turn up every board for optimal CPU usage.


HOW TO SETUP HUD:
Slot1: CORE
Slot2: SCREEN_A
Slot3-6: SCREEN_B (optional) / DOOR1 (optional) / DOOR2 (optional) / Databank (optional - no need to rename it)


INSTRUCTIONS:
1. Place Main board
2. Place a Transparent Screen L or similar
3. Link CORE (no need to rename slot to CORE because it will autodetect)
4. Link SCREENS
5. Copy minified code from Main Board file, and paste it under advanced options on board options.
NOTE: when you copy paste the code, it will rename automatically slot1 to CORE and slot2 to SCREEN_A (if you are using a second screen, just neeed to rename the other slot to SCREEN_B)

6. Edit Lua script and check if you have your screen name right. SCREEN_A for first, and if you want a 2nd one name it SCREEN_B
7. Check parameters (setup refresh rate in seconds, containers default litre space, min and max percentage for red and green indicators)
8. Check Labeling Instruction below to know how to rename containers/hubs

OPTIONAL
9. Link Databank (no need to rename slot to DB because it will autodetect)

If you want to start the board with your presence
10. Link Relay to board and detector zone or manual button for example (optional) (you can always turn the board manually)


Labeling Instructions:
CH stands for ContainerHub
C stands for Container
1 for quantity of containers
L for size of the container
ACANTHITE for material type

Change everything accordingly except CH or C.
Ex.: CH_3S_CARBON (you have 3 small containers with carbon), CH_6L_IRON (you have 6 large containers with iron), C_1M_IRON (you have 1 M containers with IRON (the number one could be omitted, like C_M_IRON)

Material name always in CAPS. List: HEMATITE, IRON, BAUXITE, ALUMINIUM, COAL ,CARBON ,QUARTZ ,SILICON ,LIMESTONE ,CALCIUM ,ACANTHITE ,SILVER ,MALACHITE ,COPPER ,NATRON, SODIUM, PYRITE, SULFUR, PETALITE, LITHIUM, CHROMITE, CHROMIUM, GARNIERITE, NICKEL, GOLDNUGGETS, GOLD, RHODONITE, MANGANESE, CRYOLITE, FLUORINE, COBALTITE, COBALT, KOLBECKITE, SCANDIUM, COLUMBITE, NIOBIUM, VANADINITE, VANADIUM, ILMENITE, TITANIUM, OXYGEN, HYDROGEN, WARPCELL


CUSTOM ORDER ON SCREEN:

At system start() you will find two variables (SCREENA and SCREENB).

local SCREENA = {"HEMATITE","IRON","BAUXITE","ALUMINIUM","COAL","CARBON","QUARTZ","SILICON","LIMESTONE","CALCIUM",
"MALACHITE","COPPER","NATRON","SODIUM","CHROMITE","CHROMIUM","ACANTHITE","SILVER","PYRITE","SULFUR"}

local SCREENB = {"PETALITE","LITHIUM","GARNIERITE","NICKEL","GOLDNUGGETS","GOLD","CRYOLITE","FLUORINE",
"COBALTITE","COBALT","KOLBECKITE","SCANDIUM","RHODONITE","MANGANESE","COLUMBITE","NIOBIUM","VANADINITE", "VANADIUM","ILMENITE","TITANIUM"}


This will define the order that materials are placed on screen. If you need an empty space use EMPTY. You can also use OXYGEN, HYDROGEN or WARPCELL
Please use it wisely.

-- LIST OF ORE/PURES:
-- "HEMATITE","IRON","BAUXITE","ALUMINIUM","COAL","CARBON","QUARTZ","SILICON"
-- "LIMESTONE","CALCIUM","MALACHITE","COPPER","NATRON","SODIUM","CHROMITE","CHROMIUM","ACANTHITE"
-- "SILVER","PYRITE","SULFUR","PETALITE","LITHIUM","GARNIERITE","NICKEL","GOLDNUGGETS","GOLD"
-- "CRYOLITE","FLUORINE","COBALTITE","COBALT","KOLBECKITE","SCANDIUM","RHODONITE","MANGANESE"
-- "COLUMBITE","NIOBIUM","VANADINITE","VANADIUM","ILMENITE","TITANIUM"

-- EXTRA MATERIALS TO USE: "OXYGEN", "HYDROGEN", "WARPCELL"

-- On this next arrays you will place witch order you like
-- Read always left to right, then next line.
-- YOU CAN SET "EMPTY" if you need a blank space




DOORS:

If you are using doors, just need to link them to the board. Name the slots DOOR1 and DOOR2 (optional).
Activate at parameters (UseDoors), and at the final function at System/start, edit the caracter names that will trigger the doors.

EXTRA:

If you want you could format first screen with 4 columns. You could use this setting if you are not planning to use any container hub over the screen. Just uncheck "UseContainerHub" at parameters, and reload board.


Bonus Screen

This is a HTML only board. Feel free to change the names to your liking.


CHANGE LOG
v1.4 11 Nov 2020 - first time i remembered to create a log
v1.7 17 Nov 2020
Major refactoring
Added DB for upgrade purposes (storing user configs)
Added (L / kL / kt) readout below progress bar
Added capability to read containers and container hubs ( C_1L_IRON or CH_1L_IRON)
Restored old terminology to setup screen variables. Ore/Pure names instead m1,m2,m3,etc...
Info readouts when screen is setup and no container/hub found
Correct order for T1,T2,T3,T4 when using 2 full screens/1 without "hubsonscreen"
Added showHudWidget variable. Please turn it to true for DEBUG purposes.
Added capability to have 10 containers in the name. (Ex.: CH_10L_HEMATITE)

Thanks to: Jericho,Archaegeo,Kumare,Tricky Trixy,-CML- Schoff for all input.
v1.8 17 Nov 2020
Container "C_" now working as intended. You can use either C_L_IRON or C_1L_IRON (no meaning to say that the "one" container is 1.)
If you name 2 containers with the same ore/pure it will sum values of the two (or more)

v1.9 01 Dec 2020
Refactoring
Added capacity to handle items that have litres diferent than ore/pures.
Fixed percentages with .333333 or .666666 infinite readout.
Now the screen shows item name instead of the variable name. Now we can all have "Gold Nuggets"
Improved ReadME info to help new players


Credits carmopereira

Buy Me a Coffee at ko-fi.com

A big thanks to Jericho :) Your help is gold

NOTE: Any issue, please contact carmo#1590 at Discord or at DU_CONTAINER_HUD channel on DU Open Source Initiative Discord Server https://discord.gg/tBteJZSQxe