Space Engineers

Space Engineers

Cargo Utilization Light v2.2
69 Comments
Dots 22 Feb, 2023 @ 4:19am 
wil this script ever finish updating?
Derzuel 5 Oct, 2022 @ 3:16am 
would it be possible to add an option to not change the On / Off state of lights being used by the script? I've got a collector ship that's using a spot light as an indicator and it would be nice if it would stay off when I don't really need it.
Jared_T  [author] 11 Feb, 2022 @ 10:41am 
@Schmetterling
Thanks for letting me know about the bug, but I am not sure what the problem is. I have been busy with school, so I have not played with the lights in the DLC content yet. I will look into it as soon as I have some free time.
As for the adding additional inventory, I apologize, the "| string[] cargoIncludeList = {"Container" , "Connector" }; |" is a depreciated command, and I never got around to updating the comment section. All you need to do is in the "Custom Data" go to the section for "-= CARGO_INCLUSION_LIST =-" look for the line starting with "Cargo = " and add the connectors, and cockpits. I should look like this when done, "CARGO = Container, Connector, Cockpit".
Schmetterling 10 Feb, 2022 @ 7:21pm 
Great job, author. The script works just fine, but it doesn't support lights from Wasteland DLC. More precisely, they initially change to green and they blink, but as inventories are filled with ore, they do not change. Standard lights work fine. And it's still not clear how to add additional inventory, such as the Connector and Cockpit. Specify where to add the line "| string[] cargoIncludeList = {"Container" , "Connector" }; |" , in the code itself or in "Custom data".
Schmetterling 10 Feb, 2022 @ 7:21pm 
Прекрасная работа, Автор. Скрипт работает просто отлично, но не поддерживает огни из DLC Wasteland. Точнее они вначале изменяются на зеленный цвет и они моргают, но по мере заполнения рудой инвентарей они не меняются. Стандартные огни работают нормально. И еще непонятно как добавить дополнительные инвентори, такие как Коннектор и Кокпит. Уточните куда нужно добавить строку "| string[] cargoIncludeList = {"Container" , "Connector" }; |" , в сам код или в "Custom data".
Azariasz 27 Sep, 2021 @ 11:26am 
@Jared_T
Ok, now I do feel like a dolt. Just needed to read "the manual" XD Thank you for your reply.
Jared_T  [author] 23 Sep, 2021 @ 9:37am 
@Azariasz
First go to the programmable block and in the Text_Panel_Identifications section find the CockpitScreenID and set the number inside the [] to the screen you want. The script cannot restore the screen after it has changed it, so setting the number before tagging the cockpit is easiest. Or at the very least look and memorize what is on the screens in the cockpit, so you can put them back if you do not like the screen the script uses and decide to change it later. Then just rename the cockpit by putting the tag [Cargo Info] into the name of the cockpit.

Hope that helps.
Azariasz 22 Sep, 2021 @ 1:12am 
Kindda similar question to the assimilater's question - How do I put the image from the programmable block running this script ona LCD in a cockpit? I read the MMaster's manual, but I can't make heads or tails out of it. Is there a simpler way? Or one that is dolt-friendly? XD
assimilater 28 Jan, 2021 @ 3:16am 
@Jared_T You're awesome dude!
Jared_T  [author] 27 Jan, 2021 @ 6:37pm 
@assimilater
Sorry for the late reply, I was doing some maintenance on my computers water cooling, and I had neglected it for too long and it was in bad shape. But I am back up and running now, anyway, I guess I do not have the LCDs documented well.

You need to put the tag [Cargo LCD] into the NAME of the Display Block. After that, the script should load the settings into the custom data. If the script does not load the Custom Data, just clear everything from the custom data and it should load LCD default settings.

assimilater 25 Jan, 2021 @ 4:47pm 
I got some interior lights working but I'm confused on how to get LCDs working...I added [Cargo Info] to the LCD's custom data but it just shows as offline. I checked the scrips menu in the LCD's control options, but I don't see anything special there for the cargo lights. I tried changing the custom data for the LCD to the group name I was using {Cargo Lights} and still nothing. I tried adding the LCD to the {Cargo Lights} group and still nothing. I also was trying all these things for both flight seats and control seats and nothing for them either.
assimilater 25 Jan, 2021 @ 4:31pm 
@Jared_T Thanks, got around to trying this again and your video helped me. I had enabled experimental mode but hadn't enabled in-game scripts in the world settings
Jared_T  [author] 15 Jan, 2021 @ 10:07am 
@assimilater

