| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
hpl3:community:other:door-button-interaction [2015/10/29 22:00] thedoctorpoo Original edit by Kanthos, re-edited by TheDoctorPoo |
hpl3:community:other:door-button-interaction [2016/04/10 14:59] (current) thedoctorpoo [What Button's Work?] |
||
|---|---|---|---|
| Line 3: | Line 3: | ||
| 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. | 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:** ===== | + | ===== 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"**. | 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:** ===== | + | ===== Step 2: ===== |
| Click on **button1** and select **Entity**→**Connections**. There is the field **"Connected Entities"**. There you must write **"door1, button2"**. | Click on **button1** and select **Entity**→**Connections**. There is the field **"Connected Entities"**. There you must write **"door1, button2"**. | ||
| Line 12: | Line 14: | ||
| You will see, that through this entry you change the state of the connected entities, when you interact with a button. | You will see, that through this entry you change the state of the connected entities, when you interact with a button. | ||
| - | ===== **Step 3:** ===== | + | ===== Step 3: ===== |
| Click on the door and select **Entity**→**Internal State**. Activate the box **"Interaction Disabled"**. | 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. | Now your door can not be opend by player interaction. Only the connected buttons can open it. | ||
| - | ===== **Note:** ===== | + | ===== 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**. | 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. | There is a field called **"ConnectionStateChangeCallback"**. Place your functions name there and it will be called whenever the button is pressed. | ||
| - | ===== **Sources:** ===== | + | ===== 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** - | + | **HPL3 Tutorials Part 3 Creating a Map** - [[https://www.youtube.com/watch?v=TGhwsa1k1LU|https://www.youtube.com/watch?v=TGhwsa1k1LU]] |
| - | https://www.youtube.com/watch?v=TGhwsa1k1LU | + | |