You are here

Tutorial - Creating Custom Doors

Mr. X

Tutorial: Creating Custom Doors


This tutorial will cover all the issues and concepts required to create and implement a fully-working custom door in the game with all the functionality and features of the doors that ship with the game. I consider this an advanced tutorial as I the step-by-step buttom pushing in MAX will not be walked through. We will still cover all the aspects of door creation in MAX, but this tutorial assumes the user is familiar enough with the program to create and (especially) animate objects without specific, detailed instruction. We will not be texturing the door in this tutorial as basic skill in texturing for NWN is also assumed.


To complete this tutorial, you should have the following tools:

  • Neverwinter Nights
  • 3ds MAX 4.2x or 5
    • I use MAX 5 for this tutorial. Some functionality in 4.2 may differ.
  • BioWare's Neverwinter Export Scripts for 3DSMax
  • Zoligato's NWN Viewer
  • A text editor
    • I suggest UltraEdit, but any will work. Even Notepad.



Part 1: Make a plan

What kind of door do you want?

How you're going to approach making your door depends a lot on the kind of door you want. Doors can be any number of things. Of course you can make a traditional knob-handled doors that swing open from the side. Doors that split in half and slide into either side of the wall. Doorways composed of a knot of plant life that untangles and receeds to open a passageway. Crackling electricity and shimmering portals are but a few examples of the neat things you can do with doors.

Figure out what format of custom door you need.

There are basically two kinds of doors. First you have your totally generic doors that are available to all tilesets. There are also doors that are keyed to a specific tile (or tiles) in a certain tileset. These doors are not readily available to place on any door points except for ones that are keyed just for them. For this tutorial, we'll make a generic door as they're obviously the most handy and usable. At the end I'll give you a run-down of what to do if you want to make tile-specific doors instead.

Draw it out.

Once you get into MAX, door creation will go a heck of a lot faster if you actually know exactly what you're making before you open the program. Sketch the door out. Is it going to work in a standard doorway? Will you need to model it in an odd shape or in such a way to allow for textures with alpha transparency? Everything should be figured out before you begin to physically create your door.

Part 2: Build the Door

Alter MAX's Setup for Custom Content Creation

In the document that comes in BioWare's Neverwinter Export Scripts for 3DSMax there's a short run-down on how to set up MAX for NWN custom content creation. This includes setting your export path, setting your units up correctly, and setting your default animation controllers to linear for position and rotation. As this is detailed in their doc, we won't revisit it here.

The AuraBase

The AuraBase provides the export script with your model's name, any animations, and it will act as the ultimate parent for all nodes that are to be exported into your MDL file.

Under the Create tab, press the Helpers button. Press the AuraBase button and then click in the top viewport to create the AuraBase. Keeping the AuraBase selected, press the Select and Move tool button. Then right-click on that same button to bring up the Move Transform Type-In dialog box. In all three fields on the left-hand size of the box, set 0 as the value. This will center your AuraBase perfectly. With the AuraBase still selected, click on the Modify tab and type the name for your model into the field directly under the tab. This will depend on what type of door your making. As we're making a generic door, we'll need to use the next number in sequence (t_doorXXX under data\models_01.bif are the generic doors). As t_door11 is the last one, we'll use t_door12 for our door name. Under the modify tab, select Door for the classification type.

The Basic Door Shape

