Space Engineers

Space Engineers

评价数不足
Pressure Manager
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
8.441 KB
2017 年 12 月 14 日 下午 2:48
1 项改动说明 ( 查看 )

订阅以下载
Pressure Manager

描述
Description

This script permit to manage the pressure in several rooms on the current grid.

It provides a way to safely switch from a zero-pressured environment to a high-pressured one without thinking about closing doors, and without losing oxygen.

In this way, as soon as the system is setup you don't have to harvest ice anymore for your oxygen. You can also be notified of the rooms pressurization to avoid opening a wrong door by mistake.

Limitation: This script is not suitable for low pressure environments (like the Alien Planet), since it manages only pressurization from "none" (0%) to "high" (100%).

Note for servers: This script is intentionally designed to not overload servers. For example, the status will be checked at each timer run (i.e. each second instead of each tick).

Principle

Rooms are pressurized or depressurized using a set of air vents.

In order to not lose oxygen, it is recommended to connect these air vents to oxygen tanks.
Make sure tanks have sufficient oxygen to pressurize the whole room.

The room statuses can be shown on different ways (All are optional):

- For each room, you can define a set of lights to indicate the pressurization status:
  . Lights become Green only when the room is completely pressurized. (i.e. 100% pressure)
  . Lights become Red only when the room is completely depressurized. (i.e. 0% pressure)
  . Lights are Yellow during transitions.
- For each room, a set of sound blocks:
  . The selected sound of each block is played during transitions (pressurization or depressurization).
  . Be aware: sounds are not audible in the void.
- For each room, a set of text panels:
  . The room pressurization status will be displayed on these panels.
- A set of common text panels:
  . The pressurization status of all managed rooms are displayed on these panels.
  . It permits you to have a global vision of the pressurization status for all rooms.

Custom Data

In order to indicate this script which blocks to manage, you must to provide the rooms structure and common panels in the programmable block custom data.

Here is a minimum custom data example:

Common Panels:
Room:
  Name: "Airlock"
  Air Vents: "Vent Airlock"
  Doors:
  Lights:
  Sound Blocks:
  Room Panels:

As you can see, only one air vent is required for a room. You must specify all element lines, in this order, even if they are empty.
You can also indent the elements in a room with spaces, but it's not mandatory.

And here is a more complete example for a small station with an airlock and one room:

Common Panels: "Panel Rooms Pressure A", "Panel Rooms Pressure B"
Room:
  Name: "Airlock"
  Air Vents: "Vent Airlock"
  Doors: "Door Airlock Exterior", "Door Airlock Interior"
  Lights: "Light Airlock Pressure Exterior", "Light Airlock Pressure Interior"
  Sound Blocks: "Sound Block Station Pressure"
  Room Panels:
Room:
  Name: "Central Room"
  Air Vents: "Vent Central Room 01", "Vent Central Room 02"
  Doors: "Door Airlock Interior"
  Lights: "Light Pressure Central Room"
  Sound Blocks: "Sound Block Station Pressure"
  Room Panels: "Panel Central Room Pressure"

As you can see, you are able to add several room definitions. You can add as many as you want.

If there is a syntax error in your custom data it will be indicated into the programmable block console when running it.

Usage

You must give an action to take when calling this script. So, here are the possible arguments:

Pressurize <RoomName>
  Start sending oxygen to the designated room.
Depressurize <RoomName>
  Start removing oxygen from the designated room.
Status
  Check pressure status on all managed rooms and take actions accordingly (lights, panels, speakers...).

Example

Here is a simple way to use this script.

* Build an airtight airlock that includes following blocks:
  - One air vent named "Airlock Vent" connected to an oxygen tank filled at 50%.
    To do this, you can temporarily build an oxygen generator connected to the tank,
    and when it reaches 50%, grind down the oxygen generator,
    then connect your air vent to the tank.
    If you have a big room and one half tank is not sufficient, add another tank.
    Be careful to not fill the tanks too much, else it's possible you will not be able to depressurize the room...
  - Two doors (named "Airlock Interior Door" and "Airlock Exterior Door").
  - One light named "Airlock Light" (That will become green, yellow or red depending the pressure).
  - A text panel named "Airlock Status Panel" to display the airlock status.
* Build a programmable block and paste this script inside.
  - Edit the Custom Data of your programmable block to indicate to the script the component names:
    Common Panels:
    Room:
      Name: "Airlock"
      Air Vents: "Airlock Vent"
      Doors: "Airlock Interior Door", "Airlock Exterior Door"
      Lights: "Airlock Light"
      Sound Blocks:
      Room Panels: "Airlock Status Panel"
* Build a Timer block, set it to one second delay, and add these two actions:
  - Run the programmable block with argument "Status"
  - Start this timer block itself
* Build a control panel and program two buttons with following actions (<room> is the room name you set into the custom data):
  - Run programmable block with argument "Pressurize <room>"
  - Run programmable block with argument "Depressurize <room>"
* Start the timer block: It will constantly scan rooms each second and display the status on the text panel.
* Push pressurize or depressurize buttons to do what you want.

Future Enhancements
* Ability to start a trigger on events

Enjoy :)