S&box Wiki

Creating a Door

Creating a Door

This guide is a step-by-step tutorial to create a simple door. We are going to use tools from Hammer. In S&box the doors are called ent_door. They are simple to use.🚪

Making a door step-by-step

Step 1:

With the Entity Tool ( ⇧ shift + e ), create a new ent_door. You can choose the Entity Class: ent_door in the Tool Proprieties window. You can also create an entity (like a prop_static) and change class.

step1.png

Step 2:

You can now edit Object Proprieties. Select the Objects ( 5 ) mod and select the door. You can see the window objects proprieties lower right corner. You can have a bigger window by double-clicking on the entity. You can verify the class of the object in "Class". Choose a name for a door and set a "World Model". You can put the name of the model or use the magnifying glass 🔍 in the right corner. When you see the door on the preview, you can see that the door is now on your map. Change the position of the door if you need to fit it with the Move Tool ( t ).

step2.png

Step 3:

Now we are going to make the opening animation. You can choose a Rotating door or a Moving door. Change to the type you need.

  • A "Rotating" door is a door that rotate on an axis. The animation is like when you use the rotating tool around the origin.
  • A "Moving" door is a door that move in a direction. The animation is like when you move the door using the move tool on an axis.

Now we are going to set the "Distance". It's the amount that the door can make in the opening animation.

  • For the Moving door: The amount, in inches, of the door to leave sticking out of the wall it recedes into when pressed. Negative values make the door recede even further into the wall.
  • For the Rotating door: The amount, in degrees, that the door should rotate when it's pressed.

In our example, we want to make a rotating door that open to an angle of 90 degrees. Put The movement type to "Rotating" and the distance to "90". The door is now functional, you can see a blue block next to the door that shows what the door can do. Note: Step after this one are optional

step3.png

Step 4:

We are going to add details.

I want a door that open slowly. In "Speed", put 150. By default, the speed is 100, you can speed up or slow down the animation by changing the number.

I want a door which close itself after 10 seconds. In the "Auto Close Delay", I put 10. You can change this delay if you want the door to close quickly or slowly. The amount of time is the seconds, after the door has opened, before it closes automatically. If the value is set to -1, the door never closes itself.

Step 5:

If you test it, you are going to see that the door is silent. We are going to add sounds. Go to the "Sounds" category and expend it with the +. Choose a sound by clicking on the magnifying glass 🔍 to the right. You can ear the sound by clicking on the play button ▶️.

Name Description
Start Opening Sound Sound to play when the door starts to open.
Fully Open Sound Sound to play when the door reaches it's fully open position.
Start Closing Sound Sound to play when the door starts to close.
Fully Closed Sound Sound to play when the door reaches it's fully closed position.
Locked Sound Sound to play when the door is attempted to be opened, but is locked.
Moving Sound Sound to play while the door is moving. Typically this should be looping or very long.

For the example, I choose sounds from the UI.

step5.png

Step 6:

If you want a double door or connected door, there are two ways to make them. Create another door and put it where you need it.

  1. If two doors have the same name, Source think it's the same door. Rename your second door with the name of the first. They are now connected.
  2. In the "Other Doors To Open" section, put the name of the other door. Do this for the two doors, and they are now connected.

Note: For the second door, if you want to open it in the same direction as the first, you probably need to rotate it and put a negative value for the distance

step6.png

Result

When you use e, you can see your door working.

result simple.gif
result double.gif

Learn more about door here: Hammer.DoorHelperAttribute Learn more about ent_door in s&box: Reimagining Base Entities

Special Pages


Wikis

?

Render Time: 45ms

DB GetPage 35
Generate Html 0
SaveChanges (1) 6
Render Body 0
Render Sidebar 1