In this post I will teach you how to add different set of doors. Doors do require some in-game testing so you can get them right.
CS:GO SDK has two options for doors. Adding doors either by;
- Models/Props (Using door models that are provided with the game)
- Tying brushes to a door entity. (If you want a sliding doors or door with particular texture)
Using models is the easiest way of adding doors, just add prop_door_rotating entity. While brushes you will need to tie it to an entity but its more practical.
Adding Doors (Model/Prop)
Select the Entity Tool and search in the object drop down list (located in the bottom right of the hammer editor) for prop_door_rotating. Left-click in the world to add, it should add a purple cube.
Now double click the entity to open the properties window.
Select the World Model field and then click the browse button to open the Model Browser. Filter for ‘door’ and select the appropriate door. In the case of this tutorial I am going to select the doormain01_static.mdl model.
Once you have found a model, hit OK on the model browser and then select apply. The model should display in the world, reposition it if required.
Adding Doors(Brushes)
To do this you will first be required to make a brush. Select a reasonable texture (I’d go with a dev texture) and create a brush that is 2 units wide, 55 units long and 104 units high. (Use prop door model to get the measurements)
Now that you have a brush, you will want to add a door texture. Select Toggle Texture Application or Shift+A to open Face Edit Sheet. Click Browse button to open the textures window. Search for ‘Door’ and select a texture and apply it to the brush by right clicking on the brush surface (align the texture if required by using justify or measurements features) .
Once that is done, we move on to tying the brush to an entity. There are two options;
Normal Rotating Doors – You can tie it to work like normal rotating door by selecting the brush and hitting Crtl+T to open the object properties. Then from the class drop down list search for func_door_rotating, hit apply and you will notice a purple sphere show on the brush/door.
The sphere represents the rotation point of where the door will rotate around. So you are required to move the point(sphere) to the edge of the brush. Use the top viewport to move the sphere.
Sliding Doors – If you want to create a sliding door (e.g elevator door or spaceship door) then you need to Tie the brush to func_door entity. To do that select your brush and hit Ctrl+T. This will open the object properties. Search under the class drop down list for ‘func_door’, once found hit apply.
To make the door slide you will need to set the Move Direction (Pitch Yaw Roll) field. This will require some in-game testing to figure out which direction you want the door to moves when you use action key. You can use measurer located on the top right of properties window to set the direction.
We are done once you have figured out the direction.
Extra
There are few fields and states that you would like to experiment with when using doors. Here are few:
- Under Class Info Tab;
- Parent – The name of this entity’s parent in the movement hierarchy. Entities with parents move with their parent.
- Speed – The speed at which the door moves.
- Spawn Position – set if the door is open or closed when it at the start.
- Unlocked Sound & Locked Sound – Set them to play a sound to give indication if the door is locked or unlocked.
- Health/Strength – Allows the door to become breakable.
- Under Flags Tab;
- Starts Open – This door spawns open.
- Non-solid to Player – The player does not collide with this door.
- Passable – Nothing collides with this door.
- Toggle – The door is given an input to change this door between open and shut.
- Use Opens and Use closes – The +use key, when in range, triggers this door.
- NPCs Can’t – NPCs can’t open this door.
- Touch Opens – When a player or NPC collides with this door, it is triggered.
- Starts locked – This door spawns locked and cannot be opened by the player or NPC (but buttons can still trigger it)
- Door Silent – This door makes no noise (No sound, and does not alert NPCs).
- Ignore player +USE – Makes the door ignore players +use
- Start Unbreakable – Makes the door breakable. (Only works on certain prop models and requires door having health/strength)