Isy has a good walk through of how to enable scripts in SE, so check it out.
https://www.youtube.com/watch?v=NkhZ7BbYgvc

Once you have subbed to my script it will be in the list of scripts you will be able to load into the programmable block.
assimilater 14 Jan, 2021 @ 5:41pm 
Can anyone explain to me how to use this? I've been playing 100% vanilla up to now. I enabled experimental mode but don't see this in the mod list...Steam updated my game after I subscribed to it but idk how to use it...
Martin Astos 14 Jan, 2021 @ 12:17pm 
Good day,

This is a brilliant mod, thanks so much.

Would it be possible to make a version that does the same for batteries? There are tons of screen based battery status scripts but sometimes a set of lights would be best.
Jared_T  [author] 6 Jan, 2021 @ 5:02pm 
@neongr78
After some quick testing to verify, Yes it does support control seats. Just use the [Cargo Info] tag the same as with any other cockpit.

@andywht
I was only able to replicate the error once, but after reloading the script into the programmable block to make sure I had the latest version, the error was corrected. After a few hours of testing the Flight Seat screen has been updating for me just fine.

@holden4ever
Uploaded to mod.io on Nov, 26 2020
https://spaceengineers.mod.io/cargo-utilization-indicator
neongr78 5 Jan, 2021 @ 11:35am 
does it support control seats?
andywht 25 Nov, 2020 @ 10:12pm 
Great script - use it a lot! After last update there's an issue. Script is not updating flight seat screen, I have to grind it below hack and weld, then it shows correct levels, but not updating. On LCD and PB it shows fine. Could you fix this please?
holden4ever 13 Nov, 2020 @ 1:14am 
There are 15 scripts so far including some of Isy's best ones and I'm pretty sure they just work without any extra work needed. Hopefully you can add it.

https://spaceengineers.mod.io/?filter=t&tag%5B%5D=ingameScript
Jared_T  [author] 12 Nov, 2020 @ 10:02pm 
@holden4ever
I will look into it, but I do not have SE on Xbox nor do I even own an Xbox. Therefore, even if I can just upload it to mod.io and have it available for the Xbox platform, I have no way to do any troubleshooting for any Xbox platform related issues that may arise.
So long story short, I will look into it, but I doubt it.
holden4ever 12 Nov, 2020 @ 2:32am 
Any chance you could add this to mod.io so Xbox users can use it with dedicated servers?
Jakaya 5 Nov, 2020 @ 3:25pm 
Hey Jared, That sound amazing i am more than happy to wait as i expect coding something like this myself make take me a significantly greater amount of time than your stating you could do it in i appreciate you have a real life so eagerly await news. :ChipWink:
Jared_T  [author] 5 Nov, 2020 @ 10:21am 
@Jakaya
I will look into it, I have made a script to do that before for one of my own builds, so I will see if I can find it. If it turns out to be to incompatible with this version of the Cargo Light script I may just upload a new Gas Utilization Lighting script to steam.
However, it will take as little bit of time as I will have to fit it in between school and work, so it may take me a few days to code something up.
Jakaya 4 Nov, 2020 @ 2:15am 
Hey Jared, Great script have used it for a long time now im just working on a new project and wanted something like this script but for hydrogen storage tanks so rather than green when empty green when full then goes red the more empty the storage tanks is this possible and if so would it be hard for someone with no coding knowledge to modify this to enable that behaviour ?
Jared_T  [author] 10 Sep, 2020 @ 1:36pm 
@Skullbearer
That is a generic error thrown out by the Space Engineers API, and could refer to a lot of things. Without having a look at your ship, it might be a bit hard to diagnose the problem.
Skullbearer 9 Sep, 2020 @ 3:49pm 
normally works perfectly for me, I especially love it for my grind ship. On a new grindship I get
"Caught exception during execution of script:Object reference not set to an instance of an object.
at Program.K()
at Program..ctor()"

I have tried with the spotlight named "Cargo Light" and putting it into a group named "Cargo Lights" and "[Cargo Lights]"
Quickshadow10m 6 Jul, 2020 @ 12:46pm 
Nice Idea!
Jared_T  [author] 5 Apr, 2020 @ 12:29pm 
@Effenheimer