Create a standard door shape. Most doors are 200cm wide, 300cm tall, and 20 cm thick (at least with how I have my units set up. You're may vary downard by a factor of 100. If so, move the decimal points accordingly). It should be resting on the ground plane in the very center.


It couldn't hurt to add some more specific door-like geometry to your door at this point. I'm going to add some simple pull handles to each side of mine. You can get as crazy or as simple as you want. If you want a knob, no problem. If you want a complex mechanism of clockworks that turn gears and slide bank vault-style bars before the door opens, so be it. At this point, parent anything extra your putting on your door to the door itself.

The Pivot Dummy

It'll be much easier to animate your door with it (and therefore any extra geometry attached ot it) parented to a simple dummy we'll rotate around the Z axis to get our door swinging. Create a dummy helper and slide it off -100cm (again, could be -1 depending on how you have your units set) along the X axis to get it in the center of the edge of the door we want to swivel.


It's important that you remember to parent the door to the dummy you just made. Then parent the dummy to the Model Helper Object.

Adding and Naming the Animations

It may seem a little early to begin animating, but these various animations states are what will give us the references. First off, here's a run-down of the animations you'll need and what they do:

  • opening1 - The door opening outwards
  • opened1 - The door at rest in a fully opened outward state
  • closing1 - The door closing from outward to a fully closed position
  • closed - The door at rest in a fully closed position
  • opening2 - The door opening inward (the most common door animation you see in-game)
  • opened2 - The door at rest in a fully opened inward state
  • closing2 - The door closing from inward to a fully closed position
  • die - The door being destroyed (usually animated to fall below ground and stay hidden there)
  • dead - The door at rest if a fully destroyed position, usually below ground
  • trans - The state displayed when the door is open, there is an active transition point associated with the door, and the open doorway is moused over. Note that this is the only animation you should not animate with the door. This should be exclusively animated with the sam mesh we will discuss later.

The above is the order I animate them in. It's not the same as Bioware, but it makes it a lot easier for me as it's more linear. The door cycles cleanly through the first seven animation states and is in the perfect position after each one to begin the next. There's no set way to animate doors. Any method of animating and laying out the keyframes will do-- but some won't export as nicely as you'd like and will require clean-up later. When I animate, I set a key at 0. Then I toggle it to auto key and move along in a set method I always follow that fits perfectly in the 100 frame default (not that it's hard to add more frames, I'm just super, super lazy...)

I allow 20 frames for each major animation. 2 frames for each "at rest" state. A small handful for the die animation. So, 0-20 for opening1, 21,22 for opened1, 23-43 for closing1, 44,45 for closed, 46-66 for opening2, 67,68 for opened2, 69-89 for closing2, 90-96 for die, 97,98 for dead, 99,100 for trans (which comes later. Do not put keys down for trans now.)

Now add the animations to your AuraBase. I've found the simplest way is to first select your Clasification. In our case, that's "door". Then the animation name list below is pre-populated with ones you may need. Then, just click the New anim button and instead of typing in the name for the animation, select it from the animation name list drop-down. It will change the name of your new animation automatically. Then, just type in your start and stop frames for the given animation. Make sure the Use This Anim box is checked. Do that for all the animations. Go ahead and do the trans animation as well, even though we don't have any keys down for it. If you use the same structure I do, it'll be frame 99 to frame 100.

  The door with full animations (besides the trans animation, which comes later) -- Note that there's actually no way to get the animation list in the roll-out when something besides the AuraBase (in this case the dummy so you could see the animation keys) is selected. That took a little Photoshop cut-and-paste magic.

The *WK AuraBase

Follow the same procedure we used to make the initial AuraBase helper. This time, however, name it t_door12_DWK instead. Under the modify tab, be sure to select Door for the classification type.

Creating and Naming DWK Meshes

A DWK is simply a mesh that tells the game where a player can't walk. Without it, you'd have people walking right through doors and it'd be all kinds of anarchy. DWK meshes are unique in that the game engine doesn't use all of the "walk" meshes at once as it does with tiles and placeables. DWKS have a specific naming convention that the game uses to pull whichever DWK represents the current position of the door.

We'll need a DWK mesh for the closed position, and one for each of the opened positions. I've found a very simple way of creating these when dealing with simple shaped doors like our tutorial door. Scrub your animation to the point that the door is in one of its fully opened positions. Click on the door mesh itself. Make a note of its name. Under the Edit menu, use Clone to Copy clone the door mesh. Use Hide by Name under the display tab to hide your original door. Select the copy. Then, click the Unlink Selection button in the top toolbar. This will remove any dependency the mesh had and remove it outside of any animation. Repeat this for the other two door positions.

Once you have all three DWK meshes created and unlinked, name them as per NWN standards. The naming convention for generic doors always begins with the doors number. In our case (if you recall) we're making t_door12. So, our DWKs will all begin with 12.

  • 12_DWK_wg_open1 - The DWK for the door when it's in the opened1 position
  • 12_DWK_wg_closed - The DWK for the door when it's in the closed position
  • 12_DWK_wg_open2 - The DWK for the door when it's in the opened2 position

Once you've finished naming them, Parent all three DWKs to the t_door12_DWK AuraBase helper we just created.


The Sam Mesh

Easily the most difficult part of door creation to get correct as far as I'm concerned. The sam mesh is what ultimately creates the blue semi-transparent plane that you see when you mouse over an open doorway with an active transition link. To start our sam mesh, we'll first make a plane the same height and width as our door. Create a second one, but this time flip it around 180 degrees so it covers the backside of our first one. Attach them into a single mesh. Obviously, name it "sam". Parent it to the t_door12 AuraBase. Apply an AuraPoly modifier to the sam mesh. In the modifier roll-out, go to the very bottom. Set the Self Illum. Color to a nice, rich blue with a teeny hint of purple. Something like Red: 95, Green: 0, Blue: 180, with the whiteness slider pulled all the way to the top should work. Just above that, set the Alpha to 0. Turn Auto Key on again and set a key at the beginning of your timeline and just before and (if anything comes after) just after where your trans animation will be. In our case, we'll put one at 0 and 98. If you don't know, to set a key for just the AuraPoly alpha alone, make sure AutoKey is on and scrub to 0. Click the Alpha up a notch then back down to 0. Move to frame 98 and do the same thing. You should see keys appearing. Now, move to the trans animation frames (in our case, 99 and 100.) One each of them, set a key by moving the alpha value to 0.25 for each of the frames (to set a key you need something to change, so sometimes you'll have to change it from .25 and then change it back to get a key set on a particular frame.) Sometimes just to be on the really, really safe side I set 0 alpha keys at the beginning of each animation and on the rest states (as seen in the picture below.) Okay. Trans animation done.


The Positioning Dummies

The positioning dummies relate various necessary information to the game such as where the character attacks the door, what X,Y coordinate to grab at when opening/closing the door, and other things that generally make the characters look like they're actually interacting with the door correctly. Here's a list of the dummies, the coordinates I put them at, and (for the ones I have some idea about-- but all are just a best guess) what they do. Some of them I'm convinced do nothing at all as pcs interact with the door the same without them. It seems that any "use" nodes in doors and placeables aren't being used by the game engine for some reason. This could be a bug, of could be fucntionality they simply haven't had time to add yet. As it stands now, the player tries to get within a certain distance from the root node to use a door/placeable regardless of whatever use/positioning nodes are present.

  • 12_DWK_dp_open1_01 -  X -30, Y -190, Z 0  - The general area the character interacts with when reaching for the door in its opened1 position.
  • 12_DWK_dp_closed_01 -  X 80, Y -40, Z 0  - The general area the character interacts with when reaching for the door in its closed position from the open1 side.
  • 12_DWK_dp_closed_02 -  X 80, Y 40, Z 0  - The general area the character interacts with when reaching for the door in its closed position from the open2 side.
  • 12_DWK_dp_open2_01 -  X -30, Y 190, Z 0  - The general area the character interacts with when reaching for the door in its opened2 position.
  • T_Door12grnd -  X 0, Y 0, Z 0  - The ground level. Go figure.
  • T_Door12impc -  X 0, Y 0, Z 175  - No idea whatsoever.
  • T_Door12hhit -  X 0, Y 0, Z 225  - The spot your character whacks at when it attacks the door.
  • T_Door12head -  X 0, Y 0, Z 250  - If the door had a head, I guess this is where it'd be.

Hopefully Bioware will provide some specifications regarding exactly what the above dummies do. Until then, there they are... just like in the standard Bioware doors.

As far as linking them goes: link all the ones with DWK in their name to the t_door12_DWK AuraBase. Link the rest to t_door12. Like the DWKs themselves, these *_DWK_* positions change given the current state of the door. Therefore, the need to link them to the *_DWK AuraBase.

If you're doing double doors or doors that split up in any other fashion, you can create multiple DWK_dp_open1 and DWK_dp_open2 points by simply increasing the number. So one part on the open1 position would have a 12_DWK_dp_open1_01 dummy bside it and the other part would have 12_DWK_dp_open1_02 beside it.

Make Some Fireworks

In theory, the door will be in functioning shape now. We only need to give it a little action when the thing is destroyed. That's done in the form of an emitter. Simply create a new explosion emitter. Position it in the center of your door (X 0, Y 0, Z 150). Rotate it outward towards the open1 direction. You can use any number of emitters to get the desired results. My settings are as follows:

Start Color=A light brown

Start Alpha=1

Finish Color=A light beige

Finish Alpha=0

Allow Colour Tinting=checked

Start Size=4

Finish Size=1

Lock Y-Axis Anim to X-Axis=checked

Start Frame=0

Finish Frame=24

Random Start Frame=Unchecked

Render order=0


Birth Rate=10

Life Exp=2.5

Affected by Wind=Unchecked



Blast Radius=0.2

Blast Length=0





Random Velocity=0.5




Inherit from emitter=selected

Inherit Velocity=Unchecked


Apply 2-sided textures=checked

Render Style=Normal

Blend Mode=Normal




Don't forget to link that bad boy to the t_door12 AuraBase. Now, getting the emitter to fire isn't unlike what we did to get the sam mesh to appear on the trans frames. Get into Auto Key mode and set keys with a detonate value of 0 by toggling it back and fourth betwen 1 and 0 in frames 0, 89, and 91. Then set a key with a detonate value of 1 in frame 90. Now it'll trigger a detonate action when the die animation is played-- which is exactly what we want.

Exporting the Model

One last bit of parenting to do and we'll be good to go. Take t_door12_DWK and parent it to t_door12. Now that everything is under t_door12, simply select it and go to its modifier panel roll-out. Open up the Active Sanity Checks in the roll-out and uncheck the sanity check that says Weld to Nearest cm --that thing is nothing but trouble and the scripts will refuse to export your door for sure. Once that is unchecked, click the Export Model+Amin button. That should create a t_door12.mdl and a t_door12.dwk file in your export folder (which should be set to the override directory.) If it gave you a script error instead, you've done something wrong. Don't do wrong things.

Part 3: Getting It Into the Toolset (and the Game)

Extracting Files with NWN Viewer

Open Zoligato's NWN Viewer. File -> Bif -> Neverwinter Nights. Scroll down the Bif List until you see "data/2da.bif" (it'll be right at the top) and click on that. Below in the File List, locate "genericdoors" with 2DA file type. Right-click on that and choose "Extract files(s) to..." and save it to NWN's override folder.

Close Zoligato's NWN Viewer

Edit the .2DA File

Open the genericdoors.2da file in a text editor. Copy the Metal door line (line 5) and paste it at the bottom. Change 5 to 11, Metal to New, and T_Door06 to T_Door12 --don't worry about the STRREF in the Name column. The appearance type will say "Metal" so we'll just make a note of that for when we're making the ERF. Save the .2da file.

Start the Neverwinter Nights Toolset and create a new area. City Exterior will do nicely. Place a House. Select one of the generic doors and add it to the house. Right-click on it and select properties. In the appearance drop-down, you should now have multiple instances of "Metal". Select the one that looks like your door and press OK. Now right click on the door again and select Add to Palette and alter everything to suit your new door. Click "OK" and the game will confirm that it added your new instance to the palette. Under the Custom side of the Doors palette, find your new door. Right-click on it and export to create your new ERF file. Name it "new_door.erf". Now start using the door as normal. To test it out, create another house with a standard generic door and create a transition between the two. Save the module as "door test" so you can see your door in action.

Part 4: Finishing Up

Test the Door

Run Neverwinter nights and choose the "door test" module you made earlier. Try opening the door, closing the door, mouse over the doorway when it's open to make sure your sam mesh appears okay to highlight the transition area (make sure you created a transition from one door to another when building the module-- if not, the sam mesh won't appear even if your door was constructed 100% correctly.) If you followed the steps above correctly, you'll see that your new door is in the game and working fine. Now hak the crud out of it to make sure that it dies correctly and the emitter fires.




