Grimlar - Guide To Secret Doors
Grimlar - Guide To Secret Doors
It is assumed that you have a basic understanding of the NWN scripting language and are somewhat familiar with the Aurora Toolset, i.e. you know how to create an area and place an object in it. If this isn't the case, please go and have a look at Celowins scripting tutorials and Bioware's module construction tutorial first.
What's The Problem?
You want to place a secret door in your module but you aren't quite sure how or perhaps you just want to check what you've done.
How Does It Work?
The Aurora toolset provides four placeable objects (standard placeable object palette, 'Miscellaneous Interior' section,) that between them provide the triggers and doors of both secret trap doors and hidden doors in the wall.
The triggers are invisible objects that check any player who comes close to see if they can see the hidden door. If the PC passes the check, a new door object is created where the trigger was.
When the door is used, it teleports the player and henchmen to a new location marked by a similarly named waypoint.
First we will need an area to work in, something like a 4x4 Castle Interior should be sufficient, although you could just as easily use 8x8 if you would like a little more space. Once that is created, lay down some standard floor tiles with a few corridors to give some variety.
Creating a secret trap door passage
1) First place a 'Hidden Trapdoor Trigger' object in the place you want the secret trap door to appear. The direction the trigger object faces is important because the door that is created will face the same way. Don't forget that if you need to, you can right click on the trigger and select 'Adjust Location' from the popup menu to access a little window that will allow you to set both the position and the direction the trigger is facing.
2) Next, right click on the trigger object again and select 'Properties' from the popup menu. On the 'Basic' tab, change the Tag to say something different, for example 'My_TrapTrigger1'.
3) Next, with the properties window still open, select the 'Comments' tab, here you will see a little bit of information that Bioware has provided about how the object works. Don't worry, we will cover everything here anyway, but you should be aware that this information exists. 'Ok' the property window to save the changes.
4) Next open the standard waypoint palette, and select 'Waypoint' from the 'Waypoints' category, place this where you want the PC to emerge from the secret tunnel. Note that the direction the waypoint is pointing is the direction the PC will be facing when they emerge, so you may wish to change where its facing.
5) When that is done, right click on the waypoint and select 'Properties' and change the Tag to 'DST_' followed by whatever Tag you gave the trigger. So for the example given before, the Tag would be changed to 'DST_My_TrapTrigger1'. 'Ok' the property window to save the changes.
6) Build and then Save the module and test the new tunnel.
i) The tunnel is one way only. In order to have a two way tunnel you must repeat the steps above, placing the entrance of the second tunnel by the exit of the first, and the exit of the second tunnel by the entrance to the first.
ii) The check to see if the door has been found is performed every game heartbeat, the search skill for every PC in range is compared and then only the best value is used to see if the door is found.
iii) The number in the 'Reflex Save' box on the 'Basic' properties page indicates how close the PC has to be before they can find the secret door. Increasing this number too much can cause the door to be found too early. Also, a large check radius, means that more PC's may be checked, potentially slowing the game down a little.
iv) The number in the 'Will Save' box on the 'Basic' properties page indicates the level of the search skill difficulty check that the PC must pass in order to find the secret door. Since most PC's will have few, if any, points in their search skill a value of more than 20 may prevent anyone finding the door except for rogues and bards.
v) The 'Hidden Trapdoor Trigger' object should have the script 'nw_o2_dttrapdoor' in its 'OnHeartbeat' event, and the 'Hidden Trapdoor' blueprint should have 'nw_o2_trapdoor' in its 'OnUsed' event.
Creating a secret wall door passage
The process for creating a secret wall door passage is virtually identical to the steps outlined above for a trap door with the following few exceptions.
1) Obviously you use a 'Hidden Wall Door Trigger' instead of the trapdoor trigger.
2) You may wish to make the Tag you give the trigger indicate its change in purpose, ie 'My_WallTrigger1'.
3) The waypoint is placed in the same way as before, except that the Tag you give it should reflect whatever Tag you gave the trigger. For the example given, the Tag would be 'DST_My_WallTrigger1'.
i) All of the notes about trap doors apply to wall doors aswell, except that the 'Hidden Wall Door Trigger' should have the script 'nw_o2_dtwalldoor' in its 'OnHeartbeat' event, although the 'Hidden Wall Door' blueprint should still have 'nw_o2_trapdoor' in its 'OnUsed' event.
ii) It is possible that 'nw_o2_dtwalldoor' doesn't exist in your installation of Neverwinter Nights. If this is the case, don't panic. What we need to do is rename a copy of 'nw_o2_dttrapdoor' and make one simple change.
Follow these steps:
a) Select 'Tools' from the main menu, and then 'Script Editor'.
b) When the script editor window has opened, use the third icon from the top left to 'Open an existing file', you should see another window called 'Select Resource' open.
c) At the bottom right of this window you should see a box called 'Resources to Show', click on the option that says 'All Resources'.
d) The main window should now fill up with the list of all the scripts Bioware has included in the game. Type 'nw_o2_dttrapdoor' into the box that says 'Resource Name:' next to it, and click on 'Open'.
e) At the top of the script editor window, the fifth icon from the left should be the 'Save As' icon. Click on this and a 'Save Resource' window should open. Type 'nw_o2_dtwalldoor' in the box called 'Resource Name' and click on 'Save'.
f) You may get a warning message about a conflict with a reserved namespace, this is just Bioware reminding you that they sometimes start their script names with 'nw_' and that its not a good idea for you to do the same. However this time this is exactly what we need to do, so click on 'Yes' to proceed.
g) Finally, in your script, look for the line that says:
and change it to:
Click on the top left icon to 'Save and Compile', and that should be it.
Exit the script editor, build and save your module and try it out.