Space Engineers

Space Engineers

Battery Status Script V.1.1 [Vanilla] - Lightwolf Adventures
167 条留言
V_V1P3R_V 2024 年 8 月 29 日 下午 9:53 
@SWeaver
Could you do the Hydrogen one as well?
Star 2024 年 3 月 3 日 下午 6:48 
unofficial update version https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=1687643514
working as of March 2024
L 2024 年 1 月 6 日 下午 8:47 
plz update i love this script very helpful
NorimaR 2024 年 1 月 6 日 上午 10:10 
not work
Program(1349,23): Error: 'IMyTextPanel' ***
Program(1351,23): Error: 'IMyTextPanel' ***
Captain Lone Wolf 2023 年 12 月 29 日 下午 3:06 
Grüße, heller Wolf, das Batteriestatusskript V.1.1 ist jetzt veraltet
Boom111222 2023 年 12 月 17 日 下午 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 2023 年 12 月 11 日 上午 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 2023 年 11 月 26 日 上午 12: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 2023 年 10 月 26 日 上午 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 2023 年 10 月 14 日 上午 10:10 
Same problem here, hope it get fixes soon by the developer
AH-64Delta 2023 年 10 月 11 日 上午 1:49 
Yeah, as HerzogVanRossman said, I am getting that same error as well. Maybe keen has changed some things?
🐾Hyperiol🐾 2023 年 9 月 25 日 下午 1: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 2023 年 9 月 15 日 下午 7: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 2023 年 9 月 12 日 上午 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 2023 年 9 月 10 日 上午 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 2023 年 9 月 8 日 下午 10: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 2023 年 7 月 8 日 下午 1: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 2023 年 3 月 22 日 上午 9:42 
and no worries with deprecate code. It will compile anyway.
IsrA 2023 年 3 月 22 日 上午 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 2023 年 3 月 17 日 下午 2: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 2022 年 12 月 11 日 上午 1:42 
Könntest du dein video auch auf deutsch machen, Bitte!! und was bedeutet der Pfeil hoch aufm LCD bei einer Batterie??
RakWar 2022 年 7 月 29 日 下午 4: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 2022 年 7 月 29 日 下午 4:12 
thank you for sharing
Simplexxity 2022 年 7 月 19 日 上午 10:11 
ok so im new to space engineers with the lcd stuff, where do I find the script
[ZD] Jobey 2022 年 3 月 24 日 上午 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 2022 年 3 月 19 日 下午 9:55 
Works perfectly fine for me
Cyravehl 2022 年 3 月 15 日 下午 1:08 
Re post by GimpVet: Same here, will not compile.
Kloud77 2022 年 2 月 4 日 下午 1:42 
Seems to be not working, caught exception referencing a block, or similar, won't run for me.
BloodyFinger 2022 年 1 月 4 日 上午 9:59 
Can you pls update this on?
Missath 2021 年 5 月 22 日 下午 9: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 2021 年 1 月 16 日 下午 10: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 2020 年 11 月 11 日 上午 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 2020 年 8 月 29 日 上午 6:52 
leider funzt der mod in der aktuellen version nicht mehr. schade ansich
ArrIvvA 2020 年 8 月 28 日 下午 1:21 
will it run on cockpit lcd?
armablign 2020 年 8 月 25 日 上午 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 2020 年 5 月 24 日 上午 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 2020 年 5 月 17 日 下午 9:50 
Mako 2020 年 4 月 27 日 上午 9:21 
This does not appear to work any loner. Has a lot of exceptions when compiling.
SavedByChrist 2020 年 4 月 1 日 上午 9:16 
won't run on the programmable Block's LCD. works on regular LCDs
Uniform300 2020 年 3 月 23 日 下午 2:48 
Help I want a good battery status script but this one says "exception caught" and wont run
TafaleZ 2020 年 3 月 20 日 上午 11:17 
been good script but broken now
WDForty 2020 年 2 月 18 日 下午 8: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 2020 年 1 月 20 日 下午 3: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 2020 年 1 月 19 日 上午 7:15 
DMOrigin's rewrite/patch throws no errors, but outputs nothing either
Tiger 2020 年 1 月 18 日 下午 3:26 
Completely broken as of the current game version
Nirahiel 2019 年 12 月 25 日 上午 9:38 
I'd like to know how you do this, I want to make my own fancy LCD display script
Pegas519 2019 年 12 月 23 日 下午 5: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 2019 年 9 月 15 日 上午 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 2019 年 8 月 6 日 上午 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 2019 年 7 月 22 日 上午 12:18 
Take your time buddy, modding spends a lot of our free time :)