====== How To Connect Doors With Buttons ====== This quick tutorial will show you how to create a door, that can be opened and closed via two buttons, that change their state, when pressed. ===== Step 1: ===== Open the level-editor and create a map with a door and a button on each side of the door. I will call the door **"door1"** and the buttons **"button1"** and **"button2"**. ===== Step 2: ===== Click on **button1** and select **Entity**→**Connections**. There is the field **"Connected Entities"**. There you must write **"door1, button2"**. Do the same for **button 2**, but here you write **"door1, button1"**. You will see, that through this entry you change the state of the connected entities, when you interact with a button. ===== Step 3: ===== Click on the door and select **Entity**→**Internal State**. Activate the box **"Interaction Disabled"**. Now your door can not be opend by player interaction. Only the connected buttons can open it. ===== Note: ===== This will work with most doors, **but there are doors in the game that require a script**. For these you need to write a **callback function** and call it under both buttons **Entity**→**Basic Callbacks**. There is a field called **"ConnectionStateChangeCallback"**. Place your functions name there and it will be called whenever the button is pressed. ===== What Button's Work? ===== The buttons and switches can be accessed by selecting **Entities** in the **Level Editor** and by clicking **Station**→**Panels**. Experiment with different buttons to see which one is most suitable for your level. The most commonly used button in SOMA is **theta_panel ** and **theta_panel_front**. These are located in Entities, Station and Panels. Other doors like the **Bulkhead doors** from Upsilon would work well with the **panel_large_inside** button. ===== Sources: ===== **HPL3 Tutorials Part 3 Creating a Map** - [[https://www.youtube.com/watch?v=TGhwsa1k1LU|https://www.youtube.com/watch?v=TGhwsa1k1LU]]