Difference between revisions of "Custom Airlock IC10"
From Unofficial Stationeers Wiki
Emilgardis (talk | contribs) (Use proper/better category -> IC10) |
m (removed unecessary <br> tags) |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 40: | Line 40: | ||
{| class="mw-collapsible mw-collapsed" | {| class="mw-collapsible mw-collapsed" | ||
!Source code: | !Source code: | ||
| + | |- | ||
| + | | | ||
| + | {{ICCode| | ||
| + | define Int.Pressure 100 | ||
| + | define Ext.Pressure 0 | ||
| + | |||
| + | alias Int.Door d0 | ||
| + | alias Ext.Door d1 | ||
| + | alias Int.Vent d2 | ||
| + | alias Ext.Vent d3 | ||
| + | alias Sensor d4 | ||
| + | alias LedLight d5 | ||
| + | |||
| + | define Color.Red 4 | ||
| + | define Color.Yellow 5 | ||
| + | define Color.Green 2 | ||
| + | define Mode.Out 1 | ||
| + | define Mode.In 0 | ||
| + | |||
| + | alias rT r0 | ||
| + | alias rT2 r1 | ||
| + | alias rTarPressure r2 | ||
| − | + | Init: | |
| − | + | s Int.Vent On 0 | |
| − | + | s Ext.Vent On 0 | |
| − | + | s Ext.Door Mode 1 #Logic mode | |
| − | + | s Int.Door Mode 1 #Logic mode | |
| − | + | s LedLight Color Color.Green | |
| − | + | s LedLight On 1 | |
| − | + | s Int.Door Open 0 | |
| − | + | s Ext.Door Open 1 | |
| − | + | yield | |
| − | + | ||
| − | + | main: | |
| − | + | jal _monitorTrigger | |
| − | + | jal _cycleToInt | |
| − | + | jal _monitorTrigger | |
| − | + | jal _cycleToExt | |
| − | + | j main | |
| − | + | ||
| − | + | _cycleToInt: | |
| − | + | push ra | |
| − | + | s Ext.Door Lock 1 | |
| − | + | s Int.Door Lock 1 | |
| − | Init: | + | s Ext.Door Open 0 |
| − | s Int.Vent On 0 | + | s Ext.Vent Mode Mode.Out |
| − | s Ext.Vent On 0 | + | s Ext.Vent On 1 |
| − | s Ext.Door Mode 1 #Logic mode | + | s LedLight Color Color.Red |
| − | s Int.Door Mode 1 #Logic mode | + | s LedLight On 1 |
| − | s LedLight Color Color.Green | + | jal _dePressurize |
| − | s LedLight On 1 | + | s Ext.Vent On 0 |
| − | s Int.Door Open 0 | + | s Int.Vent Mode Mode.In |
| − | s Ext.Door Open 1 | + | s Int.Vent PressureExternal Int.Pressure |
| − | yield | + | move rTarPressure Int.Pressure |
| − | + | s Int.Vent On 1 | |
| − | main: | + | s LedLight Color Color.Yellow |
| − | jal _monitorTrigger | + | jal _pressurize |
| − | jal _cycleToInt | + | s LedLight Color Color.Green |
| − | jal _monitorTrigger | + | s Int.Vent On 0 |
| − | jal _cycleToExt | + | s Int.Door Open 1 |
| − | j main | + | s Ext.Door Lock 0 |
| − | + | s Int.Door Lock 0 | |
| − | _cycleToInt: | + | pop ra |
| − | push ra | + | j ra |
| − | s Ext.Door Lock 1 | + | |
| − | s Int.Door Lock 1 | + | _cycleToExt: |
| − | s Ext.Door Open 0 | + | push ra |
| − | s Ext.Vent Mode Mode.Out | + | s Int.Door Lock 1 |
| − | s Ext.Vent On 1 | + | s Ext.Door Lock 1 |
| − | s LedLight Color Color.Red | + | s Int.Door Open 0 |
| − | s LedLight On 1 | + | s Int.Vent Mode Mode.Out |
| − | jal _dePressurize | + | s Int.Vent On 1 |
| − | s Ext.Vent On 0 | + | s LedLight Color Color.Red |
| − | s Int.Vent Mode Mode.In | + | s LedLight On 1 |
| − | s Int.Vent PressureExternal Int.Pressure | + | jal _dePressurize |
| − | move rTarPressure Int.Pressure | + | s Int.Vent On 0 |
| − | s Int.Vent On 1 | + | s Ext.Vent Mode Mode.In |
| − | s LedLight Color Color.Yellow | + | s Ext.Vent PressureExternal Ext.Pressure |
| − | jal _pressurize | + | move rTarPressure Ext.Pressure |
| − | s LedLight Color Color.Green | + | s Ext.Vent On 1 |
| − | s Int.Vent On 0 | + | s LedLight Color Color.Yellow |
| − | s Int.Door Open 1 | + | jal _pressurize |
| − | s Ext.Door Lock 0 | + | s LedLight Color Color.Green |
| − | s Int.Door Lock 0 | + | s Ext.Vent On 0 |
| − | pop ra | + | s Ext.Door Open 1 |
| − | j ra | + | s Int.Door Lock 0 |
| − | + | s Ext.Door Lock 0 | |
| − | _cycleToExt: | + | pop ra |
| − | push ra | + | j ra |
| − | s Int.Door Lock 1 | + | |
| − | s Ext.Door Lock 1 | + | _dePressurize: |
| − | s Int.Door Open 0 | + | l rT Sensor Pressure |
| − | s Int.Vent Mode Mode.Out | + | beqz rT dePressurize_end |
| − | s Int.Vent On 1 | + | l rT LedLight On |
| − | s LedLight Color Color.Red | + | beqz rT dePressurize_end |
| − | s LedLight On 1 | + | j _dePressurize |
| − | jal _dePressurize | + | dePressurize_end: |
| − | s Int.Vent On 0 | + | s LedLight On 1 |
| − | s Ext.Vent Mode Mode.In | + | yield |
| − | s Ext.Vent PressureExternal Ext.Pressure | + | j ra |
| − | move rTarPressure Ext.Pressure | + | |
| − | s Ext.Vent On 1 | + | _pressurize: |
| − | s LedLight Color Color.Yellow | + | l rT Sensor Pressure |
| − | jal _pressurize | + | bge rT rTarPressure pressurize_end |
| − | s LedLight Color Color.Green | + | l rT LedLight On |
| − | s Ext.Vent On 0 | + | beqz rT pressurize_end |
| − | s Ext.Door Open 1 | + | j _pressurize |
| − | s Int.Door Lock 0 | + | pressurize_end: |
| − | s Ext.Door Lock 0 | + | s LedLight On 1 |
| − | pop ra | + | yield |
| − | j ra | + | j ra |
| − | + | ||
| − | _dePressurize: | + | _monitorTrigger: |
| − | l rT Sensor Pressure | + | l rT Int.Door Setting |
| − | beqz rT dePressurize_end | + | l rT2 Ext.Door Setting |
| − | l rT LedLight On | + | beq rT rT2 monitorTrigger_end |
| − | beqz rT dePressurize_end | + | l rT LedLight On |
| − | j _dePressurize | + | beqz rT monitorTrigger_end |
| − | dePressurize_end: | + | yield |
| − | s LedLight On 1 | + | j _monitorTrigger |
| − | yield | + | monitorTrigger_end: |
| − | j ra | + | yield |
| − | + | j ra | |
| − | _pressurize: | + | }} |
| − | l rT Sensor Pressure | ||
| − | bge rT rTarPressure pressurize_end | ||
| − | l rT LedLight On | ||
| − | beqz rT pressurize_end | ||
| − | j _pressurize | ||
| − | pressurize_end: | ||
| − | s LedLight On 1 | ||
| − | yield | ||
| − | j ra | ||
| − | |||
| − | _monitorTrigger: | ||
| − | l rT Int.Door Setting | ||
| − | l rT2 Ext.Door Setting | ||
| − | beq rT rT2 monitorTrigger_end | ||
| − | l rT LedLight On | ||
| − | beqz rT monitorTrigger_end | ||
| − | yield | ||
| − | j _monitorTrigger | ||
| − | monitorTrigger_end: | ||
| − | yield | ||
| − | j ra | ||
|} | |} | ||
Latest revision as of 03:39, 20 February 2026
Contents[edit]
This script controls all functions of an airlock that consists of the following:
Assembly[edit]
Set up a standard airlock for atmosphere on both sides. Configure the pressures in the first two lines of the script. Before exporting the script or resetting the IC, make sure the airlock is cycled to the outside (inner door closed, outer open). The LED serves as trigger for both cycling the airlock and skipping each phase, hence should be placed inside the airlock. The airlock should be a single frame to avoid leftover atmosphere after depressurization. For larger airlocks place the sensor on the far side from the vents. The script supports Blast Doors, but since they lack a door handle you will need a button on each side (outside) of the airlock. Connect a Logic Writer to each button and use it to toggle the LED.
IC10 pin layout:
| D0 | Interior Door |
| D1 | Exterior Door |
| D2 | Interior Vent |
| D3 | Exterior Vent |
| D4 | Gas Sensor |
| D5 | LED Light |
Usage[edit]
The airlock can be cycled by interacting with either door, or turning the LED off. During cycling the doors are locked, and the LED can be used to skip both depressurize (red) and pressurize (yellow) phases.
| Source code: |
|---|
define Int.Pressure 100 define Ext.Pressure 0 alias Int.Door d0 alias Ext.Door d1 alias Int.Vent d2 alias Ext.Vent d3 alias Sensor d4 alias LedLight d5 define Color.Red 4 define Color.Yellow 5 define Color.Green 2 define Mode.Out 1 define Mode.In 0 alias rT r0 alias rT2 r1 alias rTarPressure r2 Init: s Int.Vent On 0 s Ext.Vent On 0 s Ext.Door Mode 1 #Logic mode s Int.Door Mode 1 #Logic mode s LedLight Color Color.Green s LedLight On 1 s Int.Door Open 0 s Ext.Door Open 1 yield main: jal _monitorTrigger jal _cycleToInt jal _monitorTrigger jal _cycleToExt j main _cycleToInt: push ra s Ext.Door Lock 1 s Int.Door Lock 1 s Ext.Door Open 0 s Ext.Vent Mode Mode.Out s Ext.Vent On 1 s LedLight Color Color.Red s LedLight On 1 jal _dePressurize s Ext.Vent On 0 s Int.Vent Mode Mode.In s Int.Vent PressureExternal Int.Pressure move rTarPressure Int.Pressure s Int.Vent On 1 s LedLight Color Color.Yellow jal _pressurize s LedLight Color Color.Green s Int.Vent On 0 s Int.Door Open 1 s Ext.Door Lock 0 s Int.Door Lock 0 pop ra j ra _cycleToExt: push ra s Int.Door Lock 1 s Ext.Door Lock 1 s Int.Door Open 0 s Int.Vent Mode Mode.Out s Int.Vent On 1 s LedLight Color Color.Red s LedLight On 1 jal _dePressurize s Int.Vent On 0 s Ext.Vent Mode Mode.In s Ext.Vent PressureExternal Ext.Pressure move rTarPressure Ext.Pressure s Ext.Vent On 1 s LedLight Color Color.Yellow jal _pressurize s LedLight Color Color.Green s Ext.Vent On 0 s Ext.Door Open 1 s Int.Door Lock 0 s Ext.Door Lock 0 pop ra j ra _dePressurize: l rT Sensor Pressure beqz rT dePressurize_end l rT LedLight On beqz rT dePressurize_end j _dePressurize dePressurize_end: s LedLight On 1 yield j ra _pressurize: l rT Sensor Pressure bge rT rTarPressure pressurize_end l rT LedLight On beqz rT pressurize_end j _pressurize pressurize_end: s LedLight On 1 yield j ra _monitorTrigger: l rT Int.Door Setting l rT2 Ext.Door Setting beq rT rT2 monitorTrigger_end l rT LedLight On beqz rT monitorTrigger_end yield j _monitorTrigger monitorTrigger_end: yield j ra |
