Space Engineers

Space Engineers

103 个评价
Room Control Program v1.0
2
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
更新日期
355.615 KB
2020 年 12 月 27 日 下午 3:01
2021 年 1 月 19 日 下午 5:52
7 项改动说明 ( 查看 )

订阅以下载
Room Control Program v1.0

描述
This script provides you an alternative UI to control room pressures and doors instead using the K-menu.

You can use screens to monitor the rooms’ pressure and its vents and doors.

An automatic airlock, hangar and an door control are included.


With the Control Program scripts I want to create a way to build a real control room or bridge with consoles to control the whole ship or station. By using the included automatic resource management of the scripts you will have more time for engineering your next build.

The main features of the Room Control Program
  • status screens to monitor room pressure and door and vent status
  • control screen to watch and change all rooms, doors and vents
  • airlock screen to show information about an airlock
  • doors are sealed automatically if the other room has no pressure to prevent open them by mistake
  • doors to pressured rooms close automatically if a room looses pressure
  • automatic airlock control makes an airlock easy to use like an elevator
  • supports rotating lights as warning lights in low pressured rooms
  • automatic hangar control reduces the room pressure before the hangar gates are opened and pressurizes the hangar after all gates have been closed again
  • automatic leveling of the oxygen tank to prevent a tank connected to an airlock from becoming completely full or empty
  • all automatic controls can be turned on or off for each room through the user interface of the control screen
  • could be controlled by the H2O2 Control Program control screen

First steps:

When the code is loaded to a programmable block you only have to enter two setting values.
The first setting is the maximum number of separated conveyor systems in your grid. Two systems are separated, if there is no connection between those systems.
The second is the list of room names. Internally, the script works with room numbers. You can match these numbers with room names. If the name contains "Airlock", the script will treat that room as an airlock. If the word “Hangar” is part of the room name, that room is treated as a hangar.

With default settings the script analyses the grid to find connected blocks.
If you are using merge blocks to connect seperate ships or stations you need to enter a specific name. Switch "scanConstruct" to false and enter a name/phrase between the quotes at "gridName". Each block of your grid has to have this name/phrase in its custom name.

The custom data field of the blocks is used by the script for all the block specific setup information. All information are given in the custom data field. It is very important to set up all blocks with the room number that the block is in. For doors, the two room numbers that are separated by the door must be specified.

To use the script to control your airlocks and hangars those rooms have to have a specific setup:
Airlocks:
An airlock needs at least two doors leading into to different rooms. Of course one of those different rooms can be the outside atmosphere. Additionally you have to build at least one vent to control the airflow of the airlock and you have to build at least one sensor to tell the script when you enter or leave the airlock. The whole airlock must be covered by the sensor area. If neccessary you can build several sensors into one room. Adjust the sensor areas to match with your room shape.
The vents you are using to control the airflow of your airlock have to have the word "Airlock" as part of its blocknames.
I personaly build two vents into airlocks, one connected with a single oxygen tank and the other one is connected to my main oxygen system. With this setup the air can be sucked out of the airlock, even if the main oxygen system no longer offers any storage capacity. If you are using a seperate O2 tank and vent system those vents have to use "Airlock Backup" as part of its block name.
It is also possible to use built-in lighting to indicate whether the room has a safe atmosphere.
Hangars:
A hangar needs the same setup like an airlock, but the connection between the outside atmosphere and the room itself have to be build with a gate or airtight hangar doors.

Remember to add the token @RoomControl and the room number to every block you want to use with the script. The same you have to do with sensors or lights the script should have access to.

To get a screen used by the script simply open the custom data field of the screen and enter “@RoomControl” to the field. After leaving the custom data field it takes a few seconds and now you have a new custom data field with all screens provided by the block, the possible settings and all available screens of the script. Follow the instructions given in the custom data field. If you are using a RoomScreen or an AirlockScreen, you will also receive information on setting up the room numbers on the screen.

Using buttons to control a room:

You can use buttons to control your rooms, airlocks and hangars. This is a list of all available commands.
  • to change the pressure of a room
changeRoomO2=#
# is the room number which should change
  • to depressurize a hangar and open all gates
useHanger=# <
# is the room number of the hangar
  • to close all gates and pressurize a hangar
useHanger=# >
# is the room number of the hangar
  • to apply for entry into an airlock
useAirlock=1 < 2
1 is the room number of the airlock, 2 is the room you want to enter from - it's important to enter the spaces between the numbers of the rooms and the sign <
  • to adjust the airlock to exit to a specific room
useAirlock=3 > 4
3 is the room number of the airlock, 4 is the room for which a request to leave is made - it's important to enter the spaces between the numbers of the rooms and the sign >

