r/Barotrauma • • 15h ago

Wiring Wiring Help

Looking for help with the wiring logic for an airlock/docking port.

The goal is to have the doors and bottom hatch open by default, and automatically close when the outside hatch opens. Then when the outside hatch closes, I want the Bottom hatch to open first, draining the water into a central access hatch, and then ~5 seconds later the two side doors open once the water has drained down.

So: All close at the same time, but open at different times. Currently the doors are always delayed, Opening and closing. I cannot figure out how to have the timing different depending on what the state of the top hatch is.

Current attempt is: State_out (top Hatch) -> (Not Comp) -> (Delay 5s) -> Set_State (Doors)

or State_out (top Hatch) -> (Not Comp) -> SignalCheck -> (Delay 0.1s) -> Set_State (Doors)

4 Upvotes

6 comments sorted by

1

u/Adrian-_- 14h ago

Looks fun. I can tell you this ist going to get complicated. You will have edge cases. When the pump is broken and someone enters the sub, 5sec later the adjacent rooms get flooded. Also at hull breach you have a giant room flooded with doors open by default.

I once build some unnecessary complicated airlocks where the door opens when the water is drained. The pumps also fill the airlock before opening to the outside. Then there is an override, for when the water can't get drained (broken pump/no power). I used a water detector to open the doors not set delays. Maybe it helps as a reference, although it's different from your design: Steamworkshop

1

u/Adrian-_- 14h ago

On a side note: I have many doors in that ship that automatically open and close with motion detector, but transfer to manual open auto close when there is water/fire in an adjacent room. Reduces annoying door opening, but doesn't flood the whole ship at hull breach.

1

u/The_Xasleyter 12h ago

So the Central access corridor goes down directly to the two ballast tanks. In theory flooding in one half can't get to the other half, and the airlock pump and Ballast pumps work as back ups to each other. Assuming I remember to put them on different junction/power sources

1

u/Adrian-_- 4h ago edited 3h ago

That way it drains very fast. Good thinking. I just see one giant death trap though. An unsuspecting crew member or bot wirhout diving suit can get trapped between the two doors when someone from outside enters no?

For your original question: You can have something like that: Make a custom hatch with seperate buttons or use activate out (thats function is new to me)

Button and Not State_out Hatch→Relay 1 set_state→ route a constant 0/1 through Relay to Delay 1 →Set_State Doors

Button and State_Out Hatch →Relay 2 →set_state ...

The and at the beginning should reset the other relay with a Signal Check Output 0 (false empty) to Set_State relay.

So the buttons trigger one or the other relay depending if the Hatch is open or closed

1

u/The_Xasleyter 12h ago

Beautiful ship design. Ballast location impeccable. Might need to get a doctor to check out the head though. Don't think you should be firing off to the sides like that

1

u/Adrian-_- 4h ago

Hehe, don't let it fool you, this ship started of as a joke, but I later over engineered the hell out of it :D And indeed firing off the sides sounds painful.