Space Engineers

Space Engineers

Battery Status Script V.1.1 [Vanilla] - Lightwolf Adventures
167 kommentarer
V_V1P3R_V 29. aug. 2024 kl. 21:53 
@SWeaver
Could you do the Hydrogen one as well?
Star 3. mar. 2024 kl. 18:48 
unofficial update version https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=1687643514
working as of March 2024
L 6. jan. 2024 kl. 20:47 
plz update i love this script very helpful
NorimaR 6. jan. 2024 kl. 10:10 
not work
Program(1349,23): Error: 'IMyTextPanel' ***
Program(1351,23): Error: 'IMyTextPanel' ***
Captain Lone Wolf 29. dec. 2023 kl. 15:06 
Grüße, heller Wolf, das Batteriestatusskript V.1.1 ist jetzt veraltet
Boom111222 17. dec. 2023 kl. 12:21 
Just to keep this at the top for people looking, Use Coffin Dodgers solution to fix the first error, and then to fix the obsolete error use IsrA's solution. BIG THANKS to both of them for their solutions.
Graeme 11. dec. 2023 kl. 9:41 
Tried Coffin Dodgers solution, get a new error message now about 332,15 and 333,15 saying my batterybloackonly regharge is obsolete, use chargemode instead. no idea what that means..!!
stunter740 26. nov. 2023 kl. 0:02 
for someone who doesnt understand scripts this doesnt work pls update the script .. i should be able to upload it to a programable block and then run it with very little changes
CelticDaemon 26. okt. 2023 kl. 6:42 
Mod works fine if you follow the isntructions for the LCD screens and make the adjustments to the script as per the instructions below from CoffinDodger and Isra. Bit of a pain but heh, it works.
L. Asmodeus 14. okt. 2023 kl. 10:10 
Same problem here, hope it get fixes soon by the developer
AH-64Delta 11. okt. 2023 kl. 1:49 
Yeah, as HerzogVanRossman said, I am getting that same error as well. Maybe keen has changed some things?
🐾Hyperiol🐾 25. sep. 2023 kl. 13:00 
When I try to compile it, it gives me this error:

Program(1349,23): Error: 'IMyTextPanel' does not contain a definition for 'ShowPublicTextOnScreen' and no accessible extension method 'ShowPublicTextOnScreen' accepting a first argument of type
'MyTextPanel' could be found (are you missing a using directive or an assembly reference?)
Program(1351,23): Error: 'MyTextPanel' does not contain a definition for 'WritePublicText' and no accessible extension method 'WritePublicText' accepting a first argument of type 'MyTextPanel' could be found (are you missing a using directive or an assembly reference?)
RuskyNineNine 15. sep. 2023 kl. 19:32 
first time running an in-game script in any of my worlds, have been looking to get something like this running for a long time, took a bit of playing around, some delving into the comments and a good few youtube videos but I eventually got the script running, looks wicked, works great, thanks heaps

thanks aswell to CoffinDodger and IsrA, I had no idea how to interperate those error codes, would have just had to keep scrolling through the workshop looking for a different script without your insight
SiderealPlague 12. sep. 2023 kl. 8:08 
Hey I was wondering if there was any way to make this work on a cockpits LCD? Any help would be appreciated.
CoffinDodger 10. sep. 2023 kl. 6:13 
As well as the changes posted by IseA below, you now need to go to the end of the script and make it look like this:


BatteryStatus_Lcd_X.SetValue("FontColor", new Color(LCDbright,LCDbright,LCDbright)); // White
BatteryStatus_Lcd_X.SetValue("FontSize", 0.10f); // set Font size of your LCD
BatteryStatus_Lcd_X.SetValue("Font", (long)1147350002);
//BatteryStatus_Lcd_X.ShowPublicTextOnScreen();
//BatteryStatus_Lcd_X.WritePublicText("", false);
BatteryStatus_Lcd_X.WriteText("" + str_AllBoundlis_001_To_178, false);
}
}
}// End of Main script
Swiftie 8. sep. 2023 kl. 22:49 
Seems to be broken since the newest update. I get a "assembly not found please compile script" error whenever trying to run it.
Teddy 8. juli 2023 kl. 13:08 
jo dein skipt mag nicht mehr laufen hab es mir auch erst gestern geholt kurz gegangen und seit heut schreit es laut nein keine lust mehr wen lieb wen du es updaten würdes auf die neuesten versonen :steamthumbsup:
IsrA 22. mar. 2023 kl. 9:42 
and no worries with deprecate code. It will compile anyway.
IsrA 22. mar. 2023 kl. 9:41 
To fix the obsolete things, replace with this part. I'm not an expert but it works.



bool batt_IsFunctional = false;
bool batt_IsCharging = false;
bool batt_OnlyRecharge = false;
bool batt_OnlyDischarge = false;
bool batt_IsOff = false;

ChargeMode batt_state_recharge=ChargeMode.Recharge;
ChargeMode batt_state_discharge=ChargeMode.Discharge;

