Space Engineers

Space Engineers

Power Control Program v1.1
146 Comments
boblefurieu 30 May @ 2:58am 
This script is broken
aaronlukemarshall 12 May @ 3:07am 
This script is now broken in check code. power producers have changed in the vrage code
raz334 4 Dec, 2024 @ 2:02am 
BROKEN, gives errors when attempting to issue a command. Fails to perform without a command.
CD.Cobra(fr) 25 Nov, 2023 @ 3:41pm 
Hello and thank you for this superb script.
Would it be possible for this to also be translated into French?
I tried to do it on my side by changing the German part but it doesn't work.
A language switcher, perhaps!
1 English
2 German
3 Spanish
4 French
AlfRomeo80  [author] 1 Oct, 2022 @ 1:36pm 
The script is build at a time without safezones. Sadly I have no time to update the script at the moment!
Sadiq Azeem 29 Sep, 2022 @ 4:05pm 
when i use safezone it doesnt realize how much it consumes, so should try using reactor and batteries and having a safezone, it will switch off the reactor and keep the batteries on, the problem is the batteries dont have enough power to keep the safezone. I think it dont understand how much safezone eats in power
Asguard 4 Sep, 2022 @ 7:10pm 
the script does not auto update anymore i add two batteries hit recompile and run there was like 5 error messages.
SuperKami 12 Aug, 2022 @ 12:14pm 
@alfromeo80 lmao, I figured it was just too much. Really great script man, I love it <3 thanks for the reply!
AlfRomeo80  [author] 11 Aug, 2022 @ 1:41pm 
@SuperKami There are several limits to the scripts in Space Engineers. But i can't tell you the amount of blocks you can control with this script. I've never tested the script with such large grid like yours. The amount of problems the code runs into with such large grids is more than painful. The complexity of my script with me missing every background of coding, I'm sorry to tell you I can't imagine a way to handle your case.
I wrote the scipts to learn how coding works, but i never expected such a resonance.
SuperKami 11 Aug, 2022 @ 11:32am 
@alfromeo80 I have added about 400 solar panels to my grid, when I go to recompile the script it crashes the game. Is there a limited number of items it can control? great script tho
Zephyroku 27 May, 2022 @ 2:48pm 
Holy shit, this is a masterpiece!
AlfRomeo80  [author] 26 Mar, 2022 @ 5:48pm 
Thank you, @McDewgle. A few days ago there was a discussion about his topic on my discord. You can enter the discord by this invite: https://discord.gg/2a52ftDyXX
McDewgle 26 Mar, 2022 @ 10:18am 
Love your script! Just started using it today and immediately subscribed to H202 and Room Control programs as well.

Question though, have you added an ability yet to distinguish between the grid the program block is attached to vs connected ships? Right now I can see the reactors of every vessel currently docked to our station which makes things a bit difficult!
AlfRomeo80  [author] 21 Feb, 2022 @ 1:13pm 
Hi @vthor.

I really appreciate the work you've done. I think the easiest way would be to upload the individual translations to my Discord. You probably only translated the upper "Settings" area. The script code itself remains unchanged. So you can make this top section available there as .txt for everyone.

What do you think about the idea?
Gravitylane 20 Feb, 2022 @ 5:35am 
Great job.Nice script does what it's supposed to. It's a bit tricky to set up, but once you've done it. Then it works perfectly. It's really fun to use
vthor 18 Feb, 2022 @ 5:27pm 
Hola y gracias por tu gran trabajo, quería comentarte que yo no soy muy bueno en los idiomas y con la ayuda de traductores, mas un poco de trabajo he traducido el script al español, quería preguntarte si me das tu permiso para publicar tu script en español o pasarte el script y lo publicas tu yo no tengo ningún problema en esos temas, la decisión te la dejo a ti, espero recibir una respuesta gracias de nuevo, att vthor.