At this point you can either .hak up what you've done and call it a day, or leave everything in your override folder and continue down to parts 5 and 6. There, you'll learn about turning your new door into a tile-specific door and readying a tile so it will automatically appear with the door when painted down in the toolset.

Compile the HAK

Open the NWN Hak Editor (nwnhak.exe is in the NeverwinterNights/NWN/utils folder)

Right-click inside the empty resource window and choose Add. Navigate to the override folder and add the following files:





Set the Title, URL, and Description to whatever is relevant to your new tile (in our case, we'll title it "A custom door".

Under the File menu, choose Save As... In NWN's hak directory save your file as door01.hak

Move the files you added to the .hak from the override directory. The override directory should only be used for testing and you should never leave your work files there for good.

Distribute and Enjoy

Distribute your .hak in any way to see fit to whoever you see fit to distribute it to. I'd suggest making a ZIP file that contains the .hak as well as a ReadMe.txt file that contains a description/instructions for your door.

Part 5: Editing Files for a Tile-Specific Door

Extracting Files with NWN Viewer

Open Zoligato's NWN Viewer. File -> Bif -> Neverwinter Nights. Scroll down the Bif List until you see "data/2da.bif" (it'll be right at the top) and click on that. Below in the File List, locate "doortypes" with 2DA file type. Right-click on that and choose "Extract files(s) to..." and save it to NWN's override folder.

