Space Engineers

Space Engineers

Not enough ratings
Inventory Light
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
126.765 KB
18 Apr, 2023 @ 6:36pm
6 Feb, 2024 @ 10:19pm
9 Change Notes ( view )

Subscribe to download
Inventory Light

Description
This simple script monitors the fill level of your cargo. As inventory fills or empties, the script changes the color of any light you have tagged. Color progresses from green (empty) to red (cargo full) to flashing red (now you are filling other things like connectors). The script will also display a simple percentage on any tagged LCD.

This is one of the very first scripts I wrote years ago.

Performance is adaptive to minimize sim impact. Below, 95%, the script only runs once every 100 frames. Above 95%, the script runs once very 10 frames.

Customization
After adding the script to a Programmable Block, check the Custom Data to adjust settings. Recompile the block after making changes.

SCRIPT TAG
Place this text anywhere in the custom name field of any light or LCD that you want this script to manage. Default value: [INVLT]

CARGO KEYWORD
Place this text anywhere in the custom name field of any cargo you want this script to monitor. Default value: cargo
Note: this is not a "tag" so it is not wrapped in brackets. It is a keyword so it just needs to appear anywhere in the block's Display Name. By using "cargo" the script will monitor all cargo containers.

INCLUDE DRILLS
Determines if drill inventory is included in the calculations. Default value: false

COLOR STEPS
This is the number of steps between the "empty" color (green) and the "full" color (red). This count includes both the "empty" and "full" color. So if you want "green -> yellow -> red," then you would put 3. Default value: 5.
Must be at least 2. Works best with small values, such as 3 or 5.

Other Mods You Might Like

Other Scripts You Might Like

Bugs, Suggestions, Questions, and Comments -> Discord[discord.gg]
I don't troubleshoot, give technical advice, or have discussions in the comment section. That's what the Discord is for. Comments get lost to time, but discord histories can be searched and referenced.
1 Comments
Will.Exe 31 Aug, 2024 @ 2:01pm 
Can I add this to cockpit screens for mining ships?