Hello and thanks for your great work, I wanted to tell you that I am not very good at languages and with the help of translators, plus a little work I have translated the script into Spanish, I wanted to ask if you give me your permission to publish your script in Spanish or pass you the script and you publish it I have no problem in these issues, the decision I leave it to you, I hope to receive a response thanks again, att vthor.
rottielover 18 Feb, 2022 @ 8:49am 
Never mind I found the setup youtube video, the only thing I can't figure out is the commands for activate all and deactivate all on (buttons 8 and 9) on things like the battery screen. The comments have the rest of the commands but I am not sure if I'm supposed to put "changeStatus=BatteryBlock" in both of those slots?
rottielover 14 Feb, 2022 @ 3:46pm 
Can someone make an infographic on how the control bar in a cockpit should be setup (and maybe one for a button panel setup)? I managed to get the script installed and I built a regular cockpit, I got that working by putting "@PowerControl" into the custom data, then I started trying to setup the control bar. I dragged the program block Icon down to the list and used Run and typed in menu=1 etc, that swaps the menus. I manged to get one setup with "changeStatus=manualControl" to get the system into auto mode, but I'm not quite sure about the other commands and how the bars should be setup conceptually? Am I supposed to use Slot 1 on Control group 1 for Menu 1 and then slot 1 Control Group 2 Menu 2 etc. ??

I'm also unsure about the "selection=" values to use? 1 to select -1 to deselect ?
Snowman266 4 Oct, 2021 @ 1:56pm 
Any chance this can work with Industrial Overhaul mod , and the difrent engines you have there.
Degrath 22 Aug, 2021 @ 4:23pm 
Awesome program, a must have for my game for sure
DigitalVagrant [ZF] 7 Aug, 2021 @ 4:59pm 
Any chance this can be gotten working with modded reactors?
Surprise1TsMe 22 Jul, 2021 @ 2:36pm 
Hey alfromeo80,

I really love you power control program, it was a bit hard to get into, but once I figured out how to use it it worked like a charm!
I do have one issue though, I sometimes play with some friends, and they can not see the screen updating if they themselves are using the control station. For example, if they want to change from the solarscreen tot the batteryscreen, they can do it, but they will only be able to see it has changed once they leave the control seat. Meanwhile I can see everything fine.
Anyways, mayby you are aware fo this issue and are working around it. (I believe you were rewriting this script based on your experience with you H2O2 program) Or perhaps it can not be fixed.
I hope you are well and am looking forward to your answer!
AlfRomeo80  [author] 19 Jul, 2021 @ 1:59pm 
I think I mixed some scripts. The Power Control script doesn't have the same logic the other two have. So the cockpit line does not exist in this script. All screens are updated the whole time.
The line should be ignored by the script, but have you tested the script without the cockpit line?

I made a small test right now. Loaded a world without scitps, build a control seat, loaded the script to a programmable block, entered "@PowerControl" to the custom date field of the control seat, opened the G-menu, entered "changeStatus=manualControl" to abutton and it works.
Deadmeat 14 Jul, 2021 @ 6:41am 
Alfromero
Thanks for the great script, I do have a question, I am unable to get the "G" menu arguments to run from the control seat, I think this has to do with the control screens not updating as you suggested on 19 apr, I want to make the suggested change however I can not seem to figure out where to put the control seats name (power control seat) in the custom data fields. This is what I have put in and it does not seem to work:
@PowerControl
Large Display=mainScreen
Top Left Screen=instructionsScreen
Top Right Screen=windTurbineScreen
Bottom Left Screen=NONE
Bottom Right Screen=h2EngineScreen
cockpit=power control seat

Can you point me in the right direction ?
rientelfon 21 Apr, 2021 @ 4:14pm 
Nevermind, I had all my batteries set to recharge mod and they needed to be on auto.
rientelfon 21 Apr, 2021 @ 3:57pm 
everytime i turn on automatic power control my base loses all power, what am i doing wrong?
Tanker 20 Apr, 2021 @ 9:59am 
Not sure what happened but it just started working perfectly again one day. I've not changed a thing to the control area of my base but thanks again for this amazing script
AlfRomeo80  [author] 19 Apr, 2021 @ 5:27pm 
Hi and thank you for your kind words.
To increase the performance of the script its only updates the screens if a player is near the screens. The detect the players the script uses sensors. If you are inside a sensor detection area and you enter a cockpit or control seat the game doesn't detect the player anymore. It's the same behavior as you would leave the sensor area.
To fix this the settings at the Coustom Field of any screen have an entry for sensors to detect the player and update the screens and an entry for cockpits.
So if you are inside a cockpit or control seat any display you can see from this position needs to have the seats name entered at the entry "cockpit" of the Custom Data Field.
Then the screens would get updated even if you are inside a cockpit or control seat and the sensor of the room doesn't detect you anymore.
Beastion a.k.a der Nobbi 19 Apr, 2021 @ 2:47pm 
Thanks for sharing the script with us!

I have just set up the script according to your instructions.
Now I found out that the buttons I assign with the commands work but the visual effect only changes when I get out of the cockpit.