Edit the .2DA File

Open the doortypes.2da file in a text editor. Copy a line that most closely sounds like the kind of door you want (it'll save time editing more properties than necessary later in the toolset.) Let's say we want a big, heavy door. Something like a castle door... and we want it for a custom tile we're doing in the City Exterior tileset. Well, it just so happens there's a castle door on line number 44. Copy that entire line and paste it on the end of the list. Alter 44 to be the next number in the sequence. Right now, that looks to be 69. The label doesn't matter. I changed mine to SuperDoor. Now, the model name doesn't have to adhere to these strict formats you see in the 2DA. For that matter, we can just put in t_door12 as our model name and use the door we made above. Make sure the prefix of the tileset you're custom tile you made this door for is in the next column. In our case, that's TCN01. Leave the TemplateResRef the same. If you want to get really ambitious, use an ITP editor and create a custom UTD file for your custom door-- that's what I do. But, most think it's too difficult so we'll stick with altering properties in the toolset by hand for the purposes of this tutorial. StringRefGame can be left the same. BlockSight and VisibleModel can usually be left the same. If you've got a glass door or some sort of invisible door, then you can change these accordingly. For the SoundAppType, pick the same number SoundAppType as an exising door in the .2da file that you think best matches your new door.

You're finished setting up the new tile-specific door. Now continue on to the step below to set up the tile to automatically load your door when the tile is painted down.

Part 6: Adding a Door Point to a Tile

Edit the Tile MDL File

Simply add a dummy node to your tile to get it ready for a door. The dummy node needs to be named the same as the tile with *_D0X appended, where X is the number of the door your adding. So if you're adding a door to the tile TCN01_O02_01 you'd call your new dummy node TCN01_O02_01_D01 for the first door, TCN01_O02_01_D02 for the second (if you want another), and so on... The position of these dummies means nothing. You specity the X, Y, Z, and Orientation value for the door(s) in the .set file.

Edit the .SET File

Extract the desired .set file with NWN Viewer into your override folder. Open the .set file in a text editor. Continuing our example from above, do a search for TCN01_O02_01 in the .set file to find the [TILExxx] entry for our tile we want to add the door to. For our tut, it finds [TILE45]. Look below in that entry for Door=0. If we're adding one door, we'll change that to Door=1. Now, just below the [TILE45] entry create a new entry like this:







Note that even though this is the first door, we still use DOOR0 in the tile entry header as the .set file always counts from 0 in that regard, not 1. Type=0 is for a generic door jump point. If you do not have a tile-specific door and want people using the tile to be able to select any one of the standard doors to use, leave it at 0. If you have a tile-specifc door you want used with this particular tile always, then change that number to reflect the ID number for that door in the doortypes.2da file. In this example, we're using 69 because that's the line we added. X, Y, and Z are obviously our X, Y, and Z coordinates where we want our door. You can change the orientation to point your door in whatever direction you want (usually necessary.)

Save the .set file and fire up the toolset. Create a new City Exterior area. Paint down the Market 1 feature tile. If you did everything correctly, an instance of your new door should have painted down instantly in one corner of the tile. Looks very lame sitting there in mid-air, I know. But now that you know how to do it the sky is the limit. At this point in the tileset you can right-click on the door on the tile and alter its properties (since we're using another door's TemplateResRef) so it has the name, description, hardness, etc... that you want for it.

Now you know that it works, so at this point .hak it up and get that clutter out of your override folder.



Okay, so it's not textured and it doesn't do anything super fancy. But once you get the fundamentals down there's no limit to what you can do with custom doors. Imagine this: A Stargate-like portal. Simple enough to do with a tile-specific door for a custom round portal tile. The closed animation would simply be no door present. The opening1 and opening2 animation could include emitter fountains to create a sploshy effect like the actual stargate from the TV show/movie. Even the pesky trans animation would come in handy-- when moused over the portal could shimmer and reveal an image of the world beyond... Anyway, just an idea. Again, there are tons of things you can do with doors and we've just barely scratched the surface.

I'm including the custom door and files edited/created in this tutorial. They're in the "" file in the "files" directory. You can check your work against them to help pinpoint the exact moment you're better than me at making doors... shouldn't be too long.

Email me if you have any suggestions on additions to this tutorial or portions which are incorrect and need to be changed. Unfortunately, my work schedule does not allow me to answer every e-mail along the lines of "I tried your tutorial and my tile doesn't work. What am I doing wrong?" When it comes to custom door creation and animation, it's a very complex process. There are literally hundreds of things that could go wrong through the entire process. If you have a good knowledge of MAX, the best advice I can give is to go through the tutorial again from scratch, don't stray or do anything different, and you should be a-okay. If you don't know MAX well enough to follow along and not be horrified when you see that the tutorial doesn't step-by-step you through every little aspect of the animation, then I suggest working through the tutorials that come with MAX. If you do, all of the above MAX steps should be pretty easy.

Mr. X

Migrate Wizard: 
First Release: 
  • up
  • down