Space Engineers

Space Engineers

Not enough ratings
Cargo Capacity V2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
2.444 KB
14 Jan, 2015 @ 1:44pm
1 Change Note ( view )

Subscribe to download
Cargo Capacity V2

Description
Cargo Capacity V2

Improved Version of Cargo Capacity.

Code: http://pastebin.com/nLK3PCAC

New Features
  • Only one Programmable Block is now needed for all Cargo Displays
  • The output can now be modified

How to Display you Cargo Capacity
  1. Load the Script to a Programmable Block.
  2. Create a Group with an Antenna or Beacon (Antenna is preferred by the script) as Display and the Blocks you want to display its inventories.
  3. Add this Line Groups.Add("Your Groups Name"); to the Main() Method above doDisplay. Just like the existing Line, you may remove it. You can add as many groups as you want.
  4. Set up a Timer with the time you want to refresh.
  5. Add as Timer-Actions: The Programmable Block with "Run". And the Timer itself to be executed.

Additional Config - if you want to
Change the Output Templates
Template Defaults defined in BMyInventoryCollectionShow somewhere around line 270

Parameter and Values:
template
{GroupName} replaced by: The Name of the Group
{Items} replaced by: computed contend of the item* Templates

itemTemplateSingle, itemTemplateIncoming, itemTemplateOutgoing
this templates will pre generated for each Container/Block
itemTemplateSingle: used if there is only on inventory (like in cargo containers)
itemTemplateIncoming, itemTemplateOutgoing: used for Blocks with multiple inventories (Reffinery, assembler, ..)
{CustomName} replaced by: the Blocks custom name like "My Ore Container"
{Percent} replaced by: well formed percent of current capacity
{curVol} replaced by: current used Space in
{maxVol} replaced by: overall capacity
{isFull} replaced by: templateIsFull when current Volume is over 99%

Change accuracy of the percentage displayed

look for String.Format("{0:N0}", inventories[ i ].getIncomingInventory().getFillLevelInPercent()) there are 3 different, one for each itemTemplate**.
Change "{0:N0}" to "{0:N1}" and getFillLevelInPercent() to getFillLevelInPercent(1) to show one decimal in the percentage. You could change it to other numbers to, but these two used to be the same.






3 Comments
Volg 14 Jan, 2015 @ 2:22pm 
wow very odd.. i have that pack loaded and have never seen them... guess ill go look again.
DasBaconfist  [author] 14 Jan, 2015 @ 2:13pm 
Volg 14 Jan, 2015 @ 2:09pm 
in your screen shots it look slike you have some custom conveyor blocks...

Are those up on the workshop any where?