as an example:
* selection=1 - select next object

the marker around the selected battery changes only when I get out of the cockpit, as long as I don't get out of the cockpit nothing happens.

Is this a known problem? is it perhaps because I play on a dedicated server?
odin1243 14 Apr, 2021 @ 6:42pm 
Love this scrit special display make for noce engineering room
Tanker 29 Mar, 2021 @ 6:34pm 
Been using this script for awhile now but the last few days I've not been able to use commands from a cockpit/command chair. I can hit the button but I have to get out of the seat to see an update on any screen. Using button panels as a work around. I've removed the script and put ti back. even rebuild the base its on and still has that issue. any tips that would point me in the direction of fixing it would be great
sniek 28 Mar, 2021 @ 7:06pm 
probably one of the best scripts out there! cheers mate
The Flesh Tube 23 Mar, 2021 @ 1:40pm 
Jesus, this is a God-Tier script right here. Absolutely amazing, thank you! Keep up the great work :D
CombatJoe 8 Feb, 2021 @ 4:53pm 
these screens look so wonderful, and setup was easy. Thanks for making this!
Compukit 3 Feb, 2021 @ 1:49pm 
whel i agree whit hindsigt2020 its a great scrip whis i coud make somting like that bad the only way how i coud make a script is using some cind of blok builder that makes scrips :)
Hindsight2020 1 Feb, 2021 @ 9:47am 
@Alfredomeo80 That is what I ended up doing it had the same effect, you have made a great script maybe this could be a feature in V1.2.
AlfRomeo80  [author] 1 Feb, 2021 @ 7:37am 
No, in this version you can not ignore blocks in auto mode. Perhabs you can use some batteries without the grid name in their names. Then the script wouldn't use them, but of course you won't see them at the displays or at the overall power status.
Hindsight2020 31 Jan, 2021 @ 5:48pm 
Is there a way to ignore certain generators or batteries? I am finding it's turning my ships batteries to auto instead of leaving it in recharge when in automatic mode.
Compukit 29 Jan, 2021 @ 7:26am 
wel if i use more then 360 batterys the program stops whit working dont now if it is bekos it can not show anny more on the svreen
a made a littel test rick whit the 360 baterys i shal rebuilt it whit venila baterys and solar cels ant post it when im back to morow avning :)
AlfRomeo80  [author] 29 Jan, 2021 @ 7:08am 
As you sad is the screen the problem? With more than 360 batteries the calculation of the symbol size and aragement takes to long for the game. But you can't see any details with this amount of batteries, are you?
Compukit 29 Jan, 2021 @ 6:45am 
a made a counting erro its 360 baterys :)
Compukit 29 Jan, 2021 @ 6:38am 
the program can handel up to 300 baterys :)
Compukit 28 Jan, 2021 @ 6:20am 
a oke so long if i dont use anny battery screen the program whil run :)
Compukit 27 Jan, 2021 @ 6:42am 
wel when i recompile it it only runs 1 cycel en i think its not runing even that it runs til a sertent point. bad i am loking out for youre nieuw program :)
AlfRomeo80  [author] 27 Jan, 2021 @ 5:58am 
Ok, that's a lot. Missing experiance with this big grids, but I know after a certain number of loop runs the game interupts script to avoid them running in a loop to infinity. Could be, that if the script di some operations over all batteries the game asume that the script won't leave the loop and stops it.
The error message "To complex" is the common error message after this behaivior.
Compukit 27 Jan, 2021 @ 4:35am 
o the are in groups i can give you the bleu prints (its from my base bad i stil ar werkin on it bekos space engeneers gets verry laggy building my base)
Compukit 27 Jan, 2021 @ 4:33am 
for the erro script execution terminated script is too complicated pleaqs edit or rebuild the script i got this and i am using i think a litel as 1000 modid batterys can by more can by les :)
AlfRomeo80  [author] 27 Jan, 2021 @ 4:04am 
I don't have a number for you, but I think the symbol size calculation can cause problems with to many blocks.
I've started developing a complete new version of this with some improvements. A suggestion at one of the other script was to include groups. I'm going to try to handle group of blocks as one block. Then I can imagine only showing one symbol summerizing a whole group of blocks.

For the current version: What is a lot? :D And do you get an exception shown at the programmable blocks info box?
Compukit 27 Jan, 2021 @ 3:46am 
how many batterys can the script handel ? (i got a lot and the script keeps on crashing)