The direction of the arrows < or > is the way your character want's to change the rooms.
Entering an airlock with the command "useAirlock=5 < 1" means you want to path a door from room 1 into room 5.
Leaving an airlock with the command "useAirlock=5 > 1" means you want to leave the airlock with room number 5 into room number 1.

Using the script as an H2O2 Control Program Add-On:

If you want to use one control seat to access both scripts, this is set up in the H2O2 Control Program.

Uninstalling the script:

I've added the programmable block command "uninstall" to completly remove all changes the script made to your blocks. If you want to test the script and you don't like it, please use this command before you remove the script.

Discord, Feedback, donations & credits:

And if you don't like the script or have problems with it please let me know down in the commends.
Or enter the Discord-Community:
https://discord.gg/2a52ftDyXX

But if you like my scripts and would like to be kept up to date on the current progress and upcoming projects, you can get regular information from now on here:
https://www.buymeacoffee.com/AlfRomeo80

To bypass the programmable block's character limitation, I used Malware’s Development Script MDK-SE.
https://github.com/malware-dev/MDK-SE

Thank you for your feedback and your support!
32 条留言
AlfRomeo80  [作者] 2022 年 3 月 17 日 下午 4:01 
I guess there could be some issues with the updates of SE. Sadly I've no time to update the scripts right now. They are not tested with the past updates.
MaDMardigan 2022 年 3 月 14 日 上午 11:20 
i was working on a large ship and i used this mod a while ago. now i loaded the save and the script keeps saying that its too complex... i couldnt figure out how to get it to work again.
additional info: the script added additional lines in the custom data of a sensor for "name= ; room= ; sensor= ; monitor= ;" - i removed the sensor but no effect on the script.
oOAlastorOo 2022 年 2 月 23 日 上午 9:09 
Thanks for coming back and actually yes it worked. I got the same issue on the H2O2 control. Only minimum build (setting up pasteable controlstation on an rotor) with each 1 block who gets accessed and 6 monitors, as well as an control seat.

Script starts, displays show sprites and then the PB throws the "script to complex" error.
Shame, as i love your control scripts and aimed to integrate them in a new shipline with proper control rooms.

The Power control is still working at least, dont know whats so different with the other 2, but i am no programmer :;
AlfRomeo80  [作者] 2022 年 2 月 21 日 下午 1:31 
@oOAlastorOo
Thanks for reporting your issue. Does anyone else has the same problem? Did you used the script in the past and it worked and suddenly it doesn't work anymore?
oOAlastorOo 2022 年 2 月 20 日 上午 12:14 
Dont know if you are aware, but i get an "Script to complex" Error right after Startup. Do plan to keep maintaining your Scripts?
AlfRomeo80  [作者] 2021 年 7 月 5 日 下午 4:39 
The sensors are needed to tell the script if the user entered the airlock.
And if more people are present, then the sensors block the airlock, if someone else is using it at the moment.
But you are right, it's a lot to do to set up a complete ship.
TheBlueChocolate 2021 年 7 月 5 日 下午 4:29 
Thanks for the help, but now, I don't find how to configure the airlock and hangar sensors, and I don't even want them. I wanted to use buttons, not sensors. (The switch presurisation command work now, but it doesn't open the doors after the switch)

And I think this script is complicated to configure. We have to configure each door with their room numbers and door groups, but couldn't we get the same result with the game's groups? When I configured my test platform, it took a long time to configure 4 rooms (1 airlock, 1 hangar, 2 rooms)
AlfRomeo80  [作者] 2021 年 7 月 4 日 下午 3:31 
To activate the script you need to setup a control seat or a display with panels.
On top of the script itself the commands are written to control the displays and with them the script. You can activate the Room Control and activate or deactive the leveling for the airlocks. But with only one conveyor system you don't need the leveling, of course.
TheBlueChocolate 2021 年 7 月 4 日 上午 10:14 
Maybe I didn't configure it correctly but I still get the message
max. Conveyors available: 1
Room Control: disabled
leveling O2: disabled
And I can't figure out why. I entered the name of the grid as well as the groups into the script, I only have one conveyor system.
AlfRomeo80  [作者] 2021 年 5 月 23 日 下午 4:11 
@Squatch_ and everybody else having trouble ith this script:
I've made a mistake in the instructions here. The signs < and > had been wrong.
Now I updated the instructions and wrote a little explanation how to read the commands for the airlock.
I'm really sorry about this mistake.

My PCs are working now with the new setup. Right now I'm setting up everything and soon, maybe tomorrow, I'm going to stream live on Twitch and play around with the scripts.
Perhaps there could be a live Q&A about my scripts ones a month on Twitch.
But first everything needs to work the way I want to.