if (batterylist_X.Enabled) {
batt_IsOff = true;
if (batterylist[i].IsFunctional) {
if (batterylist[i].IsWorking) {
batt_IsFunctional = true;
if (batterylist_X.IsCharging) { batt_IsCharging = true; }
else if (batterylist_X.ChargeMode==batt_state_recharge){ batt_OnlyRecharge = true; }
else if (batterylist_X.ChargeMode==batt_state_discharge){ batt_OnlyDischarge = true; }
//else if (batterylist_X.OnlyDischarge) { batt_OnlyDischarge = true; }
}}} else if (batterylist[i].IsFunctional) { batt_IsFunctional = true; }
xxx.514 17. mar. 2023 kl. 14:22 
He.. Hello? May I get gold shovel for diggin up ancient thing? Tryied to check this nice chunk of code but after 5 years of game development programmable block throws errors about obsolete things (line 332, 333 - IMyBatteryBlock.Only* says to change to 'ChargeMode', 1349 and 1351 IMyTextPanel.WritePublicText{string, bool} as depracted). I'll try to learn at your script If you allow, however maybe You will be faster of correcting it. Anyway thanks for such pprecious thing.
3dfxorchid 11. dec. 2022 kl. 1:42 
Könntest du dein video auch auf deutsch machen, Bitte!! und was bedeutet der Pfeil hoch aufm LCD bei einer Batterie??
RakWar 29. juli 2022 kl. 16:14 
Simplexxity they are in the script area and not the mod area .. search Utube and do a search on "space engineers how to enable scripts" easy to do just need to know where to find the button to enable them and then they will appear
RakWar 29. juli 2022 kl. 16:12 
thank you for sharing
Simplexxity 19. juli 2022 kl. 10:11 
ok so im new to space engineers with the lcd stuff, where do I find the script
[ZD] Jobey 24. mar. 2022 kl. 10:49 
If you read the message you get when you compile you will see its an warning NOT an error, the script works fine and compiles
Trindle 19. mar. 2022 kl. 21:55 
Works perfectly fine for me
Tkonian 15. mar. 2022 kl. 13:08 
Re post by GimpVet: Same here, will not compile.
Kloud77 4. feb. 2022 kl. 13:42 
Seems to be not working, caught exception referencing a block, or similar, won't run for me.
BloodyFinger 4. jan. 2022 kl. 9:59 
Can you pls update this on?
Missath 22. maj 2021 kl. 21:26 
Super useful. Is there any way to show the name of the battery? So that we can know which battery is in what status? Specially for when we connect vehicles to the base
[I.L]Methidox 16. jan. 2021 kl. 22:44 
i've had no luck running this on small grid. is it possible to set the script to such. would be great to keep an eye on my battery status in a small grid ship on the go
ChozoSR388 11. nov. 2020 kl. 9:10 
@ArrivvA That would be amazing if it does. Come to think of it, I wonder if it'll run on the small grid corner LCDs
thorusderwolf 29. aug. 2020 kl. 6:52 
leider funzt der mod in der aktuellen version nicht mehr. schade ansich
ArrIvvA 28. aug. 2020 kl. 13:21 
will it run on cockpit lcd?
armablign 25. aug. 2020 kl. 1:50 
Where is the string/line located where the strong/text is that describes the title? ("Battery Status")
(I want to add a custom title)
Khadrim 24. maj 2020 kl. 3:27 
It's good but once you get over 100 batteries it doesn't seem to support splitting the display over multiple screens?
Berean 17. maj 2020 kl. 21:50 
Mako 27. apr. 2020 kl. 9:21 
This does not appear to work any loner. Has a lot of exceptions when compiling.
SavedByChrist 1. apr. 2020 kl. 9:16 
won't run on the programmable Block's LCD. works on regular LCDs
Uniform300 23. mar. 2020 kl. 14:48 
Help I want a good battery status script but this one says "exception caught" and wont run
TafaleZ 20. mar. 2020 kl. 11:17 
been good script but broken now
WDForty 18. feb. 2020 kl. 20:12 
I was using this script in my game, and found some oddities with it. If you have have it set to only show tagged batteries, but have more than 20 batteries in your system, it will show small icons, even though you only have tagged less (e.g. 2). After some time poking around the code, I was able to make some changes to force the larger icons when I have fewer than 20 tagged batteries.

For anyone interested in how I solved this, on line 189, I changed "battAmountCount = 0;" instead of the grid's total number of batteries (batterList.Count);, then before line 200 I added a loop that counted the number of tagged batteries:

for (int i=0; i<batterylist.Count; i++)
{
if (OnlyBatteryWithNameTag) {
if (batterylist .CustomName.Contains(BatteryNameTag)) {
battAmountCount +=1; }
}
}

If you later decide you don't want to show tagged batteries only, I'm not sure, but you might want to undo the code changes.
DMOrigin 20. jan. 2020 kl. 15:27 
Has you tried it correctly? I'm testing it currently, and it works well. However, both versions are no longer being developed. However, there is a replacement. More about this will be available when the time comes, on the page of my version.
Tiger 19. jan. 2020 kl. 7:15 
DMOrigin's rewrite/patch throws no errors, but outputs nothing either
Tiger 18. jan. 2020 kl. 15:26 
Completely broken as of the current game version
Nirahiel 25. dec. 2019 kl. 9:38 
I'd like to know how you do this, I want to make my own fancy LCD display script
Pegas519 23. dec. 2019 kl. 17:58 
I do too, caught exception during execution of script (as per Magnusnordic's post below). This was introduced with the new holiday update. I would appreciate if you would update please.
Magnusnordic 15. sep. 2019 kl. 7:11 
hello i get an error with script in space it says "Caught exception during execution of script:Index was outside the bounds of the array. at Program.(Ylain[String argument, UpdateType updateSource) at Sandbox.Game.Entities.Blocks.MyPr ogrammableStock.oc Display:las s4 6_0 .<ExecuteCode>b IfYlyGridP rogram program)

at Sandbox.Game.Entities.Blocks.MyPr ogrammableBlock.RunSandboxedPro gramRction(Rction'l action, Strings response]

"
help
Dots 6. aug. 2019 kl. 8:08 
this script was revolutionary when it came out but now is dead and the so called fix only makes it work but not optimized. Script causes lagg and sim speed drops on lower end systems on current game builds.
Spartan 22. juli 2019 kl. 0:18 
Take your time buddy, modding spends a lot of our free time :)