Sorry for taking so long to get this done. I had an issue with my Visual Studios and it ended up requiring reinstalling the Operating System to get it working again.

I have made changes to the LCDs so that if both Font and Background color is set to True, then the LCD will just be a colored panel.

Also added the Color modifications. See update notes for details.
Effenheimer 21 Mar, 2020 @ 9:13am 
No worries about the extra light. Its easy enough to create a hidden one, group it, and turn that light off individually and the rest of the group will still work.

For the Font and Background, I already set both to true. At a distance, they blend to be seem-less but closer up the font stands out just slightly to make the screen look pixilated. I tried your advice of switching the content to "Script" but the programmable block instantly flips it back to "Text and Images".

Keep up the good work, sounds like your next script is going to have some good stuff.
Jared_T  [author] 21 Mar, 2020 @ 8:53am 
@Effenheimer

At the moment having multiple configurations linking individual lights or LCDs to specific containers would require a lot of re-coding, or a programmable block configured for each set of light and cargo blocks. I would have to think about whether or not it would be a good idea to rewrite this script as I am already working on a new indicator script that would do that, but the new script will likely have to wait to be finished until after the school semester.

I would like for my indicator script, if I ever get it finished, to be able to use lights or LCDs, and for example if a player places a LCD or light on a functional block, then it can automatically pair with the block and give information on the blocks status. There are a whole lot of other features I need to work out, but that is the basics. However, as I said it is a long way off, and the current script will not, and likely will never, be able to do what you asked.

Sorry.
Jared_T  [author] 21 Mar, 2020 @ 8:42am 
@Effenheimer

I am not sure, but I think if you set the Font color to True and the Background color to True then they should blend into a single color. However, I have not tested that so I do not know for sure, I will look into it. There may also be a simple way of doing this by setting the LCD Content type to “Script”, and then set the script to “none”, then letting the script change the Background color. However, I will have to look into that and make some changes, as at the moment those settings are not allowed by the script. I also have to think about what is easiest for the player, perhaps I should just have it go into that mode automatically if the player sets both the Font and Background colors to true.
Jared_T  [author] 21 Mar, 2020 @ 8:40am 
@Effenheimer

Thanks for using the Script.

Unfortunately, as it is a "Lighting Script" I felt that requiring the use of a light was reasonable. Also before I added LCDs, if you did not have a light the script was basically broken. And at the moment I have no plans to make the lighting block optional. However, you should be able to set the intensity and radius to 0 and the light block will not emit any light.

The custom colors option should be doable. I have already written the code for that with another script and I believe it would be simple enough to transplant it into this script. It would allow the player to set the color either by Color Name, RGB, RGBA, or HSV depending on player preference. I should be able to implement this sometime this weekend.

Effenheimer 21 Mar, 2020 @ 6:35am 
Ah, one more thing I forgot. Custom colors. Adding a way we can input values to the custom data and we can use that to match our existing craft's lighting scheme.
Effenheimer 21 Mar, 2020 @ 6:34am 
Great script!

A couple of things though;
I couldn't get the script to function until I added at least one light to my group of LCDs I wanted to use. On my current build, I don't want to use an interior light at all, just LCDs.

I'd like for those LCDs to be a single solid color rather than text on a color. I changed background setting to True but you can still see the text at a close distance.

Also, any chance for adding the ability to link individual lights to individual containers? If you use a cargo sorting script, it'd be great to know when what type of cargo is getting full.

Again, great script!
Jared_T  [author] 2 Feb, 2020 @ 9:22am 
@Arstraea

Sorry for the late replay, the college semester is now in full swing and I have to prioritize homework. Anyway, I have reworked the cockpit interfaces, so they can be set to either "Script" or "Text and Image". The Script setting should show a graphic display, and the text will display the text based display.
Arstraea 29 Jan, 2020 @ 4:57am 
Good day!
I updated my PB and it seems works wrong.
I tagged my cockpit, and change the CustomData in the PB that displaying information to "2" screen at the Industrial Cockpit. (Top-right screen)

Then, PB changed screen's setting to "Script" and "None".
I can only see the "Bluescreen" and can't change it to "Text" manually.
Carl99 28 Jan, 2020 @ 1:25pm 
Spent the day using it. Works perfectly. Thank you :).
Jared_T  [author] 27 Jan, 2020 @ 12:20am 
Just uploaded a new version, give it a try.
Carl99 27 Jan, 2020 @ 12:19am 
Cheers, if you still need the blueprint let me know.
Jared_T  [author] 26 Jan, 2020 @ 2:20pm 
@Carl99
I was able to recreate the error you described, and I think I have it fixed. I will run more tests after I get home from work.
Jared_T  [author] 26 Jan, 2020 @ 9:58am 
@Carl99
Sorry, I guess that error message is a bit vague. I had hoped that when a player saw that message they would know to look at the Custom Data of the LCD monitor. But that is unclear from the message, so I apologize. Therefore, in order to get the screen to work just change the setting in the LCD's Custom Data.

If you can send me a blueprint of your grinder ship, that may be the best way to track down your issue. Thanks
Carl99 26 Jan, 2020 @ 5:50am 
It's actually a grinder ship but yes and no. The number of tools listed by the script in the lower right corner of the k screen for the programmable block matches, (i even tried setting custom names for everything in both the blocks and the custom data section so it would only be able to see those specific blocks), and there's no duplicate entries in the i screen or on most of the G screen, except for the block tools screen where it lists the option to also put a welder on my hotbar. But if i do that it's grayed out just as it would be where the block not present.

Screenshot of the K screen so you can see an example of the wierdness:

https://i.imgur.com/ydLhjmu.jpg

Also got the LCD sort of working, i hadn't included the parenthasese in the name. However it then gives me an error about a missing setting thats not present in the custom data screen. Screenshot again

https://i.imgur.com/uEwC1iR.jpg

Hope this helps you track it down.
Jared_T  [author] 25 Jan, 2020 @ 10:38am 
That is interesting. I sort of sounds like you may have duplicate or missing drill entries. Does the drill count match the actual number of drills on the ship?
As for the LCDs have you added the tag [Cargo LCD] to the name of your LCDs?
Carl99 24 Jan, 2020 @ 10:07am 
Further note, may be related to the tool being on the other side of a rotor, (large grid tool on small grid ship, i had to give it a custom name and add that to the tools list to get it to pickup the tool).
Carl99 24 Jan, 2020 @ 9:53am 
Update, got a sudden hunch after spotting somthing and tried increasing the tool fill percentage for the blink level from 80% to 120% and instead of blinking at 40-somthing percent full it started doing it at 60 something percent. Looks like the script is doubling the actual filled percentage on tools for the overall cargo percentage calculation.
Carl99 24 Jan, 2020 @ 9:32am 
Running into an issue where despite setting up the include tools option, (and the script properly listing it in the little summary in the bottom right of the programmable block K screen), as soon as the cargo exceeds the stated cargo percentage it says i'm full. Also LCD's are completely non-functional for me so i can't use a big LCD with the info on to work around it.

Note that the K screen info on the programmable block IS correctly listing the cargo flil % of everything, it's just not transferring this to the light group properly.
Arstraea 20 Dec, 2019 @ 12:04am 
Thank you! I really love your script well and it makes my worker ship better in survival.
Please keep this script up! :)
Jared_T  [author] 19 Dec, 2019 @ 8:23pm 
@Arstraea
Hello once again! That would take a bit of time, but I will look into it. I believe that the cockpit surfaces are controlled the same way as a standard LCD, so it may not be that hard.

@CovertJaguar
I have implemented the sub_grid option, and have redone the cargo block initializations. Just a bit of warning with the current settings there is a chance of having duplicate entries. For example, if the List option contains “TOOLS = Drill, Welder, Grinder, Miner Drills” then assuming the group “Miner Drills” is for the same grid as the PB. Then “Drill” and “Miner Drills” will likely have the same list of Drill blocks. I would suggest that in such situations just go with the Group “Miner Drills” and replace the “Drill” entry.
CovertJaguar 17 Dec, 2019 @ 12:07am 
No worries, I was able to tweak it for my purpose so I'm happy. If it gets a second look though, that's great!
Arstraea 15 Dec, 2019 @ 8:34am 
Glad to see you again, Jared_T! :D

I noticed that red alert isn't blinking and feels happy because you recognized this issue already!
If you have a enough time... I hope that LCD information (displayed at the PB) could also configure or assign to other display likes Cockpit. That information is quite simple and good to check the status! (I currently used Automatic LCD2 for display information by Debug string of PB)