Вы находитесь на странице: 1из 184

INTRODUCTION

Thank you for taking the time to download this manual and I sincerely hope that it will
aid you in whatever you are trying to achieve with Obsidian's masterpiece Neverwinter
Nights 2 and the Electron toolset Engine.
Neverwinter Nights 2 gives you all the tools you need to build your own modules,
campaigns, and adventures - create buildings, terrain, script encounters, write
dialogues, create quests and items - everything you need to create an epic adventure of
your own is included in the toolset for you to use.
I started collecting information on every aspect of module building and kept track of the
questions frequently asked on the Bioware Toolset forums and the answers provided to
these questions every since the Toolset was released (pre sale).
I hope that this manual will aid the absolute beginner and also give some helpful tips to
the experts of the toolset.
Within the manual I have given kudos to those that have provided tutorials and answers
to all of our most requested questions.
If
you
have
any
queries
http://www.nwn2toolset.com .

or

questions

then

please

visit

us

at

CREDITS
OBSIDIAN For making a great game and including a toolset that enables us to make
great games, custom content, etc Plus I have used some of their help file content
here as there was no point in reinventing the wheel.
HELLCOW Valueable member of the Toolset Tutorial team.
GILTHONYM For allowing me to use some of his content on my toolset site and also in
this manual. Download his great beginners guide called Dont Panic, which can be
found here: HTTP://NWVAULT.IGN.COM/VIEW.PHP?VIEW=NWN2TUTORIALS.DETAIL&ID=14
FRECKLER SMOKER Writing up a great guide on light placeables.
Bioware Forum Users Especially those that help other users out, with all their
questions.
Mcmillanjj writing up a great how tos on plugins.
Brother Amos for his water tutorial.
Kal_Agrim for his instructions on how to add a key to your module.
Montgomery Markland from Rogue Dao Studios Inspiration behind the World
Map plugin tutorial and the How to make a cutscene tutorial.
Celestian For the create your own companion tutorial.
Soulraven666 from nwn2mods.com For the How to create cliffs tutorial.

Celowin For the scripting tutorial which was released for NWN1, which I have updated
for NWN2.
Veragoan For the waterfall tutorial.
Lorft For the how to add a texture tutorial.
SCARLETTHORN For the Voice Over Tutorial.

TABLE OF CONTENTS
Chapter 1 The Interface
1.1 Toolset Controls
Chapter 2 Modules
2.1 What is a Module
2.2 Loading a Module
Chapter 3 Areas
3.1 Making your first area
3.2 Placing a Starting Location
3.3 Terrain
3.4 Texturing
3.5 Water
3.5a How to create a waterfall
3.6 How to add grass
3.7 How to create cliffs
3.8 Day & Night Settings
3.9 Area Properties
3.10 Walkmesh
3.11 Interior Area
3.12 Baking
3.13 Exploring Your Module
Chapter 4 Creatures
4.1 Create an NPC
4.2 Encounters
4.3 Create your own custom encounters
4.4 Create your own companions
Chapter 5 Placeables
5.1 How to add a Placeable
5.2 Equip a Placeable
5.3 Light Placeable
5.4 How to add a Sign
5.5 Bridges
5.6 How to place a door
5.7 How to make a prefab
Chapter 6 Items
6.1 What is an Item?
6.2 Creating an Item Blueprint
6.3 Creating an unequippable Item
6.4 Creating Equippable Items Weapons
6.5 Creating Equippable Items Armour
6.6 How to make a key
Chapter 7 Sounds
7.1 How to add sound
Chapter 8 Triggers & Waypoints

8.1 New Area Transition


8.2 Walkmesh Trigger
8.3 Waypoints
Chapter 9 Merchants
9.1 Create a Store
9.2 How to create a custom Store
Chapter 10 Conversation
10.1 Conversation basics
10.2 Anatomy of a conversation
10.3 Conversation scripting basics
10.4 Writing a conversation
10.5 How to add a cutscene
Chapter 11 Scripts
11.1 Where scripts go
11.2 Variables
11.3 Conditionals
Chapter 12 Plugins
12.1 Install a Plugin
12.2 Why Author a Plugin
12.3 Create your first plugin
12.4 Visual Effects Editor
12.5 World Map
Chapter 13 Custom Content
13.1 How to add a texture
13.2 Make your area transitions to use your own world map
13.3 How to do your own Voice Overs
Appendix A Classification Codes

Chapter 1: The Interface


The whole toolset layout:

The Menu Bar

The menu bar is in the top right hand corner and comprises of File, Edit, View, Plugins and Help.

File

From the File menu we can create a new module, area, conversation or script, save our module, bake the
module, import/export, etc.
Edit

The Edit menu allows you to Undo/Redo your last action plus Cut, Copy and Paste. Please note that at
the time of writing the Undo/Redo function will not work on a lot of what you do within the toolset.
View

View menu allows you to look at the module properties, factions, 2da files, the current mode you are in
and options (more about these later in the manual).

Plugins

The Plugins menu as you can see above includes Process, Campaign Editor, Universal Blueprint Changer,
Visual Effects Editor and World Map Editor.
Please see the section about Plugins to find out more.
The Toolbars
1. Grid. This will toggle to grid which is handy for seeing the region grid and border grid.
2. Occlusion Grid. This toggle shows the border area marked in red. Good for seeing where the
border area starts without the grid visible. Remember characters can not enter the border area
so this will help indicate the end of the walkable area.
3. Surface Mesh. Shows the surface of the map that can be modified by the Terrain tools. Each
line intersection can be adjusted in height. This will be covered in more detail in the terrain
tools section.
4. Baked. This is for level baking which will be covered in the Baking section.
5. Shadows, Water, Bloom, Fog, Sky. These toggle the various map features and are mostly for
help during map creation. The water toggle for example is handy when you want to paint
terrain under a lake and need to temporarily see what you are doing! These toggles do not
affect the terrain in any way in the game engine.
6. Use Area Far Plane. This is used in conjunction with the Fog settings (Farclip, FogEnd,
FogStart) in area lighting. It will clip the view to where the game will stop drawing objects
(Farclip). Useful for determining what players will see at different locations on a map.
7. Normal Mapped Terrain. This toggle shows the terrain using either the basic ground textures
or the normal mapped ground textures. Normal mapped textures are similar to bump mapping
in that they show shadow detail based on how the light hits them. For lower end systems
normal mapped textures can be turned off so this toggle allows you to see what the terrain will
look like on those systems.
8. Day/Night. Allows you to select which of the 7 day/night settings to display your map in.
Default is used for maps that have no day/night cycle. Lighting will be covered in more depth
in the lighting sections.

1. Filters: Show/Hide. The Show/Hide dropdown toggles the various map objects on and off.
This is handy for map making to remove various elements for ease of editing. As an example
you might want to remove trees from the map so terrain painting would be easier. This is
strictly for display and the objects never actually are deleted.
2. Filters: Selection. A very important dropdown that filters what objects you can interact with.
When there are many objects on a map but you are only adjusting lights for example you can
turn off selection for all other types. That way you wont accidentally move or delete something
else. The editor has no undo function as of this writing so use the selection dropdown as a
precaution.
3. Snap. Used for doors so they will snap into position at the doorframe correctly.
4. Select Objects. The main mode for selecting the various objects on a map.
5. Paint Objects. When you are painting objects this mode will be automatically selected. When
you are done painting objects hit ESC and you will return to Select Objects mode.
6. Select Terrain. Allows a tile to be selected. This is handy when working with water or

checking texture usage.


7. Paint Terrain. Mode for painting terrain, textures, water, or grass. This mode will be
automatically selected when using those tools. The color of the brush will match the tool button
color. If you wish to return to object selection, select Select Objects
8. Tiles. Used for Interior maps, see that section for more details.
9. Drag Selection. Marquee selection toggle. If you wish to click-drag a bunch of objects you
can use this toggle option. Its recommended to have this option off during normal use so you
dont accidentally select more than one object.
Area List/Conversation List/Script List
Tabs at the bottom select which list you are viewing. Double-click on any area, conversation, or script
name in the list to open it.
Area Contents
Lists all of the components of the currently selected area, if any. Components include items, creatures,
triggers, placeables, and more.
Area Viewer
Shows what the area looks like. You can modify terrain and textures, place objects, etc. through the Area
Viewer.
Property Panel
Shows properties for the selected object. The Property Panel contains many tabs (Basics tab, Skills tab,
etc.). If you select an object in the Area Viewer (5), Area Contents (4), or Specific Blueprints (8) section,
its properties are shown here.
Blueprint categories
Blueprints are templates for any object that can be placed in an area. Note that the Area Contents section
(4) has the same options. Blueprints include all global content as well as local templates you might create.
Note: If you click on a blueprint, its properties automatically appear in the Property Panel. You can
right-click on a blueprint to see its properties in a new window, but this process can be slow and no more
than 3 property windows can be open at any time.
Specific Blueprints
This section is similar to the Area Contents, but lists all available objects, not just those placed in the
current area. For example, this section would let you select a goblin, while the Area Contents section lets
you select a specific goblin that you have placed.
Tabs
To switch from Blueprints to the Terrain (exteriors) and Tile (interiors) tabs.
Note: If you play around with your interface, and you want to revert it to the default appearance, follow
these instructions from the Obsidian documentation:
Preferences for the toolset are stored in C:\Documents and Settings\<username>\Local
Settings\Application Data\NWN2 Toolset
If you renamed or delete that folder, your settings will return to their defaults.

1.1 Toolset Controls


General
Right-click toggles between Select/Paint for objects and terrains.
Object Manipulation (Creatures, Placeables, Effects and Trees)
To move an object on the X/Y: Directional arrows (or Alt+Arrows)
To rotate objects: (Cant rotate trees)
Mouse: Select the object(s) then hold down shift + right click drag
Keyboard: Ctrl+Left/Right Arrow
Raising and lowering objects:
Mouse: holding down alt while moving the mouse forward and backward quickly raises/lowers an
object
Mouse (precision): Shift + Mousewheel
Keyboard (precision): PageUp/PageDown
To make an object stack atop another placeable, hold down S while placing it.
To drop an object to the ground, press Space
To hold a placeable in place without actually placing it, hold down CTRL
To lock a placeable into an x-y position: L
To lock a placeable into a z position (height): Z
Camera Controls
Panning movement of the camera on the x/y plane: Hold (Control + Left mouse) and drag
Rotate the camera: hold Control + right mouse and drag
Rotate the camera: press middle mouse button or wheel and drag
Adjusting the camera height: Ctrl + Shift + Vertical Mouse Movement
Zoom in/out: roll mouse wheel
Interior Tile Placement
Rotate tiles: Left & Right arrow keys
Switch between tile variants: Up and Down
Copy a tile: with a tile selected, Right-mouse will copy it

CHAPTER 2: MODULES
2.1 WHAT IS A MODULE?
Modules (.mod files) contain all the elements of a complete Neverwinter Nights 2 adventure. A module
with one area is the most basic playable adventure, with a typical short adventure being a module of
several areas and events. A truly epic adventure (such as the official NWN2 campaign) links several
modules together.
To create a new module, simply open the toolset. When it first loads it should look like the screen below.
A new, empty module is now ready to be made.

2.2 LOADING A MODULE


Should you wish to continue working on an existing module, you can open your saved module through the
Dropdown Menu: File - Open.

This Open function brings up a window where you can browse your computer for the module. The default
directory is the Modules directory in your Neverwinter Nights 2 game folder. Files with a .mod extension
are valid module files.

Chapter 3: Areas
3.1 MAKING YOUR FIRST AREA
When you first open the toolset you will already be in a blank module, which you can start to work on
immediately.
To create an area click on File - New - Area

On the next screen you will be able to give the area a tag (Make it unique) and also you will be able to
choose between Exterior (terrain) or an Interior (tiles)

The next screen allows you to choose the size of the new area by either choosing the size on the right hand
side or by moving the sliders on the left hand side and/or bottom.

Sizes:
Tiny = 4 x 4
Small = 8 x 8
Medium = 16 x 16
Large = 24 x 24
Giant = 32 x 32
Exterior tiles are 10m square. Interior tiles are 9m square.
Now click finish and your area is ready to build on.
TIP
You can also get to the Area Wizard by clicking on right clicking on the screen under the Area List on the
left side and then left click on Add.
When we click on finish lets have a look at the white lines in the grid. This is the boundary of your area.
Anything you make outside of these white lines will just be background, and the player won't actually be
able to go there.

3.2 PLACING A START LOCATION


Before we start make sure that you have your module open and an area available in your Preview area.
Next click on the Set Start Location button, which is located in your Filters toolbar:

If you move your mouse cursor over the preview area, you will see that it will change to a cross. All you
need to do is to left click in the area that you want the player to start in and you will see a symbol in your
area, which will be displayed like:

As you can see there is a point in circle and this is the direction the player will face when they enter the
module. To change the direction you can either click on the Rotate 45 degree left or right:

or you can use the left and right arrows to move the location or Ctrl + Left/Right arrows to rotate or if
using the mouse then hold down shift + right click drag.

3.3 TERRAIN
The first thing you probably need to do is to get a piece of paper and a pencil. Start by drawing a sketch
of the area as there is nothing worst that sitting at the toolset and wondering what to construct.
Once you have an idea of the area you want to make, start thinking about the textures that are going to
be used.
In particular the global texture, to change the global texture, click on the Terrain tab in the Blueprint pane
and then click on Texture:

After clicking on the Texturing, you will see in the middle of the Terrain pane a section called Terrain
Texturing:

Left click on the terrain you want to be the "global terrain" and then click on the Fill button. You will then
be presented with a warning "Are you sure you want to fill the entire area?". Click OK and the textures will
be swapped.

Shaping the terrain


Lets talk about the different tools that we have at our disposal before we actually do anything to our area:

The Environment Tools have 4 buttons as you can see above.

When you click on the Terrain button you will see the following tool pane:

At the top of the pane we have a section called Brush which has the following options:
1. Size. This is the area of the brush that paints at the full pressure setting. Indicated by the inner
circle of the brush. (from the Bioware forums I believe the sizes are in meters)
2. Outer. The drop-off of the brush. Indicated by the outer circle of the brush. A large outer
setting will make more subtle hills when painting terrain and more blended textures during texture
painting.
3. Pressure. In terrain building this will affect how extreme the sculpting of the terrain will be. For
subtle changes use a low setting under 20%. For texturing it controls how much the selected
texture mixes with the already painted textures. As an example if you have pressure set at 50% it
will mix the selected texture 50% with any other textures in the currently affected area.
Underneath these tools are predefined sized brushes from small (Inner = 1, Outer = 2), medium (Inner
= 6, Outer = 6), large (Inner = 10, Outer = 10) and lastly gigantic (Inner = 15, Outer = 15).
Next are the Terrain Tools:
The terrain tools allow sculpting terrain. You can paint hills, chasms, mountains, roads, etc. Its the basic
tool section for laying out your map.

Brushes
1. Raise/Lower. As the name suggests the brush will raise or lower the terrain in the selected brush
area. Use the pressure setting to control the level of adjustment. Lower settings are suggested for
fine control.
2. Noise. Adds a noise to painted area to break up flat sections of the map. Please note the tool
does not work across tile regions and can break sections. If this happens use the Smooth tool to
clear out disjointed tile regions.
3. Smooth. Smoothes out a section. Great for flattening out peaks or building terraced hills.

4. Walk/No Walk. Used in conjunction with level baking to control character movement on a map.
See Level Baking for more details.
5. Flatten. This control has Height instead of Pressure and will force the surface mesh to flatten
at the set height. Used with the Eyedropper tool allows good control on maps you have much
elevation changes.
6. Color. Used to tint the ground textures a certain color. Very useful in adding detail and modeling
to existing textures. Using a medium brown to darken ground around water or in crevasses along
hills helps break up uniform patterns. Dont underestimate this tool! Great to use after texturing is
completed to weather a map.

Other Options
1. Flatten Under. By selecting a placeable object and pressing this button, the ground will flatten
to the base of that object. Good for use with buildings to match the ground to the floor.
2. Eyedropper. Used with Flatten to define a height level to flatten too. Very useful for making
terraced hills or raising sections of the map quickly.
3. Color. Used with the Color Brush to tint ground textures.
Now we know what the tools should do we can start to make changes to our flat surface that you can see
in the area preview pane.
The first thing we will talk about is how to raise the terrain in our area. I would suggest that you start by
going to the very top left or right hand corner of the area to test these tools and be sure you have the right
height.
Before you start, why not place a human NPC (Blueprints, Creatures, NPC and then choose say the
Commoner) in the area just so that you can get an idea of scale, etc..
Now to change the terrain make sure that you are on the Terrain tab within the Blueprints pane and the
Paint Terrain option is highlighted in the Filters toolbar (left click on it if it is not). Then move you cursor
over to the area preview and you should see your cursor change to a pen symbol and two circles will
appear (unless Outer brush is set to zero) like so:

Now left click on the area and keep the left click down until you get the desired height that you are after:

The next thing you might want to try is using the Flatten and the Eyedropper tool, so select the flatten
button and then the eyedropper button and you will see the cursor change to a cross hair. Now click near
the top of the raised terrain you have just created and this tool allows you to select the exact height you
are going to use as a default height for whatever you paint now. When you paint, you will get a sort of
flat-topped hill/plateau (see below for an example). Use this to lay out all of the raised terrain on your
map. You do not need to stay at this height you can raise the terrain on top of the hill/plateau and apply
the flatten and eyedropper method to build a second tier. You may also want to use flatten for
sunken/worn looking terrain, so that you can make a path of a road.

Now that youre armed with how to raise terrain, you can also use the lower button to drop the terrain so
you should be able to carve out the general appearance of your area. Do not worry about making mistakes
as you should go back over your areas to "fine tune" your environment.
If you want gentler hills then increase the outer brush size and if there are too many "flat" areas then use
the noise tool as that will add bumps in the terrain.
Use the smooth tool to reduce the harshness of your terrain. If you have jagged edges or a lot of cliffs
from the flatten tool you used earlier, smoothing is a good way to remove such harsh features that you
dont desire. You should also use the smooth tool to check the tile edges noise will sometimes cause
these not to match heights properly, and you can smooth these oddities out.

Size (From Gilthonym and Vance McFadyen)


Let's do an experiment: Set 'Size' to 6 and 'Outer' to 6. Then left click on the map and create a hill. Now,
change 'Size' down to 2. Create a second hill on the map next to the first one. They should look something
like this:

See how the first one has a flat top, while the second one is sharp. The smaller the size, the sharper the
hill.

Outer
Experiment number two. Change 'Size' back to '6' and set 'Outer' to 6. Paint a small hill. Then change
'Outer' down to '1' and paint a second hill next to it. It should look like this:

See how the hill on the left, the one with an 'Outer' of 6, is wider than the hill on the right, which has an
'Outer' of 1?
Vance has recommended setting the 'Outer' to double what 'Size' is so if 'Size' is 3, set 'Outer' to 6. This
looks nice. But play around with 'Size' and 'Outer' to get the terrain looking how you like.

Pressure
The third property, 'Pressure', is the strength of the effect on the terrain. The higher the pressure, the
greater the effect. Take a look at another of Vance's screenshots:

All three hills were made with 'Size' of 6 and 'Outer' set at 6. However, for the first hill, on the left,
pressure was set to 100%. For the middle hill, 50%, and for the third hill, 10%.
'Pressure' is very important it will heavily control the final effect! Also, the longer you hold down the left
mouse button, the more effect the brush will have. So hold down the button for strong effects, and just
click the button for fine tuning terrain.

Mountains
Vance McFadyen suggests for nice looking mountains, you create a plateau at about 1 metre, then
another one overlapping that a bit higher, and another one overlapping that a bit higher, until you reach
the desired height. Then use the 'Smooth' brush with a pressure of about 10% to smooth it all over. An
example final effect is shown here:

3.4 TEXTURING
In particular the global texture, to change the global texture, click on the Terrain tab in the Blueprint pane
and then click on Texturing:

After clicking on the Texturing, you will see in the middle of the Terrain pane a section called Terrain
Texturing:

Left click on the terrain you want to be the "global terrain" and then click on the Fill button. You will then
be presented with a warning "Are you sure you want to fill the entire area?". Click OK and the textures will
be swapped.

The Swapper tool is a nice feature in that you can swap one texture for another, but please be aware that
it works on a whole area basis.

To use the swapper tool click on the swapper tool button and you will see the following screen:

As you can see we have two sections: On the left hand side we have the find texture palette and this is
where we tell the toolset what texture we want to replace. On the right we have the Replace palette where
we inform the toolset, which texture we want instead. Again, this is an area wide change.
Before you start using texture it is best to have an idea of what textures you are going to use before hand.
The reason being is that each megatile (4 x 4 tiles) can only have 6 different textures. So before you start
go to an unwanted part of your area and test the different textures to see what you like. Do not forget that
the swapper will be an invaluable tool here.

That is fine but how do I "paint" a texture. Okay, say I want to make a well used trade route. Start by
lowering the terrain and get it to look something like this:

I used the lower terrain tool (Inner size 6, Outer size 2, with 25% pressure). Now I want to add a well
worn track look so whilst in the terrain pane I choose the colour button in the Terrain Tools pane:

I chose the light brown warm colour on the right hand side of the colour swatch:

I then paint the colour in the terrain that I previously lowered:

Then I hit the texture button and choose the TT_GD_Dirt_05 texture (to do this just scroll down the list in
the Terrain Texturing pane and left click on the texture you want):

Now paint the dirt over the light brown colour that we previously painted:

Now I want to add an edge to my road so I set the inner brush size to 2 and the outer to 1 and choose the
TT_GD_Dirt_07 texture and paint along the two edges of the road to get the following effect:

Another tool that is available that we have not mentioned yet is the Selection (Advanced) tab:

When you select a tile (In the Filters toolbar, click on select terrain) you will see all the textures that have
been applied to the tile. You can left click on any of these texture and it will then become your current
texture that you can then apply to the terrain. The order of the textures in the list has no relevance.
One thing to keep an eye one is stretched textures, which normally happens when you have steep raised

areas.
Do not underestimate the importance of the colour black as this can be used to create shadows within cliff
faces or nooks and crannies. Also if you say set the inner brush to 6 and outer to 2 for example and the
pressure to about 10% you get a more worn look to the texture instead of it being bright and not subject
to weather.

Tip from Renzatic of the Bioware forums


What I do is go for a terraced effect. I'll set the flatten tool to the max height I want the cliff to be (say 25),
knock out the shape I want it to follow, then start adjusting my height and brush radius for the ledges on
the way down (for example, start at 25, then go down to 21, then 18, and so on and so on).
You'll want to leave gaps at certain heights, too. That way it doesn't look like a giant set of steps. After I'm
done with that, I'll go ahead and start texturing. It's easier to do at this point since your edges are still well
defined and you can see what you're painting. Finally I'll use the raise/lower and smooth tool to blend it
all together. After that all that's left is tweaking to taste.
I use Grass09 as the base, and Cliff04 at 65% for the rock face. Then I dabbed Rocky02 at 15-20% around
to brighten up some of the rocks and keep everything from looking totally uniform.

Tip from Bloodsong of the Bioware forums


You know the Swapper button in the Terrain Texturing mode will search for a texture in your area and
replace it with another one, you can also do this on a local scale, tile by tile.
1: Select a Tile --go into select terrain mode, and click on a square.
2: Select a Texture Within It --look down at the Selection(Advanced) palette, where you see the
six slots per tile and the textures you have painted into that tile so far. click on one so it is 'pressed'
and highlighted.
3: Select a Texture to Swap In --back up in the normal texture-selection list, click on a texture. the
original texture in that tile is replaced with whatever you just clicked on. (remember, there's no
undo, so be careful what you test it with!)
BUG NOTE:
If you painted on the tile first, and then swapped a texture with a texture you have already used... you
may end up with a blank slot in the advanced texture selection buttons. When you try to paint a new
texture on your tile, you'll get black.
To fix it, you need to select the blank texture slot, and fill it with something. anything. Apparently, the
toolset can't shuffle the texture slots to collapse them when you use the same texture twice on one tile.

3.5 WATER
To be able to add water to our module, it is best if you dig a hole in the terrain or in other words lower a
portion of the land (go to the terrain button and click on lower), like so:

It may be best to use the smooth tool around the edges of the hole to get rid of the jagged edges. Now
click on the water button:

We have the same properties as far as the brush sizes are concerned:
a. Paint - Paint water down with the brush. The water will paint out to the Outer setting as there is
no falloff with water. While a tile is selected any changes to settings will affect all water on that tile
only. If you wish to update the water on another tile just paint there and that water will conform
to your new settings.
b. Erase - Erase water with the brush.
c. Eyedropper - Use the button to set the height you would like the water to be painted at. Useful
for filling in a lake and finding the height just by selecting the wanted waterline.
d. Import - Import previously saved water.
e. Export - Export your favorite water settings for use on other maps.

Underneath that we have some different options:

As you can see above we can click on the button beside color and we get a color palette and from here we
can choose any color we want our water to be.
Ripple- Adjust the level of ripple. X & Y can be independently controlled.
Smoothness - Adjust the choppiness of the water. From a violent sea to a frozen lake.
Refraction settings - Adjust the reflection level of the water.
Layers: Water has 3 composite layers, for better variation. Varying the parameters in each different layer
gives your water more complexity, hence better realism. Stagnating the parameters across all 3 layers
makes the water more uniform | peaceful | solid.
Under each layer you have Scroll Direction X: My guess: waves | noise | competition | sine waves on the
X-axis across Scroll Angle. Even water flowing at Angle 90 should have a little bit of Direction X, since no

channel is perfect.
Scroll Direction Y: As above. A large number with Angle 90 makes for a great wave effect for a wide river,
I found.
Scroll Rate: How fast the water is moving along Scroll Angle.
Scroll Angle: The angle at which water is traveling. 0 is no travel (a standing body). 90 travels east.
Texture: There are two textures for water. Texture 1 is a bit more active | noisy. Using 1 for all three layers
hence gives you noisier water. Using 2 for all three layers gives you more placid | broad | deep water.
Example by Brother Amos from Bioware Boards:
First, using a very large brush, I lower the terrain:

Second, I apply the cliff-texture to both the cliff faces as well as the bottom sea floor as shown (Editors
Note Maybe fill the cliff texture and add the grass texture).

Third, I laid down the default water as shown below:

Then I added my placeables as shown:

....stay with me, it still looks pretty ugly at this point....


Lastly, I selected a blue tint and started painting the sea floor, getting a darker and darker tint the farther
I go away from shore as shown

and

Please understand that this is a 10-minute rush job just to show the potential and overall BASIC look.
Further details like algae greens like the (rock-face placeables) to match their own mossy colors. And/or
beach sand textures can also be added as well as under-water details.
OH! And if while you are painting an area and you go "too heavy" - simply take a lighter tint (almost white)
and it will act like an eraser, then simply try again.
Try this....
Create your lower terrain with a wide brush (no need to add detailed terrain heights)
Paint down the "TT_GR_Cliff_04" texture wherever water will be...Add any rocks or other "grass/weed"
details as needed...
Go to terrain -> color; and select a medium blue, light brush pressure (around 15% ) and paint the
bottom...
Adjust tint darker (or apply more brush pressure) and make bottom detail that way. Finishing with small
brushed, heavy pressure, midnight blue areas being the deepest...
Add the water layer. If you cannot see the Water in the toolset do not forget to make sure that the Water
button in the toolbar is selected.
Water can only be at the same height within the same megatile. There is a plugin made by tani called the
Watermill v1.0 that allows you to add water at different heights within the same tile, which can be found
here:
http://nwvault.ign.com/View.php?view=NWN2PlugIns.Detail&id=45
From above, it looks like shallow and deeper water without having to create it manually with the terrain
height. Also with the very light ( almost white) base tint of the texture itself, its easy to control the tint and
makes a great looking "seafloor" for areas where docks are located ( say a busy port area of a city for
example ).

3.5A HOW TO CREATE A WATERFALL


In this tutorial Ill try and explain how to make a waterfall. Since there isnt a specific feature to making
waterfalls you have to use placeable effects to trick the player to thinking there is a waterfall here. Now Im
writing this assuming you have basic knowledge of the toolset and how to manipulate terrain and paint
textures.
To start, make a new exterior area. 16x16 is fine. Now, to begin we are going to make a lake. You will want it
to be about the size as one black square.. with the north edge of the lake meeting up pretty close to the top of
the black square since water heights can only be different in each black segment.

Pick the Lower option in the Terrain Tools window and click on the in the Brush window. Lower the area
inside the black square so it can hold water. After it is lowered a decent amount I usually take the smoothing
option in the Terrain Tools and smooth out and rough edges of the lake.

Now pick the Water option from the Environment tools and fill the area with water. You may notice that the
water level is slightly higher than the base ground level. So start by filling just a little bit more than the area
you lowered with water (Except the north side since thats where the raised water will be) Then go to the
Brush options and set the height to -1 and paint water into each of the cells that have water in it to adjust the
height. You can lower it more if you want.. the key is to get the water to meet up pretty close to the top black
line.

Once you have that, its time to raise the northern area where the river will come to meet the lake.

This is where is gets tricky.. you can raise as much of the area north as you want.. the higher you raise it the
less it looks like a water fall. Basically do the same as you did for the lake but backwards.. raise it like
mountains and then set the brush size to small and lower a path for your river. In the end you want the black
line to run across the hill side between the two water level heights. This part can take a bit depending on how
well you want it to look.
Now.. for laying the second water height.. it can be a bit tricky because you can accidentally raise the pond
water to the rivers height.. pick 7 or 8 height for the water( it will really depend on how high you raised the
area but for me it was 7.

Play around with numbers till you get a river the way you want it. As soon as you raise the north chunks water
level you will probably raise a ridge of water from where your pond over lapped. Just erase that so it does not
look like you have floating water.

You should end up with something like the picture below:

Now at this point I like to use a few rocks on the corners so the corners dont stand out too much. (Just a few
boulder piles in the nature section of the placeables)
Now.. for the splashing effect.. you want to go into the Placeable Effects mand find the splash animation..
you will want to put one on the edge of the river and one at the ponds edge. You will have to manually raise
and lower them to get it right.. all you are trying to do is cover up the sharp edge of the river.
Once you have that you want your river to be flowing towards the pond rather than looking like any other
pond. Since its a waterfall and all. To do this you will need to go back to the water terrain menu and set each
of the three layers to scroll the same way, South, and at the same rate. To do that set all three water layers
Direction X to 0 and Y to 1. and then set each layers scroll rate to .3 .4 and .5 respectively.

Now your river should be flowing towards the waterfall.

Then once you have the waterfall looking like you want, go through and texture the area how you want and it

will really stand out. (Another trick is to go into the terrain editor and do a 50% pressure light blue coloring of
the land area under the waterfall)

3.6 HOW TO ADD GRASS


To be able to lay Grass within your area you need to click on the Terrain Tab and then you will need to click
on the Grass button as shown below:

The Brush pane you should be familiar with as this is virtually the same as the texture brush tools. The
only difference is the Density setting, which means how much grass will be laid within your brush size.

The next pane is the Options pane, which you can see below:

As you can see above you have the Blade Size, which adjusts the size of the grass. There is also an option
for the Blade Size Variation, which adjusts the size variation so the grass does not have an even height.
The higher the number the more extreme the variation will be.
Next we have the Grass pane:

Here we have the Paint button, which you need to click on and then move to the preview pane and then
click on your area to start to paint the grass. Next is the Erase button, which removes any grass that you
left click on within the preview pane. Then we have our selection of grasses that we can choose from.
To select a grass you can just left click on it and it will be highlighted in Blue (see above), plus there is a
scroll bar you can use to select the grass listed lower in the list. You can select up to 3 types of grasses to
be laid at once (just left click another 2 types of grass to select them).
If you try and select 4 then 1 will be automatically deselected. There does not appear to be a limit on the
amount of different grasses that can be painted within a tile.

TIP from Hellcow


While the grass effect in NWN2 is certainly pretty and an easy way to spice up an exterior area there are few
things about it that is worth giving some consideration before using it; namely area size. If not used with
consideration grass can make your area size explode.
In a test on a blank 8x8 area the result was that the flat, unmodified area had a size of roughly 7 MB, however
after the walkable part of the still flat, unmodified area was filled with grass that size had grown to roughly 15
MB, which is more than twice as much; just for grass.
Also there is a limit to how much of each type of grass you can paint in one meta-tile, but there doesn't seem to
be a limit to how many different types you can have in one meta-tile; so if you fill the amount for one sort of

grass in your meta-tile; you can fill out with another sort.
Lastly a few shots to show the good and bad way to use grass:

3.7 HOW TO CREATE CLIFFS


This is a quick run through of how I apply varying heights of terrain against steep cliff sides in order to
avoid long stretches of texture that occur on those cliff faces. Ok, here's a screen of the cliff I started on.

When you apply a texture to a steep face of terrain, it (the texture) does not turn on it's side and continue
down the cliff - instead, it stretches all the way down. I don't have a screen of this but you can see an
example in the screen above where the rock texture is used on the soon-to-be waterfall face. To make
this stretching a little less obvious, I raise terrain up in points in front of the cliff making it more jagged as
opposed to a straight drop down (or a steep angle as the case is with this toolset). In the following screen
you can see I use a small brush for the raising...

This process creates points - literally - of terrain. In fact, in most cases it's an unnaturally sharp point. So,
once I have a number of points raised to various levels, I use the smooth tool via a small brush - leaving
the pressure at 50%, a few clicks on top of these points can create a rounded/flat top to these raised
masses. In the following shot, you can see how the brush is sized and where I apply the smoothing

Now that the terrain is more jagged, the long lengths of steep terrain have been shortened to at least
have the height of the cliff. You could take it further and make it so that these lengths of steep cliff face
are even shorter which means even less of a stretched look, but I was in a hurry. At this point, you can
paint on the rock face, and I only paint the rock terrain on the steep faces, saving the flatter areas for
grass. This achieves a natural look and leaves less area that would normally need to be covered in the
rock terrain. I also added in 2 more rock face textures, but only in some areas and at less than 100%
pressure - this helps distract from the stretching effect...

At this point, you can start adding in various placeables as well as grass...

3.8 DAY & NIGHT SETTINGS


Maps can have a full day/night lighting cycle. This runs automatically. Some races like Drow get negatives
during daytime hours and there are ways to force always day or always night on a map. Or through
scripts, you can start the clock at certain hours.
The day/night cycle is broken into 7 phases. If you look at the Area Properties for a map youll see a
section at the top labeled Day/Night Cycle Stages which allows full control of the lighting for each stage.
The details of this will not be covered in this document so its best to use one of the standard light settings
for your first maps.
Default is a special setting used on maps that have no Day/Night cycle. Mostly used for interior maps or
those that has a fixed time of day. Also generally used on maps made exclusively for cut scenes.
1. Run. This allows you to see the full day/night cycle running in the editor.
2. Normal Speed/Fast. Adjusts the speed of day/night cycle when Run is active. Useful to get a
quick feel of how the area looks at all times of the day.

3.9 Area Properties


The Area Properties for a map are accessed by clicking your area in the Areas tab. The Properties
window will display the area properties. This is where you can find the Day/Night Cycle Stages
adjustments plus other settings useful for map making.

1. Appearance.
a. Day/Night Cycle Stages - Opening this section allows control of the lighting for each cycle stage
and the default stage if no day/night cycle is turned off. There are many options here which allow
almost infinite control of your level lighting. When starting out its best to look at one of the
standard lighting settings on some of the sample maps to get a feel for what each control does.
b. Sky Ring - Select a sky ring for each direction on a map. Examples such as mountains, hills,
trees, & cities. These will appear the same color as fog color over the skybox on the horizon.

2. Environment.
a. Day/Night Cycle True/False - If set to True the game will cycle through the 7 day/night phases.
If set to False the game will light the map only on the Default lighting setting.
b. Has Directional Light? True/False - The SunMoon setting (also known as the Directional Light)
in the Lighting stages will be turned on/off here. This should normally be True for exterior maps.
For interior maps it can be used for additional light to enhance the normal mapped textures but is
optional. It does count as a light when determining performance issues with number of lights. See
Point Lights for more details.
c. Directional Light Casts Shadows True/False - The SunMoon directional light can have shadows
on/off. Normally exterior maps would be set to True. For interior maps that use directional light
this would normally be set to False. If Directional Lights are turned off then this setting has no
function.
d. Is Always Night? True/False - Normally used for exterior maps that have a fixed Default
lighting. If set to True then the map will always be night with Moon instead of Sun in the sky and

stars displayed. If this is set to True then the Day/Night Cycle should be set to False.
3. Fog. Not currently functional. Leave at False.
4. General.
a. Interior True/False - For interior maps this should be set to true. Exterior maps should be set to
false. Surprise!
b. Natural - Natural environments like caves or forests should be set to true. Towns or villages
would be set to false.
c. Underground - Caves or underground lairs should be set to True.
d. Size The map can be resized by selecting the button to the right of the Size listing. A popup
will appear that allows the map to be increased or decreased in size from any of the compass
directions. There are a few issues to be aware of when doing this. Any object that is Position
Locked will not move when the map shifts size. When the map changes size it sometimes needs to
move objects to add the tiles and those locked items will stay behind. Height locked items are not
affected though. If you are unsure which direction is North theres a button (Show North) above
the Area Viewer that places a North arrow in the center of the map. Its a very good idea to save
before doing a resize since there is no undo command.

3.10 Walkmesh
Walkmeshes are a very important part of your module building as this will dictate exactly where the player
can walk and where they cannot.
To see exactly where the player can walk in your area you need to click on the Surface Mesh Filter button:

And the image below is a sample of what you will see in your area

As you can see from the picture above we have green lines (these mark the walkable areas), black lines
(these mark the non walkable areas) and finally we have yellow, which mark the boundaries between the
walkable and the non walkable areas.
The toolset automatically makes areas that have steep heights or falls as non walkable. In the picture
above there are at least two parts that are non walkable, the pond and also my rock face.
From the picture you can probably make out my pond (left of the picture), which has some yellow lines

around it. Some of it is walkable and the rest is nonwalkable, however I want to make the pond totally non
walkable. The first thing we need to do is to select the Non Walk button (do not forget to select the brush
size) and then paint as if we were painting a texture.

The pictures below show the Surface before and after I started painting using the Non Walkable tool. Do
not worry if you make a mistake as you can always correct them by using the Walk button and painting
in the same way.

The Surface Mesh is also helpful for when you are using your other Terrain tools as it will show you straight
away what effect the tools you are using are going to have on the player (i.e. whether they can walk on
that area or not). For example if you are creating say a slope and you are using the smooth tool you can
see whether the player can walk up that slope.
It is advisable to paint Non Walk over large areas of non accessible areas since it will make the baking
process much faster and generate a smaller area file.

3.11 Interior Areas


Interior maps are created using tilesets similar to the original NWN1. There is no surface mesh painting or
texturing needed since you can build everything from the included tilesets. It generally takes less time to
make a good interior than it does to make a good exterior.
Before we even create a new interior area, I should point out you should create the area size at least one
tile bigger than you need. For example, if your area is going to be 3 x 3 then create a new area that is at
least 4 x 4. The reason being is that the walls will be against the edge of the area and you will be able to
see the back them, which will not look too good.
When you first create an interior area you will probably notice that the preview pane is completely black,
click on the Occlusion Grid button in the toolbar and zoom out a bit. You should get something resembling
the picture below (picture is taken from above):

If you preview pane does not look like the above picture, i.e. it is covered in a light blue colour then make
sure that FOG is deselected from your toolbar.

Now that we have our canvas to work with the next thing we need to do is to pick our tile set that we are
going to work with. These are located in the Blueprints pane under the "Tiles" tab and will look like this:

To gain access to the tiles themselves you will need to click on the plus sign:

From the picture above (Column 2), you can see that some of the tiles have a dark blue line and these are
solid walls, the red indicates doors and the light blue squares indicate pillars. Column 3 tells you what Tile
Set you are using (from the above picture you can see SI = Standard Interior) and the 4th column lets you
know how many variations there are for that particular tile.
To see the variations see under the Standard Interior, look at the Hallway tile and you will see 4
variations, click on it and then move the cursor to the area preview, now use the up and down arrows.

The first tile we will lay down in this tutorial is a door tile:

After all how else are our players going to gain entry into the area? Left click on the tile and then move the
cursor over to the preview area and you will see that the tile is "attached" to the cursor. When you are
happy with the tiles position then left click in the area and the tile is "painted down". If you need to rotate
the tile, use the left and arrow BEFORE the tile is "painted down".

If you do not like the look of the tile you can always make sure the Tiles button is selected in the Filters
bar and then click on the tile in question so that it is highlighted by a green outline. You can now hit the
delete key.
Now we need to select our next tile. You can see from the above picture that there are two pillars on the
southern edge; we need to make sure that we choose a tile that has pillars in the north of its tile. As you
can see from the following tile it has two light blue squares in the corner indicating pillars:

There are other tiles with pillars, but for this example I am going to use the 4 pillar tile. Select this tile and
then place it to the south of the door tile. As you can see laying tiles is more like a jigsaw puzzle so
carefully choose tiles to match walls/pillars.

The above picture is a very simple layout, but you can see that my pillars have four corners in place.
If your area is foggy then you might like to change the following settings: Is Always Nights = True and
change the default fog (this can be found under Day/Night Cycle Stages) colour to black.

3.12 Baking
Whenever you finish working on an area, you will need to 'bake' it before you can test it, or allow players
into the area. Any time you make changes to an area, you will have to bake it again before you can test
the changes you made will work.
To bake an area, go to 'File', and then 'Bake':

You will then get the following prompt:

Click on the "Yes" button if you are ready to proceed. The baking process is split into 7 parts and you will
see a pop up dialog box, which looks similar to this:

Once the process is finished, your area is now ready to be played on. Please note that you will have to go
through this process for each area. Any changes that you make to the walkable area you will need to
rebake.
If you try and play with an unbaked area the player will be stuck where they spawn. You will also notice
that the PLAYABLE area is covered by the Surface Mesh and does not extend to the surrounding NON
PLAYABLE areas. You cannot paint WALK into these areas.
Placeables will cut out the walkmesh automatically during the bake process. This is especially useful for
buildings and walls which you can use to strategically block areas of the map. Many objects like bridges
and raised platforms will cut the walkmesh so the character can walk on the bridge or platform instead of
the terrain below it. Note that if the bridge is the walkable, the area underneath the bridge is set to non
walkable.
There is also a Baked button in the toolbar and when selected will show you white outlines that are cut out
for placeables and walkmesh triggers.

Too many objects


Sometimes with densely packed placeables a tile region can get overloaded and will fail the bake process.
You will see that by a tile that is completely unwalkable. There are two ways to fix this. Delete and/or
move some placeables and try baking again. Or try converting some placeables to Environmental
Objects (see placeables section) and surrounding by a Walkmesh Cutter. Walkmesh Cutters tend to be
simpler for the engine to process a walkmesh from.

As you maybe able to work out from the picture above the whole tile is Non Walkable as there are too
many placeables (6 graves and 3 fences).

3.13 EXPLORING YOUR MODULE


While it may not look like much, an area with a start location is all you need to have a playable adventure.
If youd like to explore the area youve made, youll need to save your module and then load the game and
play your module as if it were any other adventure.
To save your module, simply save from the Dropdown Menu: File - Save As. Alternately, Ctrl+S also
saves. Give your module a name and click Save and youre ready to go!
Start by launching your Neverwinter Nights 2 client. Select a New Game followed by New Module. Look
at the list of modules and you should see yours. Select it from the list and press Start Module. Select a
character (or make one if you wish) and youre ready to walk around your level!

Chapter 4: Creatures
4.1 Create an NPC
To add a new NPC, under your Blueprints click on Creatures and then click on the NPC group as shown
below:

Now right click in the Blueprint toolbar and then left click on Create Blueprint and then Module from the
popout menu:

You will now see a blueprint called creature1 and if you drag it into your area preview then it will look
something like below:

When your new creature is selected you should see the properties of the NPC:

Appearance
Scale: You can increase each of these numbers and they relate to the x, y and z axis.
UV Scroll: the UV scroll, which is used to determine how fast the texture of the item scrolls in the
U and V directions (typically used to add the proper flowing look to things like water elementals
and lava flows).
Never Draw Helmet: This can be set to True or False

Appearance: Allows you to choose the general appearance of your NPC (i.e. Dwarf, Dragons, etc)
Tinting: There are a number of tinting options here that allow you to change the colour of the
NPC's hair, face, armour, etc.
Appearance: Another appearance option but this time it is for the head and facial hair.
Body Bag: Used if the NPC dies, there are 7 different options on how the body of the NPC will
appear to the player.
Sound Set: This is to give the NPC a predetemined sound set when the PC clicks on the NPC (so
if your NPC is a human, best not to chose the Badger sound).
Wing/Tail: Er, gives your NPC wings and or tail - you can then choose what type of wings/tail you
wish to give your NPC.
Appearance (visual effects): This option if enabled gives you a load of visual effects that you
can add to your NPC.
Attributes
Strength, Dexterity, Constitution, Intelligence, Wisdom and Charisma: Set these as you
would when creating a PC.
Behaviour
Conversation: This is where you add any conversations that you have previously written to the
NPC.
Decay Time: Set this for how long you want the body of the NPC to appear for when it is killed.
Disarmable: Will players be able to disarm the NPC.
Equipped Items: You choose what part of the NPC can be equippable (i.e. wearing a helemt,
make sure you select Head).
Faction ID: Click on this and you get the option of 4 default factions: Hostile, Commoner,
Defender and Merchant. If you want the NPC to attack the PC on sight then choose the hostile
faction. More on faction in future tutorials
Lootable Corpse: Pick True/False. This enables you to choose whether you want the players to be
able to loot the dead NPC.
No Permanent Death: Will the dead NPC be able to respawn (not sure until the game is released)
Perception Range: 4 options here on how far away the NPC can see things.
Starting Package: What skills the NPC will have in game.
General
Localized Description: base descriptive text for the NPC.
Tag: name by which an object can be referred to in script.
Classification: Use this to organise where your NPC should be classified as within the Creatures
Blueprint list (i.e. for this example just type NPC).
First Name/Surname: Er..just like in real life.
Misc
Template Normally keep this the same as the NPC Tag.
Comment Add your own Builders notes to the NPC.
Height Lock If set to true means that you cannot raise or lower the NPC.
Position Lock If set to true means that you cannot move the NPC from its current spot.
Stackable To place one NPC on top of another?
Position No Snap Giving you the exact cordinates of the NPC on the x, y and z axis.
Miscellaneous
Here you can choose what Diety, whether the NPC is immortal, its Walk Rate, Familar type, etc to
give your NPC more depth
Saving Throws
Here you can give your NPC Fortitude, Reflex and Will saving bonuses.
Scripts
You can attach your scripts to your NPC here so that based upon an event it will trigger your script
so that your NPC will react as per the script.
Shadows
This section allows you to define how the NPC will cast/receives shadows from lighting within its
immediate surroundings.

Statistics
Classes: This is were you can determine the class(es) of your NPC. To do so click with the Classes
field so that it is highlighted and then click on the three dots ... to be able to amend the class as
shown below:

First click on the Add button and you will see that the Barbarian class has been shown as above. Click on
the Downward arrow under Misc/Class and here you will see a long list of classes to choose from. You can
then choose the level of the class and if it is a multiclass NPC then just click on Add button again and go
through the same steps above.
Gender: Can you choose from 5 different Gender types.
Subrace: Can you choose from a whole list of Subrace types.

Feats: Choose from a list of feats so that if your NPC is required to fight then choose the feats wisely to
make the battle a little bit more interesting and of harder for the players. Click on the Feats field and then
click on the three dots ... to be able to see the list as shown below:

Click on the feat that you want your NPC to have and then click on the Add button. Rinse and return to add
more feats.
Natural AC: Increase this if you want your NPC to have a higher AC than the equipment it is wearing
provides.
Current Hit Points: How many Hit Points your NPC currently has.
Base Hit Points: These are the number of Hit Points your NPC has derived from its base statistics.
Challenge Rating: This shows the average level of a party of adventurers for which one creature would
make an encounter of moderate difficulty.

Damage Reduction: You can add different types of damage reduction from a list. To add a damage
reduction type to our NPC, click in the Damage Reduction field and then click on the three dots ... to get
a dialog box as shown below:

Click on the add button and then on the right hand pane you will see four options:Damage Amount,
Piercings, Stacks, Uses or Logic
Damage Amount: How much damage do you want the reduction to be.
Piercings: Click on this field and you will have to click on the three dots ... and then click on the add
button to get the follow screen:

Click on Piercing Type and you will be given 6 different types to choose from. The Sub Type will change
depending on the type of Piercing you have chosen. Once done, click OK.
Stacks: You can set this to True or False. For example if you have a ring that has DR for say Fire and you
have given the NPC a natural DR for Fire then the two will stack together. If set to False then these do not
stack and the NPCs DR will act as if it did not have the ring.
Uses Or Logic: This is set to True or False, which to me does not make sense???
Thats the NPC properties pane finshed, but we have two more panes to go: Preview and Inventory.

The preview pane will give you the overall look of your NPC.
If you click on the Inventory tab in a creatures properties you will see at the bottom the following screen:

The list comprises of what the creature can be equipped or rather where. Click on the Edit button and the
following screen will appear:

Now lets give our creature some armour. To do this click on the plus sign beside Armour (under the Items
tab - bottom left hand pane) and then click on the plus sign next to the types of armour that will enable
you to drill down to some actual armour. Left click on an armour of your choice and then drag in to the
chest field of the Equipment tab.
If you want the item to only appear in their inventory then drag it to the Item tab in the upper left area.

Now rinse and repeat for each field in the Equipment tab, if necessary and your creatures equipment may
look something like this:

You can click each item field to make it droppable or possible to pickpocket the item from the NPC (would
try and go against having the chest, boots, etc from being pickpocketable). If you are unhappy with a
piece of equipment then just left click on it and hit your delete key.
Beside the Equipment tab is the Armour Set and the Properties tab:

4.2 Encounters
To lay an encounter you will need to go to your blueprints and then click on the Encounters button:

You will see 5 different categories from Very Easy, Easy, Normal, Hard and Very Hard. Click on the plus
sign to expand each one as shown in the picture above. In our example we are going to create a Very Easy
encounter by using the Goblin Gang Blueprint, so left click on the Goblin Gang Blueprint and then move
the cursor over to the area preview pane. You will notice that the cursor changes to a cross hair and all we
have to do is to paint an area where the player will have to walk into to trigger the encounter.

Like so:

Once we have painted the encounter, select it (Click on the Select Object in the Filters toolbar and then
left click on the encounter). Now look in the Properties pane:

Change the Active field from False to True and now you are ready to test. You will notice that when you
trigger the encounter the creatures spawn right next to the player, which is not that convincing (after all
how did those creatures creep up on you?). To change where the creatures spawn, select the encounter
trigger and then left click on the Paint spawn point in the filters toolbar and then move the cursor into
the area preview area:

Once your cursor is in the area preview window left click in the area you want your creatures to spawn.
You should now see a flag like:

You will notice that the above picture has a red flag, which means that the encounter that you drew earlier
is selected. If you select another encounter trigger then if it has a spawn point then it's corresponding flag
will be highlighted in red. The spawn point will be completely yellow if it's corresponding trigger is not
selected, which means that you will be unable to delete it or move it until it is selected.

4.3 Create your own custom encounters


Under blueprints - Encounters, right click in the blank area and then left click on Create Blueprint and then
Module:

By default you will see a new Blueprint called encounter1, which we can change the name of later. Select
the encounter and now look at the properties of it:

Under Behavior:
Active: True/False - True means that the encounter is active in the area and False means that it not active
(i.e. the encounter will not happen).
Creatures: This allows us to select what creature will spawn when the encounter has been triggered.

Click on the three dots and you will get the following:

Click on the Add button that is located in the bottom left hand side and you will notice that the pane on the
right hand side will include this:

Complete each field so MaximumNumber is the maximum number of creatures from this encounter that
you would like to spawn. MinimumNumber acts in the opposite way in that this figure is used to spawn the
minimum amount of creatures to spawn. So the game engine will spawn a random amount of creatures
between these two figures. Single spawn will determine whether the encounter will continuously spawn
creatures or group of creatures only once. If this is set to TRUE then the encounter will only happen once.
If set to FALSE then as the creatures die others will spawn to take their place.

The final field here is Creatures, so click in its field and then click on the downward arrow to see a list of
creatures:

Select your creature and then click on the add button and you will now see that creature selection move
to the left hand pane. You will also notice that the right hand pane has gone back to default, which means
that you can now add other creatures to your list in this encounter by repeating the above steps.

It should look something similar to this:

If you want to remove a creature listed in this encounter the just left click on the creature to select it and
then click on the remove button. When you are done click on the OK button and you will now see the
creature field complete with the creatures you choose for this encounter.
The Difficulty field is for your reference and makes no odds to the players
Faction ID is important as it is triggered if the player triggering the encounter is hostile to the
trigger.
Maximum number of creatures is the number of maximum creatures in the encounter. But I have
already completed this when selecting the creatures I hear you say. I have done some testing and
my findings are as follows:
If you enter the maximum and minimum amount of creatures when you select your creatures for
the encounter then this field is redundant. If you select say 0 is the maximum amount of creatures
when selecting your creatures and then select 4 in this field then the maximum amount of
creatures that will spawn is 4.
Player Only? If this is set to False, then it is possible that NPCs or creatures may trigger the
encounter. If set to TRUE then only the player can trigger the encounter.
Minimum number of creatures is the opposite to the maximum number, but the same rules apply
- see above.
Auto-Reset? If set to TRUE then the trigger will automatically reset itself, if set to FALSE then the
trigger will only only be used once and will not reset.
Creature Spawn Style: There are 4 different spawn styles.
Auto-reset Delay: Can specify in seconds how long to delay the reset of the trigger.
Auto-reset Count: Can specify how many times the encounter can be triggered - stop those pesky
campers.
Spawn Once? Self explanatory (TRUE or FALSE option).
Resource Name gives us the ResRef name
Localized Name is the field we use for our benefit so use a name that describes the encounter (i.e.
Dire animals, Goblin Elite).
Tag: Can be used as a reference for scripting.
Classification: If you open the properties of the encounters within the 5 groups (Very Easy, Easy,
Hard, etc) you will notice that each encounter within each group share the same classification. So
if your encounter is classed as Easy then use {184343} as the classification and it will move the
encounter to the Easy grouping. Do not forget the curly brackets.

4.3 Create your own companions


First create your companion NPC (See Section 4.1 if unsure).
I made a fighter/wizard level 1/1 and called him Melf the Elf. His Tagname is "melf" and his
resref/template was gh_henchman_melf01.
Load up this new NPCs properties and select import properties->script set and load up
"c_CompanionScripts.xml".

If you do not have this file you can create it by loading the properties of one of the official campaigns
companions and selecting export properties->script set and save as "c_CompanionScripts.xml".
Next create a conversation. (Click here

for tutorial on how to create a conversation.)

Right click the root section, select add and for the text just say "Would you like a new companion?"
Right click the line you just created and then click add and for the text use "Yes, please join my group.".

Now, find and click the "Actions" tab below and add the following global action scripts:
ga_roster_add_object ga_roster_selectable ga_roster_party_add ga_reset_level

Once you have all the scripts added and in the order above click "refresh" for each script to see the
variable options. Once you see those enter in the following values:
ga_roster_add_object sRosterName:melf sTarget:melf ga_roster_selectable sRosterName:melf
bSelectable:1 ga_roster_party_add sRosterName:melf ga_reset_level sCreature:melf bUseXPMods:1

Replace "melf" with whatever tag you used for your companion (it must be 10 characters or less).
Save the conversation and then add it to your new companions conversation (under properties behaviour).
Place the NPC somewhere in your module and go talk to him. Hit the "yes" response and he should be your
new best friend!

Chapter 5: Placeables
5.1 How to add a placeable
To add a placeable in your area you need to click on the Blueprints tab and then click on the Placeable
button:

Click on the '+' sign by the first category buildings. A list of the different buildings you can place will
appear, now click on an item. For this example I am going to select 'Church' from this list:

When you select 'Church', you can then left click anywhere in the preview area to place down the church.

Now click on 'Select Objects' once you've placed it to get it off your cursor (can also click on the Esc key):

Rotate Objects
If you do not like the way an object is facing say a church in our example, you can rotate it. Select the
church and a green box should appear around it like so:

Notice there is now a toolbar with rotate options just above the window. You can click on these buttons to
rotate the church through 45 degree increments.
To have greater control on the rotation: (Please note that you cannot rotate trees), Mouse: Select the
object(s) then hold down shift + right click drag, Keyboard: Ctrl+Left/Right Arrow

Object properties
Whilst the church is select you can look at the properties of it in the properties pane:

One of the exciting things about the Neverwinter Nights 2 Toolset is our ability to paint objects with
different colours (called 'Tinting'). Click on the '+' next to Tint and you'll see there are three colours you
can customise.

To change a colour, select it and click the drop down arrow that appears:

A window will appear letting you choose whatever colour you like. Have a play around and then look at
how your church looks.
We then have Scale, click on the text field to the right that currently has 1, 1, 1 in it. When you click
on this field, youll see a flashing cursor prompting you to input new values for the placeable's scale. This
scale of this placeable is currently 1 x width, 1 x length, and 1 x height. Try typing in 1.5, 1.5, 1.5 Press
Enter when done and watch the church increases 50% in every dimension.
Ignore the 'Body Bag' and other options for now, they're not applicable. Three True/False options under
the 'Behavior' tab are important to get to grips with, though. These are 'Static', 'Usable' and 'Plot':
'Static' means the object won't do anything whatsoever it's just decoration. Our church is static, so this
is set to 'True'
'Usable' means that the player can interact with it some way like have a conversation, bash it or open
it. This is set to 'False' for the church (as I mentioned before, the door to the church is usable, and we'll
cover that in a moment).
'Plot' guarantees that the object will never be destroyed so set this to true, just to be 100% sure the
players do not try and destroy it. All the other options do not really apply to the building placeable, but
there are other placeables under blueprints that do use these options.
TIP
Environmental Objects: These objects are decorative props that do not interact with creatures in any way.
While these objects are non-interactive and are not even solid with respect to other creatures, they take
very little CPU power compared to other, dynamic objects. If you wish to fill an area with lots of props and
would like to make those props completely cosmetic, you can convert them to environmental objects to
streamline the performance of your level.
To do this select your placeable and then right click and then left click on Convert and then again on
Placeables to Environment Objects:

You can also see from the above picture that you can reverse this by clicking on the Environment Objects
to Placeables option.

Containers
To add a container, click on the plus sign of Manmade Props and then containers:

Left Click on say Chest {01 Medium} (Note: The player(s) will not see whatever is written in between the
two curly brackets, these are only seen within the toolset. You can add your own to your own
items/placeables and use them as a note (i.e. Strong Goblin)) and add it to your area (just like the church
in the above example). Again select the Chest and you will then be able to see it's properties.
Containers are placeables that have inventory and can be used by a player to access the items and use as
storage space. In the Properties tab, make sure that the following fields are set as follows:
Has Inventory? = True
Inventory Size > 1, though 136 is average for a chest
Static = False
Usable? = True
Like so:

To change any of these properties, just click on the field next to the name. These fields set the placeable
as being capable of holding items and usable by creatures. A player can now use this object in the game
and take items from this placeable (as well as store them). If this placeable is destroyed, it will drop any
items it held.

5.2 Equip a Placeable


Placing items into either is roughly the same process. Start by selecting the creature or placeable in the
area and clicking on the Inventory tab of its Properties Panel.

There will be an Edit button in the corner of this window, click it to access the creatures or placeables
inventory.

As you can see from the picture above, we have the Items tab in the bottom left hand corner and this is
where we select which item the creature or placeable will have.

Equip a placeable
All you need to do is to pick the item you want the placeable to have so in our example click on the plus
sign beside weapons and then the plus sign beside Axes and again on One-Handed. Now left click on
Woodcutter's Axe so that it is select and we can either drag the item up to the Inventory tab (top left) or
we can click on the Add item button (lower right of the Items tab).
Rinse and Repeat and when you have all your items that you want in the container then click on OK. If you
look at the properties of the container and then the Inventory tab you will see all your items that you
added.

5.3 Light Placeables


As you can see in the picture below, we have a candelabra on a desk:

Go to placed objects under the blueprints tab and select it

Select the candle flame blueprint. Clicking on it will bring up a yellow blocky item that is the blueprint for
the candle flame.

Raise the yellow block to where you want it, (holding down the Alt + left clicking while moving the mouse
up or down will raise or lower it to the desired height). It is important to place the bottom of the block near
the top of the candle, also try to center the uppermost middle of the block with the top center of the candle
(that is where the flame will show up).

Once you have the yellow block placed correctly go to the show/hide tab and turn off placed effects

helper. Now you should see something like the picture below in your toolset.

Now for adding a light blueprint to illuminate the room better. Select lights in the blueprints tab.

Select the desired light, there is only one in the pre-sale toolset to choose from. This will bring up a white
block of light blueprint, raise it just like you did the candle flame (Alt + left click) to where you rested your
flame blueprint on top of the candle.

Change flicker from false to true and select a smaller range for the candle, I chose 2 as my range. You can
also change the color of the flame and other stuff on the properties menu. Editor note: Personal choice but

try changing the flicker rate to 0.1.

Now go to the show/hide tab near the top left and select light and light spheres to turn them off (This
is the closest way to a preview function I know of in the toolset).

That is how to place a flame and light blueprint on top of a candle placeable.

5.4 How to add a Sign


I am going to assume you know how to create an area and also how to paint a building (in this case a
Blacksmith's):

Now we need to paint the sign itself so go to your Blueprint - Placeables - Manmade props and then choose
the Blacksmith Sign:

Once we have selected the sign by left clicking on it then we can move our cursor to the Area preview pane
and you will see the sign attached to the cursor. Left click in the area where you want your sign to go
(Click here to know how to move the object sign) and it should look similar to this:

Now that we have our sign in position, we need to change some of its properties so that the player can get
the name of the shop/sign. To do this we need to select the placeable sign so that it is highlighted in green
(click on the Select Object filter and then left click the sign).

Look at the properties and they will need to be the same as this:

As you can see I have changed the Plot to True, Static to False and Usable to True. To change these just
left click on each one and then click on the downward arrow and choose True/False from the dropdown
menu. Now if we save this and test it by running the module you will find that the sign is called "Sign,
Blacksmith Shop", not very imaginative is it. To change this look for a field in the properties called
Localized Name under General:

Delete the name Sign, Blacksmith Shop and then add your own (in this example I will use
Thunderhammer Smithy Shop). Run the module and you should see something like this:

There is one problem with this and you will have to test this yourself is that you can run straight through
the sign. To stop this change the Dynamic Collisions to True and the player will be forced to move around
the sign.

5.5 Bridges
After seeing a few people having problems with placing bridges I thought I would give it a go and see what
the fuss was about. First thing I did was to create two raised areas like so:

The red lines show where our bridge placeable will be placed. All you have to do at this stage is to make
sure that the two raised areas are level with each other (good use of the Flatten, Eyedropper tools here).

Now we can add our bridge placeable, so go to your Blueprints, then Placeables, click on the plus sign of
Building Props and then select bridge. You may need to rotate the bridge so that the two lower edges are
lined up with the two edges of the raised areas (the two red lines):

You will see in the picture above that the terrain does not meet the whole edge of the bridge (circled in
red) and players will not be able to use the bridge. The next step is to raise the terrain in that area so that
the whole edge has terrain touching it, like so:

Notice I now have the whole edge "touched" by the terrain. Make sure that you do this for the other side
as well. Also you can see how much "lip" I have showing:

The only properties that I would change on the bridge is the Height and Position Lock to "True" and then
bake the area. You should now find that your player/NPC can walk on the bridge.

5.6 How to place a door


Noticed on the Bioware forums that some people are having trouble adding doors to their modules. This
tutorial will explain how I add doors first time every time.
First thing to do is select the Blueprints tab and then click on the Doors button and you will get a choice
of a number of doors to place.

Select a door by left clicking on it (in this example I have chosen one of the standard interior doors) and
then move your cursor over to your area preview pane.

I make sure that the door gap is directly in the middle of my preview area and I move my cursor to an area
as shown in the picture below (i.e. move you cursor roughly the same distance away from the door
surrounded by the red circle):

When I move the cursor to this area the door snaps into the door frame and then I left click to place the
door in the frame. To confirm that the door has been placed correctly, press the Esc key to remove the
door from your cursor and if the door is still in the door frame then it has been placed correctly.

5.7 How to make a prefab


A prefab is a collection of placeables that are grouped together so that you can place them as a group
rather than individually place the placeables a second time. As you can see using this method could save
you a lot of time.
The first thing we need to do is to place our placeables in the order that we want them in, like so:

As you can see in the picture above I have added a rug, bed, wardrobes, desk, etc to my area and I am
now going to make them into a prefab so that I can use it for other areas, modules, without having to
place them individually again.
With the drag selection button selected:

I can left click in the tiles top left hand corner and then drag my mouse to the bottom right hand corner
and as you will see a green box will appear. Whatever object is within the green will be selected, like so:

Now we can right click within the green outline and a menu will appear:

Left click on Group and then a dialog box will appear:

Now give the Group a descriptive name as this will be used as the prefab name (The name can be changed
so do not worry about it too much). Once that has been done, left click on the group again and have a look
at the properties of the group.
The two important settings here are the Height Lock and the Position Lock as shown below:

For instance, if you do not select Height Lock then you may find say a desk placeable is halfway between
the floor and the ceiling, which I do not think that is the effect that you are after.

Next thing we need to do is to export the group out as a prefab. To do this Right click on the Group and
then select Export Group:

We then can change the File Name (as mentioned earlier it defaults to the name of the Group, but you can
change it now) of the prefab and also make sure that you save it to your override folder in your My
Documents Neverwinter Nights 2 directory. You will need to restart your toolset and if you go into your
Blueprints and then click on the Prefab button you will see your newly created Prefab.

TIP:
Why not classify your prefabs to make life easier on yourself. You could have 100's if not 1000's of prefabs
and they will all be listed one after the other. What I do is group my prefabs by using the Classification
field:

In this example I have made a Classification group called Interior Rooms and then another sub group
called Messy. When I look at my prefabs the group is shown like so:

You could use better groupings like Tavern, Front Room, Kitchen, Bedrooms, etc.

Chapter 6 Items
6.1 What is an item?
Anything in the game (or your module, for example) that can be picked up and used in some fashion
that is an item. All armors, all weapons, all potions, all quest items all the useful things that populate a
world, from the magic sword in the trolls lair to the gold coins you sell it to the merchant for.

Items fall into two categories: equippable and unequippable. Equippable items include jewelry, weapons,
armor things that a character can conceivably place upon their body or wield in their hands.
Unequippable objects are items that are never actually placed on a characters body - they never take up
an armor or weapon slot - and may or may not have an effect. Unequippable items can provide a passive
effect when held in ones inventory, can be disposable (such as potions or scrolls), can be used in crafting
(such as raw materials), or simply take up space (such as a quest item). Since equippable and
unequippable items can have very different effects, this tutorial will walk you through making both types,
creating a sample of each for use in the Lannon Farm module.

6.2 Creating an item blueprint


To create a new item, click on the Items tab in the Blueprint Menu to bring up all of the items in the
game. Right-click anywhere in the New Item field to bring up a small pop-up menu: within that menu, go
to Create Blueprint, and select Module (this is unless you wish to create an item usable in any module:
if you want to do that, select Global instead). This process creates a new item template for you to work
with within that particular module group. [Note: another method for item creation involves copying an
existing blueprint by clicking on the particular item, right-clicking to bring up the Dropdown Menu, and
selecting Copy Blueprint. This creates an identical version of that blueprint to modify which can be
beneficial for creating items that only need to be slightly modified from an original version.]

Within the item template are multiple fields that determine the properties of an item: [Note: Some tabs
are closed in this screenshot because they do not directly deal with items being created. The Armor tab is
closed here because it deals exclusively with armor items, which are addressed after this section. The Misc
and Scripts fields are not used in the creation of standard game items and are thus not touched-on here
beyond a brief explanation.]

1. Appearance. This section briefly determines the general look of your item, particularly weapons.
a. Appearance (special effect) a list of special effects that can be attached to an item. Typically
these are not necessary, as weapon effects are actually hard-coded: any weapon with an
elemental enhancement bonus that averages to 3 or higher (i.e., 1d6 and up, not 1d4)
automatically gains an appropriate visual effect. Visual effects can also be set in the Behavior
section.
b. Container UI Screen sets what background graphic is used when a placeable container is
opened. Should be left at the default for item-creation purposes.
c. Icon what icon the item uses (pulls from the list in nwn2_icons.2da).
d. Model Part what model the item uses (only important for certain equippable items, such as
weapons and bard instruments. Wearable items use the armor set tool and are discussed later).
e. Tint the colors that the item model is tinted (shown in RGB values).
2. Behavior. How the item works within the game world.
a. Additional Cost how much the item will cost in addition to the preset values (seen three lines
below in the unmodifiable Base Cost area). Every item is given a base cost in the baseitems.2da:
any enchantments on the item are given values via code and added on to the cost. If the user
desires any modifications in addition to this code-based value, it can be added here (or set as a

negative value to decrease the price).


b. Armor Type (for game rules) sets the armor type (via the preset armor rules in the 2das). Only
important for base armor sets.
c. Armor Rules Info CANNOT MODIFY. Gives a list of all of the rules attributes for the selected
armor type.
d. Base Cost CANNOT MODIFY. Lists the base cost of the selected item type.
e. Base Item determines the actual item type. This is likely the most important field in the entire
blueprint (aside from the resref, which is discussed below) because it determines item elements
such as model used, item weight, weapon stats, and base cost (all of these individual settings are
controlled by the baseitems.2da file, and cannot be modified within the toolset itself).
f. Charges how many total charges a magical item has (only useful for items that cast a spell, and
that the user only wants to have a particular number of charges different spells can have
different charge costs, and even be recharged if desired)
g. Container Preference which type of container the item defaults into when picked up: default is
the standard player inventory. This setting can be used, for example, to have a potion box that, by
default, will store the players potions.
h. Cursed sets the item to be cursed (non-droppable, non-disarmable until a Remove Curse or
similar spell is cast on it).
i. Droppable whether or not NPCs will drop that item (default set to false usually handled on a
case-by-case basis when an item is placed on an NPC - for example, you may want an ogre to drop
the club he wields, but a troll wouldnt drop his claws).
j. Force Into Preferred Container whether the item can be dropped into a container other than
their preferred one (like preventing arrows from going anywhere but in a quiver, or gems in a gem
bag)
k. Identified whether or not the item is identified, or needs a Lore check/Identify spell cast on it
before it is able to be equipped (for magic items in NWN2, this is usually set to False).
l. Item Properties any special abilities that an item has (things like Cast Spell, Enhancement
Bonus [+2], Damage Vulnerability: Acid) these are all set in a pop-up menu that accompanies
this field.
m. Item Property Activation Preference controls when an item is able to use its special
properties. Items such as weapons are only active when equipped, while items such as charms can
have abilities when they are in repository (i.e., inventory). Items can also be set to give effects in
both situations (equipped and unequipped).
n. Pickpocketable whether or not an item can be pickpocketed (default set to false usually
handled on a case-by-case basis when an item is placed on an NPC).
o. Plot whether or not an item is vital to the Plot of the game (such as a quest item). Prevents
item from being destroyed or moved from the characters inventory.
p. Stack Size how many items of that type appear at once when the item is placed in game (a
stack size of 1 for an item means only one of that item will appear at once, while a stack size of 50
means that 50 of that item will appear at once)
q. Stolen whether or not the item is stolen, and thus cannot be sold to merchants who are not
tagged as Black Market vendors (default set to false usually handled on a case-by-case basis
when an item is placed on an NPC)
3. Blueprint. How the toolset is able to track the item.
a. Comment basic field to jot down comments. This information is never visible to the player
within the game.
b. Template Resref resref of the blueprint that an instance came from (key for placed instances
within modules). Each item must have a unique resref.
4. General. How the item is categorized and described.
a. Classification how the item is ordered within the toolset
b. Localized Description base descriptive text for the item: this appears on normal items, or
unidentified items before they have been identified.
c. Localized Description (when identified) descriptive text for the item after it has been identified.
d. Localized Name the name of the item.
e. Resource Name the name of the actual file on disk (the official filename of the item)
f. Tag name by which an object can be referred to in script [Note: the tag, Resource Name, and
Template Resref are all usually the same name, to keep things simple]. It is generally best to use
unique tags, but unlike resrefs, two items can have the same tag.
5. Misc. Deals with the UV scroll, which is used to determine how fast the texture of the item scrolls in the
U and V directions (typically used to add the proper flowing look to things like water elementals and lava
flows).

6. Scripts. Additional scripts attached to an item (beyond the standard ones). For example, taking gem
bag could trigger a script that causes its owner to attack you.
7. Statistics. Sets the items material properties.
a. Damage Reductions sets the items damage reduction (not a damage reduction property
granted to the wielder, but the properties of the item itself).
b. Material what the item is made of, which is used for weapons and armor in order to determine
its effect on certain monsters, and vice-versa. For example, lycanthropes are resistant to weapons
that arent made with alchemical silver.
Now that the terms have all been defined, you have the foundation you need to create items.

6.3 Creating an unequippable item


The first item to be created for the example is a non-equippable item Pitney Lannons prized bottle of
1363 Harvest Mead. Follow the steps listed above to create a new module-specific item, and you can start
filling in the particulars of that item.

When setting up a new item, set the items Localized Name and its Resource Name/Tag/Template Resref
at the same time. As soon as you set these, the item will appear in the Items directory.
Advanced Topic: 2da Files
The term 2da stands for 2 dimensional array. 2da Files are used by NWN2 to contain data for many
aspects of the game, including spells, character classes, and feats. The 2da files are located in the Data
folder. baseitems.2da specifies the basic parameters for many different types of items. Each row in a 2da
is one entry and each column is a field. For example, all greatswords share the same row in the
baseitems.2da. They all do the same amount of base damage, are equipped with two hands, choose their
models from the same set of options, etc. Potions, rings, scimitars, etc. each have their own row in
baseitems.2da.

Once these main parts of the item are set, the only things that remain are setting the icon for the item
(selecting the icon field will create a drop-down, scrolling menu just like the Base Item field: change the
icon from temp0 to it_spirits), setting the desired value in the Plot field (it is not necessary to prevent the
Mead from being dropped or destroyed, so the field will remain set to False in this case), and writing a
proper description for the item in the Localized Description field.

To give the item a little more variety (and to provide an example of how an unequippable item can provide
passive bonuses by sitting in ones inventory), open up the Item Properties tab to add a special property
to the item.

Scroll through the Available Properties to the Skill Bonus section, and open it up to find the Concentration
skill. Click on the Add Property button to add the property to the item, then select the bonus and look
beneath the Available Properties field to the tabbed Selected Property field. Set the Cost Value (in this
case, the bonus to Concentration) to +2, and click OK to confirm the selection.
Finally, in order to get the Concentration bonus to actually show up for the player (since the item can not
be equipped), change the Item Property Activation Preference to
ITEMPROP_ACTIVE_REPOSITORY_ONLY, which will make the item properties only apply when the object
is in the characters inventory.

The item should be ready to place within the module.

6.4 Creating an equippable item - Weapons


Now that an unequippable item has been created for the module, it is time to create a pair of suitable
equippable items: a weapon and an armor. In terms of weapons, it just so happens that Pitney Lannon is
in possession of a quality club perfect for harassing pesky lizardfolk: he may lack the courage to use it
himself, but this hardly prevents him from passing it on to an enterprising young soul who might make
better use of it To craft a weapon (Lannons Reptile Bane Cudgel in this example), follow the usual
instructions to create a new module-specific item (right-click on Items, Create Blueprint -> Module). As
with creating an unequippable item, set the item name and resref first.
Once the name and resref have been set, go to the Base Item field and select an equippable item type
from the list (Club in this case). Since the Club base item is a weapon, now there will be an actual model
available to select [Note: this is the case with most equippable items, but not all bracers, rods, wands,
and jewelry do not have visible models set for them]. Move up to the Appearance area and set the desired
model number in the Model Part fields: different base items have a different number of available models
and model types, and some have interchangeable model types (swapping out different hilts, blades, and
pommels on swords, for example). To find out what model (or combination of models) looks ideal, it is a
good idea to change the Model Part values one at a time and swap between the Properties and Preview
tabs to see how the item changes [Note: if a black question-marked cube appears in the Preview window,
that is because there is no model set for the given model number].
For the Reptile Bane Cudgel example, type in 2 in the first Model Part field this will select the second
available club model (the metal one). You will be able to check the model by clicking the Preview tab at

the top of the window, and navigating through the window by using the mouse scroll button to zoom,
Ctrl+right-click to move the model around, and Ctrl+middle-button-click to tilt the camera [Note: the
Preview option on the top bar must be selected, or no model will appear in the Preview window]

Once the club appears correctly, open up the Tint mini-menu in the Appearance area. Three set tints will
appear click on one to bring up the Color Edit Form

The Color Edit Form sets the individual tints on a model, either by selecting a color by hand from the
palette on the left, or by selecting a named swatch on the right (the names of each swatch appear when
the mouse cursor is hovered over each swatch). Its often helpful to set the tint values initially to very
bright colors (like pure red, green, or blue) so that it is very obvious between switching from the
Properties tab to the Preview tab which tint is connected to what part of the model. In the case of the
club model 2, the Model Tint 1 controls the main body of the club, the second tint controls the color of the
handle, and the third tint governs the color of the wrapping. For this example, swatches will be used to
select the colors of the Reptile Bane Cudgel: Darker Cool Brown for Tint 1, Medium Cool Brown for Tint 2,
and Darker Pea Green for Tint 3. Once the tints are set, check the Preview window to see how it looks.

Once the appearance of the club is set, follow the same sequence of events to finish up the item as on an
unequippable item setting the icon (it_wu_clubpoison), writing up a description, and setting a proper
set of Item Properties.

For the Reptile Bane Cudgel, it is important for the weapon to have a proper bonus against Reptiles to suit
its name. Click on the Item Properties field and select the Attack Bonus vs. Racial Group ability, scroll
down and select Reptilian from the list, and change the Cost Value of the ability to +3. To strengthen the
weapon a bit more, scroll down to Enhancement Bonus and add that property as well, setting the Cost
Value to +1. [Note: you can add numerous additional properties to items in this same fashion].

Once the Item Properties are set, scroll down to the Statistics section and set the Material field to Metal

(Iron): while not terribly critical for this particular weapon, its good practice to set the value for every
weapon, in case one wishes to make an item out of a different material. Certain materials are set to give
specialized effects, such as Cold Iron (effective against demons) or Darksteel (deals an additional +1
electricity damage), and can be a valuable addition to many types of items.

Once this field is set, the weapon should be ready for use.

6.5 Creating an equippable item - Armour


After creating a properly equippable weapon, there are only a few additional steps to be learned to create
an armor set. Pitneys Militia Armor should provide a good introduction on how to spruce up a base armor
model with a few appropriate attachments, and an additional feat and spell bonus.
To create a set of armor, follow the same steps as creating a standard equippable item: create the
blueprint, set the item name and resrefs, and set the Base Item to Armor. Once the Base Item has been
set to Armor, set the Armor Type field to the desired style of armor (in this case, Pitney is a simple
village militiaman, so Padded armor should work nicely). When the Armor Type is set, you will see the
ArmorRulesInfo field below (in gray) update to reflect the rules for that particular armor type.

Once the Armor Type has been set, select the Armor Set tab on the far right of the blueprint menu this
will help you to set the actual appearance of the armor itself [Note: the model for the Armor Set tool is a
human male: while the majority of the base armor models are identical in appearance across race and
gender, some armors may appear different on some race/gender combinations]

As with the Preview window, navigation within the Armor Set window is controlled with a combination of
the middle mouse button and the Ctrl key: the mouse scroll controls zoom, Ctrl-middle -click rotates the
model, and middle -click-drag moves the model. It is important to note that when using the Armor Set
tool that one should turn OFF the Preview option along the top bar of the window: the Armor Set tool will
be useable either way, but turning off the Preview option prevents armor flickering within the Armor Set
tool when the Preview window loads an updated model.

The first thing to do when creating an armor within the Armor Set window is to set the base appearance
of the model, which is listed under the Main Type (which controls the armor appearance type) and Main

Variation (selects model variation within the main type) menus. The two armors below are both scale
mail, for example, but use different variations.

Advanced Topic: Untraditional Armors


It is possible for the armor appearance and the Armor Type (from the Properties tab) to be set
differently, so one could have armor that looked like cloth but had the properties of Full Plate mail, and
vice versa. This is an option for armor creation, but moreover something to be aware of when creating
armor.
For the purposes of the example, select the Padded armor from the Main Type menu in the Armor Set
tab, and select variation 0 for the set.
The second step of creating armor is to decide on the armor attachments. On the bottom right of the
Armor Set tab is a scrolling menu listing each armor attachment slot, which allows the user to pick what
armor attachment they would like to put in what location [Note: as per the note above, armor appearance
and Armor Type are not inherently linked, so it is possible to use any attachment on any base armor
without influencing its stats.] To place an attachment, scroll to the desired attachment location (such as
Left leg), open up the Dropdown Menu (which lists the models available for that attachment slot), and
select the desired attachment.

For Pitneys armor, since its a bit fancier than the armor of the other militiamen, hes been given burly
leather shoulderpads (Left shoulder: 7, Right shoulder: 3), mismatched arm and knee attachments from
wear-and-tear (Right bracer: 21, Left arm: 18, Left Knee: 3, Right Knee: 4), and matched legwear to
protect his thighs (Left & Right Leg: 17).

After the basic armor attachments have been set, you can apply gear attachments as well. Gear
attachments are items that are not directly attached to the armor itself: helms, belts, gloves, cloaks, and
boots. Gear attachments are located directly beneath the Main type armor setting, and are handled in an
identical fashion. In the example, to equip the given armor set with leather gloves, scroll down in the
menu to the Gloves Type menu, click the check-box next to the menu to turn on the gear attachment,
select Leather, and set the desired variation (model #3). Using this same method for the other
attachments, you can easily set the armor set to have a very unique and distinctive look with no hassle.

After all of the attachments have been set, you can begin tinting the armor. Next to each armor piece
main, attachment, and base there are three squares that control the tint color for each piece of armor,
in order of importance (first color covers the bulk of the item, with the second and third colors as the
secondary and tertiary details). When setting a tint, click on a tint button and select a color within the
Color Edit Form (which is identical to the one used to set weapon tints).
Although the base armor is only able to take the latter two tints listed, it is possible to set three tints on
it temporarily: this is done in order to take advantage of the Apply To All button that sits immediately
below the main armor tint buttons. The Apply To All button automatically migrates the color settings of
the base armor to all of the armor attachments so that they do not need to be set individually (but they
can be if desired).
For Pitneys armor, if the main colors are set to be (in order of appearance) Pale Warm Brown, Darker

Yellow Orange, and Dark Yellow Orange, only the second two tints will actually appear on the base armor,
but pressing the Apply to All button will set all of the armor attachments to those same settings. [Note:
gear attachments are not included in this change; they are tinted individually.] The below examples show
a screenshot previous to pressing the Apply to All button (left picture), and after (right picture): you can
see that the base armor tints featured at the top have been migrated to the attachments, and are showing
up on the model.

Once all of the attachments and gear are set and properly tinted, return to the Properties tab to finish
up the item: setting the icon used (it_al_padded04 for the example), the material type (since the example
armor is padded, it should be kept as Non-Specific), other desired property tweaks, and setting the Item
Properties. In terms of the example: Pitney once won a bet with Tarmas, so the local wizard grudgingly
enchanted the item with a pair of smaller spells the Item Properties should be set up to reflect this. Open
up the Item Properties menu, open up the Bonus Feat selection in the Available Properties menu, and
select the Toughness feat this is one of many available feats that can be included on an item for a
character to take advantage of. In addition to this, scroll down to the Cast Spell selection in the menu,
select the Light spell, and set the Cost Value to 1 Use/Day. If the player wants to use this spell, they can
equip the armor, and right-click on the armor in their inventory to bring up the menu to cast the spell
or use the Item Property Activation Preference to set the items magical properties to be usable even
when the item is unequipped.

Once the properties of the armor have been set, save the changes made and the armor should be ready
to be placed into a module and used.

6.6 How to create a key


This tutorial is going to example how to add a key to your blueprints as they are not included by default.
Credited given to Kal_Agrim from the Bioware Boards as he posted the instructions there.
The first thing we need to do is to go to the Items tab, which is located in your Blueprints.

Next we need to create a new item, click on the Items tab in the Blueprint Menu to bring up all of the
items in the game. Right-click anywhere in the New Item field to bring up a small pop-up menu: within
that menu, go to Create Blueprint, and select Module (this is unless you wish to create an item usable
in any module: if you want to do that, select Global instead). This process creates a new item template
for you to work with within that particular module group.

You will now see "item1" added to your blueprints:

Now left click on item1 so that it is selected and we need to amend the properties:

The fields that you need to change are highlighted in red.


Icon: This is the icon that is displayed in the players inventory, you can choose from the following:
"it_key_fancy", "it_key_complex", "it_key_black", "it_key_brass", "it_key_wood", "it_key_iron",
"it_key_stone".
Base Item need to be changed to key
Resource Name the name of the actual file on disk (the official filename of the item)
Localized Name the name of the item.
Localized Description base descriptive text for the item: this appears on normal items, or
unidentified items before they have been identified.
Tag name by which an object can be referred to in script [Note: the tag, Resource Name, and

Template Resref are all usually the same name, to keep things simple]. It is generally best to use
unique tags, but unlike resrefs, two items can have the same tag.
Classification how the item is ordered within the toolset. Look at the Classification of other
items and if you want your item to be included in the same Category then use the same
classification number and do not forget to include the curly brackets.
Localized Description (when identified) descriptive text for the item after it has been
identified.
Now we can place the key in a chest and test it in game. When a player opens the chest they will see the
following:

Chapter 7: Sounds
7.1 How to add sound
In this tutorial I am going to show you how to add sound to your area. In the picture below, I have added
the CliffsMForge1, with the Chimney Smoke and the Fireplace placed effect:

Now to add a bit of realism to our placeable, lets add a fireplace sound to the forge. To do this, go to your
blueprints and then click on the sound button:

Here we see a bunch of sound categories and the one we are after is under Environmental - Fire Fireplace:

Left click on Fireplace and then move the crosshaired cursor over to your area preview and then left click
near the forge itself and you should see a blue funnel type icon like so:

If you now zoom out you will see that the sound has created a dome shape, which shows you the radius
of the sound (i.e. where the player has to be to hear the sound of the fireplace):

Chapter 8: Triggers & Waypoints


8.1 New Area Transition
New area transitions allow the player to move from one area to another by clicking on the Area Transition
trigger as shown below:
To place a New Area Transition Trigger go to your Blueprints - Triggers and then New Area Transition:

Now move your cursor to the area preview window and you will see the cursor is now a cross. Click for
example the four corners of a square and you will see something similar to this:

Please note that the bigger the trigger then the bigger the Transition placeable will be to the player. The
next thing to do is to paint a waypoint where our player will end up when they go through the New Area
Transition. So go to the destination area, click on Waypoints in your Blueprints and then click the plus sign
of Empty and then Waypoint:

Now click on the preview area where you want the player to appear and also you can move the waypoint
so that the player will face in the direction that the waypoint is pointing to:

The next thing we are going to do is to give this waypoint a unique tag so that when the player hits the
New Area Transition, they will appear at the right waypoint.

For our example I am going to call the tag area2 as you can see here, waypoint1 may be a better name,
but the naming convention is up to you:

Now we need to go back to our New Area Transition trigger and point it to this waypoint. To do this use the
Select Object in the Filters Toolbar and then click on the trigger (it should be highlighted with a green
outline). Now look at the properties of the trigger and it will look like this:

Locate the Behavior section, and set the following fields:


1. Link object type. Determines whether your area transition will send the player to a door or a
waypoint. From the dropdown menu, select Transition to a door if you want the player to be sent
directly to a door object. Select Transition to a waypoint if you want the player to be sent to a
particular placed waypoint. (If you select No Transition, then your area transition will do
nothing.)
2. Linked to. Sets the tag of the door or waypoint destination. [Note: You must be certain that
this tag matches the tag of your door or waypoint exactly, and that this door or waypoint is actually
placed somewhere in your module.] In our example this must be set to area2
3. Party Transition. Determines whether the entire party is sent to the destination door or
waypoint. If this field is set to true, the entire party will be transitioned to the new area when any
one member of that party enters the area transition trigger. If this field is set to false, and a
member of the party enters the area transition trigger, that member will be sent to the new area,
but the other party members will be left behind. In general, it is a good idea to set this field to True.
4. Localized Name. This is the name that is displayed to the player. Maybe use it as a description
of where the player might be going (i.e. to the harbour).

Now you should test to see if it works and if it does not then double check the tags and there spelling
etc...:

8.2 Walkmesh Trigger


In the Triggers tab of the Blueprints window there is a special trigger called a Walkmesh Cutter.

This special trigger displays in blue and is used to more finely control where a character can walk. Its
usually best to place these with the camera directly overhead. In this example we are going to create a
small mound and then make it so that a player cannot walk on it.

As you can see in the above picture the mound is walkable, so instead of using the Non Walk button we
can use the Walkmesh Trigger instead. To use the walkmesh cutter to make the mound non-walkable,

click on the 'Blueprints' tab and then the 'Triggers' button and then click on the '+' next to Empty and you
will see the Walkmesh Trigger in the list. Click on it and then move your cursor over to the area preview
pane (Make sure your filters toolbar has Paint Objects button highlighted).
Do not forget it is best to view the mound from above and then left click your first point and then move
your cursor to the second point and click and continue this process till you have the trigger covering the
whole of the mound. As you are clicking you will notice that the toolset will automatically close the trigger
with the first and last point you click.

Once you are finished you can select the object by clicking on the Select Object button and then left click
on your trigger and it will be highlighted in green. You can then move your trigger or delete it.
You will then need to "bake" the area and when that process is finished and you click on the Baked button
in the toolbar you will see a white line surrounding the mound like a placeable when it is baked.

8.3 Waypoints
In this tutorial we are going to make an NPC walk through a number of waypoints. I am going to assume
that you know how to create an NPC.
The first thing we need to do is to place our NPC in an area, so go to the Blueprints - Creatures and then
select the NPC.

Move the cursor over to the area preview and click where you want your NPC:

Now with the NPC selected, right click on it and then select Create Waypoint:

and you will then see a yellow flag in front of your NPC:

If you click on the flag and look at the properties have a look at the tag of the waypointing. My NPC tag
is blacksmith and the first waypoints tag is WP_blacksmith_01, so a waypoint will always start with
WP_Tag of NPC_waypoint number. Move the first waypoint away from the NPC (you will see why in a
moment) and with the NPC selected, create another waypoint. Take a look at the properties of the
waypoint and in particular the tag, you will see that it is now 02. Move this tag to its location and then
repeat the process till you have enough waypoints for your NPC to travel where you want it to travel.

As you can see above I have create a simple path for the NPC to follow, you can now test it.
If you change the tag of the NPC then the NPC will not walk those waypoints. For example if I change my
NPC tag from blacksmith to baker then I will need to change all the waypoints so that the NPC still walks
around the house. To do this select all the waypoints (hold down the shift key and click on each waypoint)
and then right click and then left click on Create Waypoint Set. You will see a Create Waypoint Set dialog
box and you just need to add baker after the WP_:

You can see near the bottom that the waypoints will change to WP_baker_01, WP_baker_02 and so on.
This will allow our newly tagged NPC (baker) to walk the 4 waypoints again.
You may find that the waypoints are too predictable and you may want your NPC to travel to the different
waypoint in a more random fashion (i.e. instead of walking to waypoint 1,2,3,4,1,2,3,4 you may want the
NPC to walk total random waypoints 1,4,3,2,3,4,5,2, etc). To do this you are going to have to add the
following script (thanks to Charles Mead from Obsidian):
#include "ginc_wp"
void main() { int iCurrentWP = GetCurrentWaypoint();// the waypoint we just arrived at
= iCurrentWP+1; if (iCurrentWP>4) iNextWP = 1; SetNextWaypoint(iNextWP); }
Add this to the NPC heartbeat script and it will walk to random waypoints.

int iNextWP

Chapter 9: Merchants
9.1 Create a Store
In this tutorial we are going to create a store for your area so that players can buy and sell things to the
merchant.
First thing to do is to build the shop itself, which I will leave you to do. Once you have the shop how you
want it (in this tutorial I am going to use the scenario of a Blacksmith - so my area is full of
armour/weapon racks, forges and an anvil, etc).
Next thing we need to do is to place our merchant in the shop - after all need to buy and sell to someone.
Once our character is placed we need to select it (Make sure the Select Objects is selected in the Filters
toolbar and then left click on the creature) and then look at the properties of the creature. You need to
change the Faction ID of the creature from whatever it is currently to Merchant (The Faction ID is found
under Behavior):

Next thing we need to do is to give our Merchant a conversation so that it can talk to the players. To do
this we need to select the Conversation tab, which you should notice is the next tab along from where your
areas are listed. Once you have clicked on the Conversation tab, right click in the area within the tab and
then left click on Add. You should now see in your conversation list an item called Conversation1 and also
in the main pane an item called Root.
Click on Root so that it is selected and then right click on it and then left click on Add and you should see
the following popup:

Where it states "Enter text here", replace it with what the shopkeeper will initially say to the player,
something like "Welcome to Thunderhammer's shop" and then click on OK. You will see what you just
typed appear just below the Root and now our next step is to type in what the player will say to the
shopkeeper.
To do this just right click again in the white area underneath our Welcome message and then left click on
Add. You will notice that this popup is very similar to our last one, except that in the top left hand corner
it mentions "Enter what the players says next:". Enter something along the lines of "Hail and well met. I
would like to see what you have for sale" and then click on OK.
Next thing we need to do is to give the player the option to pull out of the conversation just in case they
accidentally click on the NPC or have had a change of heart. Left click on the "Welcome to" line (You
should see that the text is in red - NPC lines are in red and Player conversations are in Blue) and then in

the white area beneath the conversation right click and then left click on Add.
Again the top left hand side will state "Enter what the players says next:" and replace the "Enter text here"
with "Sorry to have troubled you, but I am not interested" and then click on OK. The conversation should
look something similar to this:

Now left click on the "I would like to see what you have" and then right click on the white space below
again and with the ACTION node selected, click on Add and then click on OK. You will now see a line in
between the two END DIALOG lines which starts with CONTINUE, with this line selected look below and
you will see Add, Remove, Move Up, Move Down, Preview:

Click on the Add button and you will see the following:

Under script, click on the drop down menu and then from the list choose the "ga_open_store" (Double
click on it). Now click on the Refresh button next to the script and you will see "sTag (String)" appear, but
leave this for now. Next click on the Blueprints and then the Stores button:

There are a number of predefined stores to choose from, so for our Blacksmith example I am going to
choose the Weapon Store - Medium. You can see the tag for this store which is g_it_weapmed and you will
need to type this tag into the sTag (String) box, like so:

With that done we can close the conversation and we will be prompted to save the conversation so click
YES. Now the name of our conversation is Conversation1, which is not very descriptive so lets change this
by renaming it. Right click on Conversation1 and then left click Rename, for this tutorial I am going to
name it ThunderStore.
Now we need to add the store itself to the area so choose the store (in this tutorial it is the Weapon Store
- Medium) and paint the store underneath the storekeeper like so:

The last thing we need to do is to attach the conversation to our storekeeper so left click on the
storekeeper so that it is selected and then change the conversation field under Behavior by left clicking in
the field and then left click the downward arrow. You will see your conversation in the list so double left
click on it and the field should look like this:

Now save the area and run the module.


TIP: You will notice that the conversation acts through a cut scene, which may not be everyones cup of
tea and maybe tedious after visiting the storekeeper on the 15th occasion. If you want to change it then
open the conversation and look at its properties. Under Behavior change the Neverwinter Nights 1-style
Dialogue to True as shown below:

9.2 How to create a custom store


In this section, I am going to show you how to create your own custom store. The toolset comes with a
number of predefined stores, but they may not meet you needs. However, you have the power to create
your own. First thing you need to do is to click on the Blueprints tab and then the Stores button:

Right-click underneath the last listed store to bring up a small pop-up menu: within that menu, go to
Create Blueprint, and select Module (this is unless you wish to create a store that is usable in any
module: if you want to do that, select Global instead):

You will notice that you have a new store at the end of the list, like so:

Now lets take a look at the properties of this new store by clicking on the properties tab:

Black Market?: If this is set to TRUE then the store will buy items that are marked as Black Market or
Stolen
Black Market price percentage for buying items from the player: The percentage of the items
value that the store will buy the item for if it is marked Black Market or Stolen.
Identify Price: How much the merchant will charge to identify an item.
Price Percentage for selling items to Players: The percentage of the items value that the store will
sell the item to the player.
Price Percentage for buying items from the player: The percentage of the items value that the store
will buy the item from the player.
Maximum Buy Price: This is the maximum amount the merchant will buy an item from the player.
Store Gold: This is the amount of gold the merchant has to purchase items from the player.
"Will not buy list": This is where you can make a list of items that the merchant will not buy from the
player. Click on the ... button and then either double click on the item or a single click and then hit the Add
button. Once finished click on the OK button.
"Will Only Buy": Opposite of the above.

Once we have set our properties for the store, we can now add what items the store has in stock. To do
this we need to click on the Store tab and as you can see it is empty:

At the bottom of the Store tab are 5 more tabs (Armour, Miscellaneous, Potion, Ring and Weapon) plus an
edit button:

Click on the edit button to get the following pop up box:

Now this is where we have to be careful as in selecting the right tab on the left hand side and the items we
are going to add on the right. The store would look stupid and also confusing to the player if we had scrolls
or weapons listed under the Armour tab.
In this example I am going to make a Shoemaker Store (i.e. the merchant will just sell boots) so I will
need to drill down in the Armour Items on the right hand side and then click on the plus sign that is beside
the Boots heading. Now you can just left click the top Boot listed (Plate Boots) and then you can click on
the Add Item Button, which will add the Boots to the Armour tab on the left hand side. You can of course
add more than one item by clicking on the first item that you want and then hit the SHIFT key plus left
clicking on the last item. This will now highlight all the items including and in between the first and last
item. You can also hit the CTRL key and left click to select a number of items as well.

If you add the wrong item, you can select the item on the right hand side and then click on the Remove
Item button. Once an item has been added we can make the store have Infinite amounts of that particular
item, make the items Droppable or for you rogues out there Pickpocketable.
Once you have finished adding/removing items, click on the OK button and you will now see items listed
under the Stores tab (make sure you select the right tab for the item i.e. Armour, Weapon, etc).

Chapter 10: Conversations


10.1 Conversation Basics
Conversations are an important aspect of NWN2 gameplay. They are used to talk with companions, trade
with a merchant, and get quest information from NPCs. At its heart, a conversation is really just a
branching menu, so a conversation doesnt necessarily have to be two people talking if you want a
player to encounter an inanimate control panel with three switches, a conversation with three responses
would be an effective way of representing the situation.

10.2 Anatomy of a conversation


Conversations can appear complicated at first, but you will soon be able to write them quickly.

This screenshot shows a portion of Pitneys conversation in the Sample Module, 0100_UninvitedGuests.
Conversations (sometimes referred to as dialogues) are arranged in a branching tree, not unlike a folder
directory in Windows. Each row or line in the conversation is referred to as a node. The leftmost section
is the text, which is what is displayed to the player.
Red nodes are lines that are spoken by the NPC. Blue nodes are the players responses. A blue
[CONTINUE] means that the player has no choice to make at that node. In these cases, the conversation
will proceed to the next red line, allowing an NPC to make multiple statements before the player responds.

1. The text for the currently selected node. All of the information in the Node Properties section (D)
refers to this node.
2. A series of options from which the player can choose. After the preceding red node fires, the
player will see these options and can click on (or press the number of) the one he wishes to select.
Note the + sign to the left of these nodes, which shows that they can each be expanded.
3. Other node information. By right-clicking on this region (choose Columns) you can set which
columns of information will be displayed. In this screenshot, you can see Actions, Conditions, and
Quest information for each node.
4. Node Properties. This section contains more details on the selected node.
5. Text. The text for the selected node is shown here. Just click on the text box and type to change
what the NPC says (red node) or what player option is presented (blue node).
The grey nodes are links to other nodes within the conversation. Using links prevents you from having to
type the same line for the same situation.

To add a node to a conversation tree, just right click on the preceding node and choose Add. A New Line
window will appear. Just type in the text youd like the player to see. (The language selection Dropdown
Menu and the Edit String Ref button will not apply to your modules, but are used for the official
campaign.)

10.3 Conversation scripting basics


Scripting in NWN2 is very powerful and can be complicated. In creating the official campaign, we had
many scripters who are a specialized type of designer (or a specialized type of programmer, depending
upon your perspective) who spent their time mastering the scripting tools and possibilities, creating new
global scripts to be used in area creation. The details of scripting are beyond the scope of these HowTos,
but well discuss some of the very basics in the context of how scripts can be used in conversations. The
best way to learn more about scripting is to experiment with the Sample Module and see how we were
able to create it. Then play around with conversations and scripts in your own modules.
Conditions
Conditions are test scripts that are attached to a conversation node and are either TRUE or FALSE. When
a condition is TRUE, then that conversation node fires (is executed). For example, you might have an NPC
who has two possible greetings: the first is warm and friendly while the other is cold and standoffish. If
you placed a condition script on the first node to check if the player is an elf, then elves would get the
warm greeting and other races the cold one. In this case, the condition script is being used to help
establish the personality of an NPC.
In the Sample Module, conditions are used to determine which of Pitneys dialog nodes will be displayed,
based upon the players quest state. If the player declined to help Pitney, then the poor fellow pleads
again with the player. If the player has killed the lizardfolk, then Pitney expresses his gratitude.

If a condition is not met, then the player will never see that conversation node. For a series of player
responses (blue nodes), this might mean that the player only sees 3 of the 4 possible choices. For an NPC
statement (red nodes), the first node whose conditions are met is shown. If you experiment with the
Sample Module, you will notice that there are 5 initial nodes for Pitney. Which one the player sees depends
upon what has happened so far.
1. Node Properties Tabs. These tabs let you view different properties of the conversation node. (In
this screenshot, the Conditions tab is shown.)
2. Condition Operators. If a node has multiple conditions, you can specify And or Or to indicate
whether they must all be true or if only some of them need to be true for the node to fire.
3. Script Name. This text box contains the name of the condition script. In this case, the global
script gc_journal_entry, which checks a journal (quest) entry, is being used.
4. Script Parameters. The remainder of the row for each condition shows what parameters are
passed to the condition script. In this case, the parameter sQuestTag is given the value
01_lizardfolk and the parameter sCheck is given the value 10. The use of script parameters is
very powerful and allows a single script to be used in dozens of conversations. For example,
gc_journal_entry can be used to check any state for any quest in the entire game! The use of
parameters for scripts is a new function of the NWN2 toolset. [Note: If you add a global script to
Conditions or Actions, or swap one script for another, click the Refresh button to set the
appropriate parameters for the new script.]
5. Script Code. The documentation and code for the condition script is shown in this window.
Actions
An action is a script that is used to accomplish a wide variety of tasks. An action script is executed when
a conversation node fires. For example, an action could cause an NPC to become hostile to the player,
move the player to another map, or place gold in a treasure chest. In the Sample Module, an action script
is used to reward the player with experience points for completing his quest for Pitney. Action scripts are
set for nodes similar to how condition scripts are set.

10.4 Writing a conversation


Lets try writing a conversation for victim of the lizardfolk holed up in Pitney Lannons house. The player
can talk to this person after dispatching the lizardfolk. To create a new conversation, use the Dropdown
Menu at the top of the Toolset and select File - New - Conversation.

Your new dialogue will be entirely empty, save for the Root node. As mentioned in the earlier overview of
a conversation, you can add your first line by right-clicking on the Root node and selecting Add. This will
bring up the New Line window where you can input the first line of the dialogue. Note that the first line
after the root is always an NPC line.

Once you hit OK the New Line is added and you have the introductory line for the victim.

If you were to add a line to this red NPC line, youd be adding a player response node. If you wanted the
NPC to say two lines before the player responded, youd have to make an empty player node between the
red NPC nodes. Try adding a blank line to the introduction.

End Dialog? If a Player node has NO responses attached to it, it is a conversation-ending node. Lets see
what happens if we add another NPC line after the highlighted, empty PC line.

The blue player node switched to [Continue] now that an NPC line follows it. Now that the NPC has said
two lines, lets add some player response nodes. To give a player multiple possible responses at one time,
add multiple times to the same node. If you want three possible responses to the I cant feel my leg
line, right-click then Add on that line three times.

Now you have three possible PC responses to that line. Fill in text for each line by clicking on the line, and
then typing in the text box (lower-right of the dialogue editor with the Insert button).

Since these lines dont yet have any text following them, they are dialogue-enders. If youd like, you could
continue to add NPC nodes, and subsequent player nodes, to your hearts content. The basics of adding
lines are quite simple.

Stores
Stores are only accessed through script in a conversation they are not objects that the player can
detect. Stores have blueprints just like other types of objects. After you create your stores blueprint,
place it on the map normally. It is generally best to place your store next to the NPC.

1. Store Dialogue Node.


2. Script ga_open_store. This action opens your store. It is given the stores tag as a parameter.
3. Store Properties Panel. To edit the contents of your store (and to initially assign its tag), open
its Property Panel. Click on the Store tab, then click the Edit button to change its contents. You
can them place instances of any blueprint item into your store.
4. Area Contents. All stores in an area can be seen here under the Store tab.

Fall-through
Fall-through is a term for creating multiple NPC nodes and assigning conditions so that, if the first node
cant be displayed, the process falls through to the next red NPC node down the line. As mentioned
earlier in our discussion of conditions and actions, a node can be given a condition and if that condition
is FALSE, the line will not be displayed. Observe Pitney Lannons conversation:

Notice how there are 5 red NPC nodes off of the root (indicated by the vertical line dropping down from the
word Root). The first red NPC node that is TRUE is displayed, and the conversation follows the nodes
under it the other nodes are effectively ignored. Here, the author has used comments in pipes to
indicate when and why each red NPC node is used. When first speaking with Pitney, the first red line fires.
Next time in the dialogue, the game checks to see if the player refused to help and if so, it plays the
second red line, otherwise, it checks to see if hes agreed to help and so on.
As you experiment more with conditions, you can use fall-through to create very powerful, reactive
conversations. The player may feel like its five completely different dialogues, all custom-tailored to what
events took place already when really, its just one conversation using fall-through to create a smart
dialogue.

One-time-only Nodes
You may occasionally want an NPC to speak a line once and never repeat it again. For example, in the
Sample Module, Pitneys initial conversation (in which he tells the player about his problem and begs for
help) occurs only once. After this, Pitney will respond based upon the players quest state. This is to create
the illusion that Pitney knows and remembers the PC.
To set a dialog node as one-time-only, click the node in the Dialog Editor, and select the Node tab in the
Node Properties window (at the bottom of the screen). Click the Show Once field, and you will be able
to select from a drop-down menu. The Show Once field defaults to Always, which means that the node
will always appear, unless Conditions dictate otherwise.

Set the Show Once tab to Once per game to ensure that the node will only be called once, and will
never appear again. Be certain that a fall-through node follows the once-only node, however, or the
conversation will simply close. For Persistent Worlds, it may be wiser to set the Show Once field to Once
per creature that uses this conversation. Otherwise, the node will be displayed for the first player who
views the dialog, but will never appear again!
Conversations are placed on any creature or object that will talk to the player. Select the creature or
placeable and, in that objects property window, look for the Conversation field. Click on the field next
to Conversation and click the dropdown button. A list of conversations available in this module will appear
and you may select the one to apply to the creature. Now, when the player tries to talk to this creature,
the conversation event will take place.

Links are an incredible time saver when writing large dialogues. If you want the conversation to return to
a previous set of options, links let you do so without typing re-typing everything over again.
Continuing with the previous conversation, lets say that the survivor is clinging to life, and if the player
asks questions, the victim shortly collapses in exhaustion. In effect, the dialogue would look like this:

Notice that the Why should I help you? and Who are you? nodes lead to exactly the same text. Writing
this out is more work than is necessary, and it clutters your conversation. Theres an easier way using
links to streamline this conversation.
First step is to remove everything after the Who are you? line its no longer needed. By Right-clicking
on the Please help me line and selecting Remove, that red NPC node and all nodes connected to it
are purged.
Next step is to set the link. We want Who are you? to link to the line under Why should I help you?
Right-click on that line and select Set Link Destination.

This flags the NPC node as being the new destination for any other player node in the dialogue. Adding this
to the Who are you node? is as simple as right-clicking on the node and selecting Insert Link.

Once in, youll see a grey node attached to Who are you? This indicates that if the player were to select
Who are you? they would get bounced to the same node as if they selected Why should I help you?
If you ever forget where a particular gray node leads, just double-click it. The editor will take you to the
destination node.
Links make the difference between writing a large conversation in a few minutes versus a few hours.
Pipes and Braces can be used to write text that shows up in the Toolset but NOT in game. Thus, if you
are writing a long conversation and need to leave notes to yourself that you dont want players seeing in
game, you can place your text in pipes, |like this| or in braces {like this}.

The line above may look messy but the player will only see the text Thank you stranger, I wont forget
your kindness! The conversations author can keep tabs on what kind of response this is and leave a note
to return later and add a bump to the players Good alignment neither of these notes will ever show up
in the actual gameplay.
Barkstrings are conversations with only NPC nodes and no player responses. When speaking to an
object with a barkstring conversation, the game does not stop for a full branching conversation. Instead,
the one red node of dialogue floats over the speakers head without any halt in gameplay.

10.5 How to add a cutscene


An overview of setting up a cinematic-style cutscene conversation
What you will need:
1) A
conversation 2) A blocking script 3) A way to begin your cutscene (either a speak trigger, an
on_client_enter script or something else) 4) Plus the area, npcs etc., etc., etc.
Scene Overview: This
is what a cutscene might look somewhat like, once it is setup in the area.

This particular cutscene


uses a lot of different camera angles with static cameras, but you do not necessarily need to use any static
cameras for a given cutscene.
Conversation Editor In this particular image, you'll see that there are no PC nodes for the
conversation.
They are all simply: "||"
In this case, the cutscene involves the PC watching an NPC
through a series of shots speaking to a crowd. And the PC does not get involved till later in the scene. A
blank PC node will get skipped, at least visually, in the flow of the cutscene. Though you can add blank PC
nodes and put a delay on them to create a duration shot on the PC without any option to choose dialogue.
Most of the settings in terms of putting together a node are the same for NPCs and PCs, there are some
differences regarding animations and lip synching.

Conversation Editor - Actions Node In this next image, you will see the actions tab for a particular
node, on the actions tab you can add scripts or scripts and parameters that will fire when the node is
reached in a conversation. Multiple actions can be added to each node.

NPC Blocking A
particular use of the action node is for a blocking script, which will have a single parameter that will be
passed through a switch. Each numbered case in the blocking script will correspond to a particular line in
the conversation, and will contain the scripted actions that you want your NPCs to take during that line.
Conversation Editor - Conditions Node In the next image, you will see the conditions tab. The
conditions tab is used to check for conditions before using the node in the active conversation. Like the
actions tab, multiple conditions can be added to each node.

In the above image, the


gc_global_int script is used, with the first parameter being the name of the int, and the second parameter
being the string that will be converted to the value to compare against.

In the above image, the


name of the global int checked is "marbleDistrictFired"

In the above image, the


value we check against is "1". Other values can be used, such as ">4" or "!=3" etc.
Conversation
Editor - Node Tab The node tab in the conversation editor is for:
1) Setting up the NPC's animations
2) Setting a delay on the node 3) Establishing who the speaker and listeners are for a given node 4)
Setting up what, if any, static or user defined cameras to use 6) Linking a sound file to the node 7) Lip
synch 8) Inserting a .tga image into the cutscene
In the following image, you'll see the node tab:

In the top half of the node


tab you see:
1) Show Once - This setting determines if the node will show once per game, once per
creature, once per conversation or always. You can make things as complex as you want with these
settings, but if you are using some means of determining whether the cutscene will fire, such as checking
a local int on the area, then you can leave these set to "always"
2) Camera Settings - The camera
settings are detailed below
3) Delay - This is the delay in terms of how long the player has to wait until
they can click past the current line of the cutscene
4) Quest - Linking to a journal
5) TGA To Display
- You can display a targa file in the context of the cutscene (See the Act 1/2/3 images in the OC for an
example of use)
In this next image, the camera settings field has been expanded:

In the camera settings you


will find:
1) Orientation - Does not appear to be adjustable as of the 1.03
2) Movement Type - None,
Track and Pan.
Tracking is when a camera moves in the same direction as the speaker, focused on the
speaker, and without any change in angle (pitch/yaw/roll).
Panning is when the camera stays
stationary and changes pitch (around Z) to follow a moving speaker.
See image for reference:

the field where you input the tag of your static camera, if you are using one.

3) Static Camera - This is


See image for reference:

4) Shot Type Some


are self-explanatory.
Behind the Head
Close up
Establishing - a wide shot that will clearly establish
where the speaker is in the environment
Long - More narrow than a wide shot
Medium - More narrow
still, probably pretty close to a two-shot in scope, but centered on the speaker, as opposed to on the axis
between the speaker and the listener
Over the Shoulder - Abbreviated OTS sometimes
Side - Side
view of the speaker
3/4 - Most of the speaker's body in shot
Top Down - self explanatory
Torso Just the speaker's torso
Two shot - The speaker and the listener in the same shot
Walk-by - The
camera will track quickly past the speaker as they talk
Worm's Eye - Ultra low angle shot from the
ground up
See image for reference:

5) Mode - Camera mode is


either random, user defined or static camera.
Random will randomly use one of the Shot Types listed
above.
User defined will use whichever shot type you select from the list, along with any movement
type.
Static Camera will use whichever static camera is referenced in the Static Camera tag field up
above.
See image for reference:

Conversation Editor - Node - Animations Drop Down List

The drop down animations


list has a long list of all of the animations available for all models. Some of the models do not have all of
the animations.
FACIAL_XXXX animations will break lip synching.
TALK_XXXX animations are the
general talking animations.
The other animations can be used, some with good effect, it just takes
playing around with them.
Firing Your Cutscene
You can find a template of the OEI script below
listed under the Templates Tab in your script editor. (The tab only seems to load the templates the first
time you open a new script in the toolset right now).
The script is for the on_client_enter event of the
area in which the cutscene occurs. You set your speaker's tag and the name of your conversation where
indicated. You can use an int on the area of the cutscene to condition the thing to happen only once.
Alternatively, there are a million ways to handle how many times/under what conditions the cutscene
happens.

// Area OnClientEnter Cutscene.nss /* Area OnClientEnter event handler


template. Setup cutscene(s) to fire when the party enters a new area. This script
will execute after a group area transition using JumpPartyToArea().
bCutsceneCondition will determine if a cutscene should play, but each cutscene is
restricted to play only once.
HOW TO SETUP A CUTSCENE: 0. Copy and paste
script block into "CLIENT ENTER CUTSCENES" 1. Specify a title for your cutscene
2. Replace (FALSE) with condition to play cutscene 3. Specify Speaker and Dialog
of conversation 4. Add additional cutscene scripting
// Cutscene: 1. Example
Title if (GetIsCutscenePending(stCI) == FALSE) { bCutsceneCondition =
(FALSE); // 2. Replace (FALSE) with condition to play sSpeakerTag = ""; // 3.
Specify Speaker and Dialog sDialogName = "";
stCI = SetupCutsceneInfo(stCI,
sSpeakerTag, oPC, sDialogName, bCutsceneCondition);
if
(GetIsCutscenePending(stCI) == TRUE) { // 4. Additional cutscene setup } }
*/ // BMA-OEI 2/3/06 // BMA-OEI 2/7/06 added speaker == PC check //
ChazM 2/7/06 modified implementation // ChazM 2/7/06 moved funcs to
ginc_cutscene // BMA-OEI 2/7/06 support multiple cutscenes // BMA-OEI
2/7/06 revert original controlled char // BMA-OEI 2/8/06 added comments, Group
Area Transition restriction
#include "ginc_cutscene"
int StartingConditional()
{ // Do not execute if OnClientEnter was not fired from a group area transition if
(FiredFromPartyTransition() == FALSE) return (FALSE);
// Get party leader,
force control of owned PC object oPC = GetFirstEnteringPC(); object oLeader =
GetFactionLeader(oPC); oPC = SetOwnersControlledCompanion(oLeader);
//
Initialize temp CutsceneInfo struct CutsceneInfo stCI; stCI =
ResetCutsceneInfo(stCI); int bCutsceneCondition; string sSpeakerTag; string
sDialogName;
// *** START CLIENT ENTER CUTSCENES ***
// Cutscene: 1.
Example Title if (GetIsCutscenePending(stCI) == FALSE) { //local int named
bDone is checked from the area you enter, returns false, then run the cutscene
//the return of bDone is passed as a parameter to SetupCutsceneInfo() which is
defined in ginc_cutscene
bCutsceneCondition = (GetLocalInt(OBJECT_SELF,
"bDone")==FALSE); // 2. Replace (FALSE) with condition to play
sSpeakerTag =
"scorsese3"; // 3. Specify Speaker and Dialog sDialogName =
"ca1_marbledistrict"; //Speaker doesn't have to be any of the NPCs talking //in
the cutscene, just a valid object for running a convo
stCI =
SetupCutsceneInfo(stCI, sSpeakerTag, oPC, sDialogName, bCutsceneCondition);
if (GetIsCutscenePending(stCI) == TRUE) { SetLocalInt(OBJECT_SELF,
"bDone",TRUE);// 4. Additional cutscene setup }// }
// *** END CLIENT
ENTER CUTSCENES ***
// Cue cutscene or revert control to original character
if (GetIsCutscenePending(stCI) == TRUE) {
FireAndForgetConversation(stCI.oSpeaker, oPC, stCI.sDialog); } else {
SetOwnersControlledCompanion(oPC, oLeader); }
// If cutscene is pending,
fade to black return GetIsCutscenePending(stCI); }

For reference, an image of the script in the script editor:

NPC Blocking Scripts and Other Stuff In addition, you probably want a blocking
script, as mentioned up above.
A blocking script is simply a switch/case statement with
each case numbered according to node.
//We add the parameter to main up top void main (int nScene) { //Here We would
define anything we want to be usable //in all of the cases
switch (nScene) {
//nScene will be the parameter of this script on the action tab of //the nodes in your
cutscene case 1: { object oDoor4 = GetObjectByTag("door_dcc_4");
AssignCommand(oDoor4, ActionOpenDoor(oDoor4)); } break;
case 2: { object
oDoor2 = GetObjectByTag("door_dcc_2"); AssignCommand(oDoor2,
ActionOpenDoor(oDoor2)); } break;
case 3: { object oDoor3 =
GetObjectByTag("door_dcc_3"); AssignCommand(oDoor3, ActionOpenDoor(oDoor3));
} break; }
}

You put your scripted actions into the case for a particular node and pass the node # to the blocking
script on the actions tab as the parameter of the script. To add the parameter of int nScene, just
type out void main (int nScene) at the top instead of just void main(). The kinds of things that you
can do in the blocking script are pretty much limitless, but include things like NPCs walking from
waypoint to waypoint during their conversations, playing different animations in different ways than

are feasible with the simple animations assignments in the conversation editor, opening, closing,
unlocking doors, spawning in creatures, etc. etc. Example of a blocking script in the editor:

I-Points

This is an i-point:

An i-point is a misc placeable that is useful as an artificial speaker or listener on a given node.

Speaker Nodes
Instead of using an on_client_enter script to startup your cutscene, you can use a speak trigger.

Static Cameras To place a static camera, all you need to do is select the one in the palette and place it
in your area. Retag the static camera something easy and descriptive, like

"myfirstscene_shot1_establishing"

Static Camera Attitude Adjusting the pitch, yaw and roll of your static cameras:
Camera Yaw
Select+shift+mouse movement left or right = yaw of the camera
Yaw is rotation around the Z-Axis,
and the standard way you rotate placeables as well.
Camera Roll Select+shift+ctrl+mouse
movementleft or right = roll of the camera
Roll is rotation around the X-axis.
Camera Pitch
Select+shift+alt+mouse movement up and down = pitch of the camera
Pitch is rotation around the
Y-axis.

Chapter 11: Scripts


So you have decided to take the plunge and learn how to script using NW Script. I have divided the course
into lessons so that you can learn a particular topic in easier and small bit size chunks.
I am in no way
shape or form an expert using the NWScript, in fact I am a novice, but with a lot of resources to hand I will
devise a beginners guide to scripting and who knows maybe even an advance guide. The main source
that I have used is Celowins Tutorials.

11.1 Where do scripts go?


First thing to look at is exactly where scripts go. You can attach scripts to items, creatures, doors and of
course the module itself. To attach scripts to the module itself, open the Toolset and then click on View,
then Module Properties.

On the right hand side you can see all the different events that you can attach a script at the module
level.:

For example On Player Death Script you can add a script here that will fire up if a player character dies so
that you could have the player teleported elsewhere or do any thing you want.
To see what a script
looks like, click on the downward arrow to the right of any event that has a script associated to it and click
on the open button as shown below:

Creatures also have scripts, so paint a creature into a test area and then right click on the creature, then
properties. In the scripts part of the properties there is a list of events, which are pretty much self
explanatory. For instance, if you wanted a particular event to happen if this creature died then you would
add a script to the On Death event:

If you painted a placeable on to our area and right click on the placeable, then properties and looked at the
scripts. Again, the placeable will have its own events that can be scripted. You will also note that
depending on the type of object (whether it be a creature, trigger, item or a placeable, etc) you will get
different list of events for each type.
As you can see finding and placing scripts is really easy.

11.2 Variables
In this lesson we will be using the Toolset, so create a new test module and paint a new area.
Lets
create a new script. First thing we need to do is to click on File - New - Scripts. Or in the Areas node, click
on the Scripts tab and then right click on a blank area and then left click on ADD.

We are now going to create a variable to hold the name of the NPCs dog. There are 3 different types of
variables:
int which is used just for numbers.
string which is used for alphanumeric (letters and
numbers). Make sure the string is unique.
float which is used for decimal numbers.

As you can see above I have typed in string as the variables name is just letters. goblins_dog is the name
of the variable and note the underscore as Neverwinter Nights 2 does not like spaces in the name. The
name of the tag is case sensitive and Zeus is the value of the variable.
You can see that I have used an
equals sign between the name of the variable and the value of the variable. As the value of the variable
is a string you have to enclose the value with quotes .
At the end of the line I have added the
semi-colon (;), which indicates that the line is complete (so do not forget them at the end of every line).
So reading the above code, every time we use the goblin_dog variable, it will be replaced with the value
of Zeus.
This is very handy and we can use the above information for an NPC to greet the player using
their name or to remember that the Goblins Dog is called Zeus.
Basically we will create a Token that will use information that we do not know what the value will be in
advanced. In this example go to the Functions list on the right and scroll till you see the
SetCustomToken function. If you left click or select the function under notes, it will tell you how the
toolset expects to see the line written (i.e. SetCustomToken(int nCustomTokenNumber, string
sTokenValue);) ).
You can either type in the function or double click on it and the toolset will add the
function for you. Complete the rest of the code like so:

You give the Token some information and it does the rest for you. As you can see above we set the
parameter at 100 and separated the next parameter (goblins_dog) by a comma and enclosed the lot in
brackets. Again, do not forget the semi-colon at the end of the line.
Once done, click on the Save &
Compile button or F7, which is the top left hand button to save and to check to make sure that the script
is written correctly:

The Toolset will automatically name scripts such as "script1",

"script2", etc, but you can right click on the script in the list and then left click on Rename:

Once saved go to the module properties (File, View, Module Properties) and then look for the On Module
Load Script field under Scripts. Click on the downward arrow in the field and then look for your new script
in the list. Select the script and you will now see the name of the script in the On Module Load Script line
so that it will run each time the module is loaded.
Now we need to add an NPC to our module and then
add a conversation to it. Create a new conversation for our NPC and enter a line such as Have you seen
my dog.
When the conversation is fired will be replaced by the variable know as goblins_dog, which
equals to Zeus (i.e. Have you seen my dog Zeus).
Variables are important, and are the only means of
determining whether most events have taken place or of changing/keeping track of different story states.

11.3 Conditionals
This lesson is going to cover what is probably the most important part of scripting... how to make your
code do something only some of the time that is, only when some condition is met.
I've already
previewed this idea at the end of Lesson 2, but I didn't give any explanation. The script I really want to
showcase in this lesson is fairly complicated, so I'm going to go ahead and talk a bit of theory first.
The
basic format for a conditional, or "if statement" is like this:
if ( condition ) { do_this;
do_something_else; do_another_thing; }
(The above is not a true script, just something to give the
general idea. This sort of example script with bogus functions is commonly referred to as 'pseudo-code')
Basically, if the 'condition' is met, the script will do the things between the '{' and the '}'. If the condition
isn't true, it does nothing. (Note on the format: It is a common beginner's error to put a semicolon after
the line starting with 'if'. There isn't supposed to be one there.)
That is really all there is to it... the tricky
part is figuring out exactly what a "condition" is. There are many, many types of conditions we can put in
here, with lots of little rules affecting how they work. I am certain that this lesson will not be able to cover
every single rule that can be put here. I doubt that I myself know all of the functions that we could call.
I can only hope to get you to the point where you know enough to understand the basics, so that you can
look at other people's scripts and learn from them.
Most conditions come down to a comparison. For
example, in the script I put at the end of Lesson 2, the relevant line was
if (nCount == 1)
Notice the
'==' is in fact two equals signs. As we discussed in lesson 2, a single equals sign is used to "set" a variable
(assignment). The double equals sign is more asking the question "are the two sides the same?"
(comparison).
Just looking at the statement, the sides look very different. One side has a bunch of text,
the other side is a number. How can there be any question that they are the same?
Well, remember
that 'nCount' is a variable and is actually equal to a number. So, it all depends on the value stored in
'nCount'. If 'nCount' is storing the number 1, then the condition will be true, and the associated actions
are performed. If 'nCount' is storing the number 7, then the condition will be false, and this statement will
not do anything.
The other major way to test a condition is through a predefined function. We'll explore
that in this next example.
Example Script Let's build a script with a simple conditional. There are going to be a number of new
functions introduced in it, I'll explain them afterward. We're going to need to do some setup for this script
to work.
* Open up the Test Module we've been working with in the Toolset. * Create a new exterior
area, dimensions 8 by 4. Call it 'Test Area 002'. * At one end, paint the module start location. * At the
other end, paint an NPC. Just make it a commoner, for simplicity. * Change the tag of the NPC to GUARD
* Go to the scripts tab of the NPC, delete all the scripts. * Go to the OnPerception event handle, and
input the following script:
object oSeen = GetLastPerceived(); void main() { if (GetIsPC(oSeen)) {
ActionSpeakString("Greetings, friend."); } }
* Save it, using our standard naming convention,
tm_guard_op (op for OnPerception) * Ok everything on the NPC, save the module, and go test it.
Run
toward the guard.... when you get near, it will speak its phrase. Run far enough away and come back, it
will speak it again. If you stay close to the NPC, though, it won't do anything.
Let me switch into
question and answer mode to try and explain this one. I'm using the same naming conventions used

before, so I won't go into those. It is just the script that I'll focus on.
Another new handle, eh? What
does this OnPerception thing do?
This one calls the attached script whenever the NPC notices
something in game. If something is invisible or hiding, and the NPC doesn't notice it, the script won't be
called.
We want the NPC to react when they see a character, hence the use of this handle. What is this
object stuff in the first line? I didn't understand it the last time you threw something before main, and now
you're pulling it again!
Well, really, we're using it the same way we did before, it is just a new 'data
type'. Before, we set up a variable to store an integer. Now, we are setting up a variable to store an
object.
I've said it before, and I'll probably repeat it again later. Nearly everything in the game is an
object. NPCs, players, items, waypoints, placeables... these are all objects. Many, many functions in the
game are written just to deal with figuring out what object is what, and many more are written to
manipulate objects.
So, we are setting up a temporary variable, which we are calling oSeen (the starting o to remind us it is
an object), and storing a value into it. What about the GetLastPerceived() part of the line?
Any of the
functions that start with 'Get' will return some sort of data. The names are usually rather descriptive...
this function gives as an output the last object that was seen by the NPC.
(As a note... I have a tough
time thinking of any time you would use this function outside of the OnPerception event handle. It gets
used in just about every OnPerception script, but basically never outside of it.)
So, putting this together
with the last question, this first line of our script is just setting things up so that we can refer to the object
that the NPC saw in the first place. You spent all that time up above talking about comparisons, and now
you've only got one thing inside your if condition! What gives?
Well, this is a peculiarity of the GetIsPC()
function. It takes an object as an input, and returns TRUE if it is a PC, or FALSE if it isn't.
But this is
exactly what we need for a condition! If it is a PC, the attached lines run. If it isn't a PC, then they won't.
If you prefer, you can change the line to:
if (GetIsPC(oSeen)==TRUE)
to make it look more like a
comparison... but as we've seen, it isn't really necessary. Do we even need the if check at all? Won't it
always be a PC that the NPC notices?
For our little test module, yes. There is really nothing else in the
module for the guard to perceive.
Everything I write in these lessons, though, I try to write in the same
manner that I would for a real module. What if there was a hostile goblin nearby? You wouldn't want the
guard to call it a friend.
For that matter, even friendly NPCs...why bother talking to them if there is no
PC around to see the interaction? Aha! Now I've caught you! It won't be that all PCs are friendly either!
Good point. Let's play around with our module a bit.
The Changing of the Guard
What we're going
to do is modify our module so that the guard will attack any PC it sees that doesn't have a special ring.
Only if the PC carries the ring will the guard call out the friendly greeting.
* Open the toolset, load up
the module, and go to Test Area 002 * First, add a ring. Go to Blueprints and then Items, Miscellaneous,
Jewelry, Rings and then Copper Ring. Place it near the module start location. * Edit the properties of the
copper ring, change the tag to PASSRING * If you're feeling ambitious, you can edit the name of the
ring, give it a description, whatever. For the purposes of the script, only the tag matters. * Now, go to
the guard and open up the OnPerception script we had before.
Change it so that it is like this:

// Friend or Foe Script:

tm_guard_op

// This should be placed in the OnPerception handle of a guard.


//
// The guard will check to see if a PC has a passring, and if not, attack.
object oSeen = GetLastPerceived();
object oRing = GetItemPossessedBy(oSeen, "PASSRING");
void main()
{
// If it isn't a PC that the guard sees, it won't do anything.
if (GetIsPC(oSeen))
{
if (oRing == OBJECT_INVALID)
{
// If the PC doesn't have the ring, attack the PC.
ActionSpeakString("Die, trespasser!");
ActionAttack(oSeen);
}
else

{
// Otherwise the PC does have the ring.

Be friendly.

ActionPlayAnimation(ANIMATION_FIREFORGET_GREETING);
ActionSpeakString("Greetings, friend.");
}
}
}
I'm starting to embellish my scripts a bit, throwing in more and more new commands. While it may be a
bit confusing at first, you'll really notice that if you start understanding the basic structure, all these
random commands start to fall into place.
Anyway, save it all, load it up as a module, and see what
happens. First, pick up the ring from the ground, and approach the guard. It should be friendly. Next, run
away, drop the ring on the ground, and approach again. It will attack you this time.
Breaking it Down
Argh! You've added another new initialization! I hate that!
All I can say is to trust me, the scripts look
a lot worse without them. So, let's take a look at this new initialization line.
object oRing =
GetItemPossessedBy(oSeen, "PASSRING");
Once again, we're setting up a temporary variable, which
will hold an object. The GetItemPossessedBy() function takes in two inputs... the first is the creature
object that you want to check for the item, the second is the tag of the item you're checking for.
We've
already defined oSeen as the person triggering the script, the one getting noticed by the NPC. So, oRing
is the ring carried by that person that has the tag PASSRING. But what if the person doesn't have the ring?
What happens then?
Well, the GetItemPossessedBy() still runs. But since it can't find the object on the
person, it comes back with OBJECT_INVALID. Basically, a fancy way of saying "No such thing." What are
all these lines starting with '//'? They look like English instead of NWScript?
Anything in a line after a '//'
is ignored by the script. These are called "comments." Any good scripter will put in comments to explain
what is going on.
It is really for your own good. You may perfectly understand a script when you write
it... but that doesn't mean you'll remember every detail a month from then when you want to modify it.
Also, it is polite to do it for the sake of anyone else that will look at your script. The more explanation you
give on what you are trying to do, the easier someone else will understand what you have written. Your
main script is looking really confusing. You have four sets of '{' and '}'! How am I supposed to keep track
of all of them?
It can be tough, I freely admit it. The more complicated the script, the more confusing
these "nested" statements can be. One trick that helps a lot is to use indentation, as I have been.
Some
people like putting in blank lines to further break the script into "blocks." Again, I've done it a bit up there.
I don't think it helps much in this script, but it takes no effort, so I may as well. Comments can help break
up a script into blocks as well.
Even with all these things, it can still be confusing. I'm not sure what more I can say, other than "you'll get
better at reading them with practice." What is this else?
else is an addition to the if-statement. The
format becomes something like:
if ( condition ) { do_this; and_this; } else { do_this_instead;
and_also_this; } Basically, if the "if" part of it doesn't "go off", it does the "else" instead.
Let's analyze
our whole inside if-statement. It checks... is the temporary variable oRing equal to OBJECT_INVALID?
(That is, did the PC not have the ring?) If so, attack.
On the other hand, if that wasn't true, then the PC
did have the ring. So, we do the "else" part, and be friendly.
For many people tracing through the logic
of things like this is the hardest part of scripting. If you are a visual person, making a flowchart helps a lot.
I would put one here, but I'm not going to try to draw one using ASCII. What are the new actions you put
in here?
I think the names are rather descriptive. ActionAttack attacks the thing you pass to it as an
input. ActionPlayAnimation has the NPC perform an animation in this case, the one called
ANIMATION_FIREFORGET_GREETING. Basically, it is just a way to tell the NPC to wave.
One More Modification
This lesson is getting huge, but there is one more thing that I want to throw
in. (Ok, I lied... there are 5,217 more things that I want to throw in, but I'm trying to make this
digestible.)
What if we want the opposite behavior from our guard? We want to attack if the PC has the
ring, and be friendly if not? For example, maybe the ring was stolen?
What we could do is move a bunch
of blocks of text around... and if we did it right, it would work. But we can actually achieve this result by
changing 1 character in our script. Where it says:
if (oRing == OBJECT_INVALID)
...change it to:
if
(oRing != OBJECT_INVALID)
'!=' is another kind of comparison. It checks to see if the two sides are not
equal to each other. So now, if the PC does have the ring, the guard will attack.

Chapter 12: Plugins


A plugin is a file that is loaded by the Neverwinter Nights 2 toolset in order to add now functionality to the
toolset. The plugin does not add any capabilities to the client or to the resulting modules. It is used to
assist the module creator in speeding up the development process. The plugin file is a dll that is normally
written in Visual Studio and can be written in any managed language. For this document we will assume
the plugin is being written in C#.

12.1 How to install a plugin


A plugin must be installed before it can be used. If the plugin does not come with an installation program
that you must copy the plugin file (this will normally end with the .dll file extension) to the directory
Neverwinter Nights 2 Toolset\NWN2Toolset\Plugins. There should already a be a few plugins installed
there (see picture below):

You may have other plugins in this directory. Once the new plugin is copied you must change the settings
in the toolset to allow the plugin to be loaded. Run the toolset and change the options by selecting View
- Options. The following dialog will appear:

Change the AllowPlugins dropdown until it reads Load all plugins and click OK. This only needs to be
done the first time that a plugin is installed. You will need to exit the toolset and rerun it for the changes
to take effect. When you click on the Plugin in the menu bar you should see your extra plugin:

If you no longer want to use a plugin you can delete the plugin file from the Plugins directory.

12.2 Why Author a Plugin


Once the plugin is loaded by the toolset it has access to the public classes and interfaces of the toolset
itself. The ability to reuse the same classes and data that the toolset uses is very powerful. In addition to
the classes the UI elements of the toolset are also available. There are very few limits to the types of
features that can be added to the toolset with plugins. A plugin could be used to add a new wizard for area
or module creation, global search and replace options, and even adding a scripting language like LUA are
possible.
Keep in mind that the plugin will have no effect on client or server itself. It can only assist in the creation
of modules or campaigns. If you wish to add database support for persistent worlds then nwscript in the
client would be required. You could use a plugin though to add database support for placeables, creatures,
etc. to the toolset.

12.3 Creating your first plugin


The Neverwinter Nights 2 toolset was written using managed code in Visual Studio. When the toolset is
run it looks in the Plugin directory for any .dll files and loads them (as long as the Allow Plugins option is
set to Allow all plugins). Once the .dll is loaded by the toolset it calls specific methods in the .dll. This
howto will assume that you are experienced with the Visual Studio development environment as well as
the C# language. The first step in creating a plugin is to start a new project in Visual Studio to create a C#
class library. You can download Visual Studio Express for free from Microsoft at:
http://msdn.microsoft.com/vstudio/express

Once the project has been created open up the project .cs file and look for the pregenerated code.
namespace TestPlugin
{
public class TestPlugin : INWN2Plugin
{
// Methods
public TestPlugin()
{
}
First you need to add the following to the beginning of the file:
using System;
using System.Collections.Generic;
using System.Text;
/*
* NWN2Toolset.dll exposes all the functions we need to manupulate the toolkit.
*/
using NWN2Toolset.Plugins;
/*
* Sandbar is the library thats used for the toolbar.
*
* Windows also has a Toolbar object in System.Windows.Forms so make sure
* you create the correct object when adding a toolbar to the toolkit.
*/
using TD.SandBar;
You may need to browse into the NWN2 directory to locate the NWN2Toolset.dll file. You will need to add
a few new methods into the class that will be called by the toolset during initialization:
private MenuButtonItem m_cMenuItem;

private void HandlePluginLaunch(object sender, EventArgs e)


{
// This code is executed when the menu is selected
System.Windows.Forms.MessageBox.Show("Hello World!");
}
public void Load(INWN2PluginHost cHost)
{
}
public void Shutdown(INWN2PluginHost cHost)
{
}
public void Startup(INWN2PluginHost cHost)
{
m_cMenuItem = cHost.GetMenuForPlugin(this);
m_cMenuItem.Activate += new EventHandler(this.HandlePluginLaunch);
}
public void Unload(INWN2PluginHost cHost)
{
}
public MenuButtonItem PluginMenuItem
{
get
{
return m_cMenuItem;
}
}
The Load and Unload methods are called when the toolset is initially started and exited. The Startup and
Shutdown methods will be called when the Plugins menu item for your plugin is selected.
You will also need to add a few properties to your close to identify the plugin to the toolset:
// Properties
public string DisplayName
{
get
{
return "Demo Plugin";
}
}
public string MenuName
{
get
{
return "Demo Plugin";
}
}
public string Name
{
get
{
return "DemoPlugin";
}
}
public object Preferences
{
get
{

return null;
}
set
{
}
}
Once you add these lines to your class, you need to add references to the NWN2 assemblies to your
project. This only needs to be done once. To do this use the Project -> Add Reference menu item and
select the Browse tab. Then navigate to your folder where NWN2 is located and enter NWN2Toolset.dll.
Repeat this process for the SandBar.dll and OEIShared.dll files in the NWN2 folder. You should also use
the .NET tab to add the System.Windows.Forms assembly. Once this is completed you can compile your
new DLL and place it into the Plugins directory. You will now have a new menu item Demo Plugin (from
the DisplayName property) in the Plugins menu after you restart the toolset. When the user selects the
menu item the message Hello World! will be displayed. Congratulations! Youve just created your first
plugin!

ADDING A TOOLBAR FOR YOU PLUGIN


If you would like to add a toolbar to the toolset UI you will need to add a variable to hold the toolbar to
your class:
// Fields
private PluginTests myTests;
You can then update the Startup method to call the code to create a menu
public void Startup(INWN2PluginHost cHost)
{
m_cMenuItem = cHost.GetMenuForPlugin(this);
m_cMenuItem.Activate += new EventHandler(this.HandlePluginLaunch);
// Add the following line of code to the end of the function
myTests = new PluginTests();
}
private void HandlePluginLaunch(object sender, EventArgs e)
{
/*Add the toolbars*/
List<PluginTests.ToolBarDef> toolBars = myTests.GetAllToolBars();
for (int j = 0; j < toolBars.Count; ++j)
{
for (int i = 0; i < NWN2Toolset.NWN2ToolsetMainForm.App.Controls.Count;
++i)
{
if (NWN2Toolset.NWN2ToolsetMainForm.App.Controls[i].GetType() ==
typeof(ToolBarContainer))
{
ToolBarContainer tbc =
(ToolBarContainer)NWN2Toolset.NWN2ToolsetMainForm.App.Controls[i];
if (tbc.Name == toolBars[j].NWNToolsetDockName)
{
tbc.Controls.Add(toolBars[j].toolBar);
break;
}
}
}
}
}
/*
* This dictionary will hold all of our toolbars.
* This way multiple toolbars can be created.
*/
private Dictionary<string,ToolBarDef> AllToolbars;

private enum ToolBarInitialPos


{
Top,
Bottom,
Left,
Right
};
public struct ToolBarDef
{
public ToolBar toolBar;
public string NWNToolsetDockName;
};
public PluginTests()
{
AllToolbars = new Dictionary<string, ToolBarDef>();
CreateToolBar("Demo Plugin Toolbar", ToolBarInitialPos.Top);
ButtonItem TestButt = new ButtonItem();
TestButt.ToolTipText = "Create a forest";
TestButt.Text = "Create Forest";
TestButt.Activate += new EventHandler(CreateForestButtClicked);
AddButtonToToolbar("Demo Plugin Toolbar", TestButt);
}
private string GetDockNameFromPosEnum(ToolBarInitialPos pos)
{
switch (pos)
{
case ToolBarInitialPos.Top:
default:
return "topSandBarDock";
case ToolBarInitialPos.Bottom:
return "bottomSandBarDock";
case ToolBarInitialPos.Left:
return "leftSandBarDock";
case ToolBarInitialPos.Right:
return "rightSandBarDock";
}
}
private bool AddButtonToToolbar(string toolbarName, ButtonItem buttonToAdd)
{
if (AllToolbars.ContainsKey(toolbarName))
{
AllToolbars[toolbarName].toolBar.Items.Add(buttonToAdd);
return true;
}
return false;
}
public void CreateForestButtClicked(object senter, EventArgs e)
{
}
private void CreateToolBar(string name, ToolBarInitialPos initialPos)
{
ToolBar temp = new ToolBar();
temp.Name = name;
temp.Overflow = ToolBarOverflow.Hide;
temp.AllowHorizontalDock = true;
temp.AllowRightToLeft = true;
temp.AllowVerticalDock = true;
temp.Closable = false;
temp.Movable = true;

temp.Tearable = true;
temp.DockLine = 2;
ToolBarDef tbd = new ToolBarDef();
tbd.NWNToolsetDockName = GetDockNameFromPosEnum(initialPos);
tbd.toolBar = temp;
AllToolbars.Add(name, tbd);
}
There is quite a bit of code in the previous section. The code in the Startup method is called when you
select the menu item. It calls HandlePluginLaunch that calls PluginTests. Finally, the
CreateForestButtClicked method will be called whenever the Create Forest button in pressed in the UI.

TOOLSET PUBLIC CLASSES


Your plugin will interact with the toolset via the public classes that are exposed by the NWN2Toolset.dll
file. There are many classes that are available; this section will describe the major classes that will
commonly be accessed by a plugin. How you will access these classes will be determined by the
programming language (C#, VB.net, LUA) that you are using.
There are many classes that are available in the NWN2 toolset, this guide will only describe a few of the
most important. It is recommended that you use a .NET examination tool (like Lutz Roeders .NET
Reflector) to examine all of the classes that are available in all of the toolset files. You can download the
.NET Reflector from http://www.aisto.com/roeder/dotnet .

Each of these classes will be described in more detail in the sections below.

NWN2Toolset Class
This class is used to set global preferences, compile and bake modules, and access information about the
currently open module or view. A few of the important members are:
NWN2ToolsetMainForm: This is class for the main form of the toolset application. This form
will contain all of the windows, toolbars, menus for the toolset.
o App: This is the current instance of NWN2ToolsetMainForm. This should be referenced to
access the members of NWN2ToolsetMainForm.
o Module: This returns the NWNGameModule instance for the currently loaded module.
This should be used to modify the contents of a module.
o AreaContents: Returns a NWN2AreaContentsView instance for the currently displayed
area. This can be used to modify terrain, texture, or tiles of an area.
o Controls: A collection of the controls owned by the main form such as toolbars.
o Bake: This method will make the currently open module.
NWN2ToolsetGeneralPreferences: One of many the classes
(NWN2ToolsetConversationPreferences, NWN2ToolsetGraphicsPreferences, etc) that handle the
View Options information.

NWN2Toolset.NWN2.Data Class
This class contains methods to manipulate the information for the currently opened module. It contains
classes to handle areas, scripts, and conversations.
NWN2GameModule: This is normally accessed via NWN2Toolset.App.Module. Holds all of the
information about the currently load module.
o Areas: A list of all of the areas in the module (stored as a Dictionary).
o Conversations: A dictionary list of all of the conversations in the module.

o Creatures: This (along with Doors, Trees, etc.) hold the Module (not Global) blueprints
for each of the types of instances.
o Scripts: A list of all of the scripts in the module.
o Name: The name of the module.
o FileName: The full pathname of the module (if it has been saved/opened).
NWN2GameArea: The currently display area can be found via
NWN2Toolset.NWN2ToolsetMainForm.App.AreaContents.Area or any area can be accessed by
enumerating NWN2Toolset.NWN2ToolsetMainForm.App.Module.Areas. This class holds
information for one area (either interior or exterior).
o Creatures, Placeables, Trees, Lights, Sounds, etc.: These classes hold a list of all of
the instances of these types in the area.
Add: This method will add a new instance to the area. This new instance can be
obtained by calling CreateFromBlueprint in one of the instances classes such as
NWN2Toolset.NWN2.Data.Instances.NWN2TreeInstance.
o GetBoundsofArea: Returns a BoundingBox3 type that holds the size of the area with the
Height and Length set. Each large tile in the area (including the non-usable outer tiles) are
80 units. So a 8x10 outdoor area would return Height=640 and Length=800.
o Name: The name of the area.
o HasTerrain, Interior, Underground: These indicate the type of area.
o Tiles:?????
NWN2GameAreaTileData: ????

NWN2Toolset.NWN2.Instances
This class holds information the the individual instances of items that are placed into an area. Each of the
types of instances has its own class. The classes are: NWN2CreatureInstance, NWN2DoorInstance,
NWN2EncounterInstance, NWN2EnvironmentInstance, NWN2ItemInstance, NWN2LightInstance,
NWN2PlaceableInstance, NWN2TreeInstance, NWN2SoundInstance, NWN2StaticCameraInstance,
NWN2StoreInstance, NWN2TriggerInstance, and NWN2WaypointInstance. Each of these instances allow
direct access to the information for that instances (such as Tint for creatures, or Seed for trees). The
following methods are common to the Instance classes.
CreateFromBluePrint: When this method is passed a blueprint as the parameter a new
instance will be created using the blueprints information.
GetDifferencesFromBluePrint: Returns an array with the list of differences between the
instance and the passed in blueprint.
Area: The area (via NWN2GameArea) this instance is in.
ObjectID: The GUID (globally unique identifier) for this instance. This can be useful for
searching for a specific instance.
Position: The location of the instance in the area (as a DirectX Vector3 type). This uses the same
units as the GetBoundsofArea where 80 units represents on large tile in the outdoor area.

NWN2Toolset.NWN2.Data.TypedCollections
NWN2BlueprintCollection
NWN2ConditionalFunctorCollection
NWN2GameAreaDictionary
NWN2GameAreaTileDataCollection
NWN2GameConversationDictionary

NWN2GameScriptDictionary
NWN2InstanceCollection

NWN2Toolset.NWN2.NetDisplay
This class handles the display of information to the windows in the toolset. This includes methods to
modify information in those windows. This class can be used to modify terrain and texture information in
outdoor areas.
NWN2NetDisplayManager.Instance: The current instance of the toolsets
NWN2NetDisplayManager class. You should reference the display members through this.
o BeginSynchronizedOperation: This should be called before a group of changes are
made to one of the displayes
o EndSynchronizedOperation: This is the corresponding call that should be called after
a group of changes have been made to a display window.
o TerrainModify: This method can be used to modify the height of terrain in an outside
area.

NWN2Toolset.NWN2.Blueprints
The blueprint collections are very similar to the Instance collection with the same list of classes with the
Blueprint suffix replacing the Instance suffix. The module blueprints are located in the Module To get a list
of Module blueprints for trees you can reference NWN2Toolset.NWN2ToolsetMainForm.App.Module.Trees.
The common method of these classes is:
BlueprintLocation: Returns a NWN2BlueprintLocationType that indicates if the blueprint is
global, module, or campaign.

Changing Item Data From a Plugin


The following code demonstrates how you can access information that is in currently displayed area and
make changes to items. In this example, we will be changing the random seed value of all of the trees that
are in the currently displayed area.
// This will retrieve random numbers for us
Random ran = new Random();
// This loops through each of the trees in the currently active area being displayed
foreach (NWN2Toolset.NWN2.Data.Instances.NWN2TreeInstance ti in
NWN2Toolset.NWN2ToolsetMainForm.App.AreaContents.Area.Trees)
{
// ti is the current tree instance being editing and Seed is it's seed value
// This will set it do a random number from 1 to 5000
ti.Seed = (uint)ran.Next(5000);
}
// This is required to redisplay the contents of the active area window
NWN2Toolset.NWN2ToolsetMainForm.App.AreaContents.Refresh();
// Display a simple message with the number of trees in the area
System.Windows.Forms.MessageBox.Show(NWN2Toolset.NWN2ToolsetMainForm.App.AreaContents.Ar
ea.Trees.Count.ToString() + " Trees Updated.");
As you can see from this example, getting access to information in the currently active area (in this case
an outdoor area) is quite easy. Keep in mind that this code does not have any of the normal error checking
(is any area being displayed, is a module loaded, etc.).

12.4 Visual Effects Editor


Credit is given to BenWH (DLA ) for inspiraton and to SorceressAshura as I used their Snow Effect visual
data for this tutorial (the VFX can be found here ).
The Visual effect editor is a plugin so to open it, click on Plugins in the top menu and then Visual Effects
Editor:

You now have a blank canvas and BenWH mentions that it is easier to work with an existing effect than to
start from scratch, which I wholeheartly agree with. To see existing effects you will need to extract the
files from NWN2_VFX.zip in the C:\Program Files\Atari\Neverwinter Nights 2\Data directory (this is if you
accepted the default install). The effects are also based on textures which can be found in the same
directory called NWN2 Materials zip
For this example I am going to start from scratch (only because I am cheating a little by using
SorceressAshura snow effect).
Click on File - New - Particle System:

You will now see a fire effect in the editor that looks similar to this:

To the right hand side you will see the properties of this effect:

Lets start to explain what some of these fields mean and also what changes we need to make for our snow
effect:
FlowType: Fairly straight forward as we have two choices: First is Continuous, which snow generally is or
Explosion. Leave it as Continuous for our example.
Texture: What texture are we going to us for our effect? If you open the NWN2 Materials.zip there are
loads in there. For our example we are going to use fx_hail.dss.
TextureType: With have 4 choices here (2D, 3D, Cubic and Null Texture). Lets choose 3D for our snow
effect.
TextureAnimationSpeed: This controls the amount of frames per second that are displayed
BeginSize: This is the size of your particles at the beginning of the animation.
EndSize: This is the size of the particles at the end of the animation. For this example change the end size
to 0.1, 0.3.
ParticleLifeTime: Is how long the life time of the particle is. Mess around with this figure, but for our

example change it to 5 and you will see that the particle has increased in height.
SpawnRate: For our example set this to 150. For testing set this to 1 and see the effect and then 10 and
you will get the idea what SpawnRate is.
Acceleration: These are set up 0,0,0 ie. the first number refers to x-axis, next is the z-axis and the last is
the acceleration itself. A positive number will make the particle go up and a negative will make it go down,
which snow falls down so set these values to 2, 7, -10.
Velocity: works in the same way as Acceleration. For our example set this to 0, 0, 2.
EmissionRadius and EmissionRadiusVariance: Set your EmmisionRadius, in this case how far from
the central point your particles are spawned (use the variance property to vary it). For our example set
both to 50.
ConeHalfAngle: For our example this is set to 20, if you want your effect wider at one end, give
ConeHalfAngle a number up to 180 (I think, might be 90)
StartAngleVariance: This determines if your particles fire at right angles to the ground (0), or at varying
angles (as you set it). You cannot actually see the effects of these settings without Velocity, which you
have to set first.
ControlType: This sets up the general 'look': pick cartesian if you want the effects to sort of fly away
from the point of production, select polar if you want an effect that is centered on an invisible point (like
a tornado), select spherical if you want a sphere. Use Cartesia for our snow example.
StartTheta to -1. This stops each particle being created in the same place
Disk: TRUE seems to determine if the particles are spawned in a flat plane or not.
Start and End Colour: Should be self explanatory and in our example they are both going to be white.
Leave yellow snow alone.
The effects property should look something like this:

Now save the effect in your campaign directory and do not forget to make a backup.
We cannot use our effect yet until we create a SEF file (Special Effects) and to do this click on File - New
- Special Effect (SEF):

Now click on Add Event and then on Particle System:

Under name you will see an empty line so click on that and then you will get a properties tab underneath
it:

For our snow effect there are two fields that we are interested in. The first is the DefinitionFile so click in
this field and then find the effect that you saved above. The second is the Position field change this to 0,
0, 50 and then press the Play button to see your new effect in action.
Now save your SEF file in the campaign folder and of course back it up.

Last thing we need to do is to add the effect to our toolset.


Close the effects editor (File - Exit). Click on Blueprints and then Placed Effects. Select any placed effect
blueprint in the main toolset and then right click and then left click copy blueprint - Module. Now select the
copied Blueprint and then look at the properties:

As you can see I chose to copy the Window Beam 4 effect. Now click on the Special effect field and then
change this from fx_windowbeam4 to the saved name you used earlier. Whilst we are here also change
localised name, tag and resref.
Place the snow effect in your area and it should now be snowing.

CONCLUSION
The Neverwinter Nights 2 toolset has extremely powerful capabilities for building and creating beautiful
worlds and environments. It can be extended by writing and using plugins to the toolset. The plugins can
access much of the internal information about the modules and toolset UI. It may take considerable
programming experience and time to create your own plugin, but the improvements to the toolset can
save time for all module developers.

12.4 World Map


May I thank Montgomery Markland from
inspiration of the tutorial.

Rogue Dao Studios

for his tutorial which was the main

Before we start this tutorial, you will need 2 things (1) A World Map (2) Hot spot icons.
The World map needs to be 647 x 647 in size and a tga file format to work correctly. The hot spot icons
are located in your Atari/Neverwinter Nights 2/Campaigns/Official Campaign folder. You can of course use
your own which have to be in the tga format and 32 x 32 pixels in size.
First thing we need to do is to create a new campaign (this will be saved as a new folder in your My
Documents/Neverwinter Nights 2/Campaigns folder). You will need to put your world map image and you
hot spot icons in the same folder.
Now open your module and then click on Plugins and then World Map Editor:

And the following box will pop up:

Now click on the File - New and you will notice that the middle section will go black and you now have the
following in the properties section:

Click in the WorldMapImage and then click on the button that appears and then select your map. Your
Editor will look similar to:

You will notice that I have added the WorldMapName "Moonshae", which is the parameter that will be
passed to the function ShowWorldMap(). Now click on the Add button at the top:

and then select the "hotspot" on your map:

On the right hand side you will see the properties of this "hot spot":

ActionScript: This script is started when you have selected the hotspot and you press travel.
ConditionalScript: This script is checking if you can see the hotspot for tests we use only gc_true().
Image:Specifies the icon that will be displayed as the hotspot.
ImageMouseOver: Is the image that is displayed when the user hovers their mouse over that point.
ImageSelected: This is the image of the hotspot when the user selects it.
Description: This is optional like a comment.
DisplayName: This is the Name you see on the right side of your map.
Height: If you use the NWN2 Campaign tga you always have to enter 32.
Location: The Location is entered by the Click with the Mouse.
Name: This is the tag name of your Hotspot, you can see it on the left side of your World Map Editor.
Sound: Sound that is played when the hotspot is selected.
Width: Same as Height.
Our action script is going to be a custom script called ptp_hotspot_click (Full kudos goes to Montgomery
Markland from Rogue Dao Studios for the following script):

// ptp_hotspot_click //RDS Worldmap System //Montgomery Markland -- Nov


1, 2006 //A simple worldmap system designed for use in situations when the
world map hotspots are all available (Beta Testing Purgatorio) //on first-look
//Adapted code from OEI kinc_worldmap
#include "ginc_transition" #include
"ginc_debug"
// ** world map locout functions **
// multiple PCs
simultaneously clicking travel on the world map causes problems. We use a
cooldown time to prevent this. void SetWorldMapLocked(); int
GetWorldMapLocked();
///////////////////////// // CONSTANT DECLARATIONS
/////////////////////////
// GENERAL //
// these are for locking the world map
so only one user can use it at a time const string WORLD_MAP_LOCKED =
"00_bWorldMapLocked"; const string WORLD_MAP_LOCKER =
"oWorldMapLocker"; const int STRING_REF_MAP_LOCKED = 183512; const
string WORLD_MAP_LOCKED_DAY = "00_nWorldMapLockDay"; const string
WORLD_MAP_LOCKED_HOUR = "00_nWorldMapLockHour"; const string
WORLD_MAP_LOCKED_MINUTE = "00_nWorldMapLockMinute"; const string
WORLD_MAP_LOCKED_SECOND = "00_nWorldMapLockSecond"; const int
WORLD_MAP_LOCK_COOLDOWN = 18; //seconds until we allow another click
const string WORLD_MAP_LOCK_INITIALIZED = "00_bWorldMapLockInit";
void
SetWorldMapLocked() { SetGlobalInt(WORLD_MAP_LOCKED_DAY,
GetCalendarDay()); SetGlobalInt(WORLD_MAP_LOCKED_HOUR,
GetTimeHour()); SetGlobalInt(WORLD_MAP_LOCKED_MINUTE,
GetTimeMinute()); SetGlobalInt(WORLD_MAP_LOCKED_SECOND,
GetTimeSecond());
SetGlobalInt(WORLD_MAP_LOCK_INITIALIZED, TRUE);
//so we know the timer is initialized
PrettyMessage("World map locked at time "
+ IntToString(GetTimeHour()) + ":" + IntToString(GetTimeMinute()) + ":" +
IntToString(GetTimeSecond())); }
int TimeToSeconds(int nHour, int nMinute,
int nSecond) { //for ease, we just convert the time into seconds -- 60 for 60
seconds in a minute, 3600 for number of seconds in an hour. return nSecond +
nMinute * 60 + nHour * 3600; }
int GetWorldMapLocked() {
if(GetIsSinglePlayer()) { return FALSE; }
if(!GetGlobalInt(WORLD_MAP_LOCK_INITIALIZED)) { return FALSE; }
int
nLockedHour = GetGlobalInt(WORLD_MAP_LOCKED_HOUR); int nLockedMinute
= GetGlobalInt(WORLD_MAP_LOCKED_MINUTE); int nLockedSecond =
GetGlobalInt(WORLD_MAP_LOCKED_SECOND);
int nCurrentHour =
GetTimeHour(); int nCurrentMinute = GetTimeMinute(); int nCurrentSecond =
GetTimeSecond();
int nTotalLockedSeconds =
TimeToSeconds(nLockedHour,nLockedMinute,nLockedSecond); int nTargetTime
= nTotalLockedSeconds + WORLD_MAP_LOCK_COOLDOWN; //10 sec cooldown
int nCurrentSeconds =
TimeToSeconds(nCurrentHour,nCurrentMinute,nCurrentSecond);
//
PrettyDebug("Target time for unlock = " + IntToString(nTargetTime)); //
PrettyDebug("Current time in seconds = " + IntToString(nCurrentSeconds));
//same day if(nTargetTime < nCurrentSeconds) { //
PrettyDebug(IntToString(nCurrentSeconds - nTotalLockedSeconds) + " seconds
passed since the last transition."); return FALSE; }
//we've rolled to the next
calendar day int nLockedDay = GetGlobalInt(WORLD_MAP_LOCKED_DAY); int
nCurrentDay = GetCalendarDay();
//!= is the check here because the day
change could roll the month //so going from month 1 day 28 to month 2 day 0
should still register as a day having passed. if(nCurrentDay != nLockedDay &&
nCurrentSeconds > WORLD_MAP_LOCK_COOLDOWN) { return FALSE; }
return TRUE; }
void main(string sHotspot)
{ //Get the player's compass
heading from the previous area string sCompass =
GetLocalString(OBJECT_SELF, "temp_wm_compass");
DeleteLocalString(OBJECT_SELF, "temp_wm_compass"); //Combine the
player's compass heading with the hotspot string (targets proper waypoint in
target area) string sDestination = sHotspot + sCompass; //Rather than
increasing code complexity, we simple assume the existence of all //Four
compass-heading waypoints in the target area. //This just means that the builder
should paint all four compass heading waypoints //(sHotspot+_n, sHotspot+_s,
sHotspot+_e, sHotspot_+w) in the target area for a particular hotspot //If there
aren't four compass headings into the area, paint multiple waypoints for a specific
compass heading //IE, if you only have 3 compass heading entrances, _n, _s, _e

- then paint "_w" in the same place as //_n or _s. This system gives the builder
flexibility to choose defaults and multiple defaults object oDestination =
GetObjectByTag(sDestination); object oPC = OBJECT_SELF;
//critPathEncounter, nonCritPathEncounter and randomEncounter code to be
added later if(!GetIsSinglePlayer()) { if(GetWorldMapLocked()) {
SendMessageToPC(oPC, GetStringByStrRef(STRING_REF_MAP_LOCKED));
return; } else { SetWorldMapLocked(); } } SinglePartyTransition(oPC,
oDestination); }

Next we need to paint a World Map Transition, which can be access via the Triggers Blueprint:

Move your cursor over to your area preview and draw a rectangle. Select the trigger and then look at
the properties of the trigger. Change the variable sMap to the name of your .wmp (not your image
name, but the name of the world map, ie what it is saved as) and leave sOrigin blank.
To do this click in the Variables field and then click on the three dots button and select sMap in the
list in the top left hand corner. For the ValueString change it to the name of your map like so:

Tag the trigger anything you want so long as the last two characters correspond to a compass
heading: _n, _s, _w, _e

// gtr_world_map_cl // ptp_world_map_cl (modified from OEI's


gtr_world_map_cl // Transition to the world map
// EPF
// EPF 2/2/06 -modifying to have a default map for each act if no other map is specified. // EPF
3/24/06 -- this is now an OnClicked event // BMA-OEI 6/24/06 -- Added gather
party check // BMA-OEI 8/11/06 -- Autosave before transition // ChazM 8/21/06
-- updated constant CAMPAIGN_SWITCH_REMOVE_DOMINATED_ON_TRANSITION
// BMA-OEI 8/22/06 -- Replaced auto save w/ AttemptSinglePlayerAutoSave() //
*MLM-RDS 10/31/06 -- Modified for use in Planscape Trilogy: Purgatorio
#include
"ginc_debug" #include "ginc_autosave" #include "ginc_transition"
void main()
{ object oPC = GetClickingObject(); if ( GetIsPC( oPC ) == FALSE ) { return;
}
string sMap = GetLocalString(OBJECT_SELF, "sMap"); string sOrigin =
GetLocalString(OBJECT_SELF, "sOrigin");
/*if(sMap == "") { int nAct =
GetGlobalInt("00_nAct");
switch(nAct) { case 1: sMap = "hiveward";
break; case 2: sMap = "hiveward"; break; case 3: sMap = "hiveward";
break; default: sMap = "hiveward"; break; } }*/
// BMA-OEI 7/04/06 Check if using remove dominated campaign flag if (
GetGlobalInt(CAMPAIGN_SWITCH_REMOVE_DOMINATED_ON_TRANSITION) ==
TRUE ) { int nRemoved = 0; object oFM = GetFirstFactionMember( oPC, FALSE
); while ( GetIsObjectValid(oFM) == TRUE ) { nRemoved = nRemoved +
RemoveEffectsByType( oFM, EFFECT_TYPE_DOMINATED ); oFM =
GetNextFactionMember( oPC, FALSE ); }
if ( nRemoved > 0 ) { // Abort
transition if dominated effect was found and removed return; } }
// BMA-OEI
6/24/06 if ( GetGlobalInt( VAR_GLOBAL_GATHER_PARTY ) == 1 ) { if (
IsPartyGathered( oPC ) == FALSE ) { ReportPartyGather( oPC ); return; } }
//Establish our party's compass heading so they end up in the correct //Or
correct-default entrance to the next area by grabbing the compass heading //of the
clicked world map trigger and setting it as a local string on the clicker //To utilize
this... //Append the tags of your world map triggers based on their compass
heading (*_n, *_s, *_e, *_w) //Unlike the target waypoints, you don't need all four
compass headings matched to a trigger string sCompass =
GetTag(OBJECT_SELF); SetLocalString(oPC, "temp_wm_compass",
GetStringRight(sCompass, 2)); // BMA-OEI 8/22/06 -- Autosave before transition
AttemptSinglePlayerAutoSave(); ShowWorldMap( sMap, oPC, sOrigin ); }

Paint four generic waypoints in each area targeted by a hotspot: XXXX_n, XXXX_s, XXXX_w,
XXXX_e Position these waypoints at the entrances and exits of your area, use -all four-. The
XXXX corresponds to the variable string you input in the field for the hotspot action click script for the
hotspot pointing to the area. Open the campaign editor and add the module with the world map
triggers to the new campaign where you saved your world map.

Chapter 13: Custom Content


13.1 How to add a texture
If you want to add a texture lets say for this example snow here is what you need to do:
Create a 75x75 .bmp and a .tga of your new texture (any decent art package should be able to do this).
Edit terrainmaterials.2da within the toolset to add your new texture name, leave the type as dirt/stone or
mud etc (this controls sound and video effects when walking on the surface, but dirt will do for now).
Remember to click save (just above the 2DA)
Put your bitmap in the following directory: C:\Program Files\Atari\Neverwinter Nights 2
Presale-Toolset\NWN2Toolset\Terrain
Put the TGA in the following directory: C:\Program Files\Atari\Neverwinter Nights 2
Presale-Toolset\Override
You will need to make a hak file of anything in the override directory at some point, but for testing this
does fine.
Lastly restart the toolset, and you should have your new texture to paint with.

13.2 Make your area transitions to use your own world


map
Credit to toolset staff Hellcow for writing this tutorial:
Having your area transitions show your own world map is a nice way to add a little flavour to your module
or PW. Here is an fairly easy way to do it by making a simple override.
First of all you are going to need an image program which can convert picture files into tga and which can
work in layers, which is the standard type used by Neverwinter Nights. In this case Im using Adobe
Photoshop.
In NWN2_FX, which should be a zip file you can find in your C:\Neverwinter Nights 2\Data, you will find
the pictures used for most visual effects in the game. If you unzip the file and search through the folder
you will under FX_Generic find a tga file named fx_globe.tga This is the file we need to use.
Note: You do not have to go through the bother of locating this file as Ill provide you with an
easy-to-download picture file of it here.
The picture looks like this:

What we need to do is take your own world map and put it into the blue circle. For this example Ive
chosen to use an old map of Scotland:

I find that the easiest way to put the map in is cutting out the globe, then make a copy of the layer. Fill
out with black in the centre of your first layer. (Look at the example picture):

Your globe image should now look like this:

Now to add our map we will add a new layer between our two previous layers. Copy all of your map
(CTRL+A CTRL+C) then paste it (CTRL+V)) onto your globe image file while having the second layer
(See image full blackened cicle) selected.

It should now look like this:

Save your new globe file in tga format in both your NWN2 Override folders:
C:\Program Files\Atari\Neverwinter Nights 2\Override
C:\My Documents\Neverwinter Nights 2\Override
It is important you name it the original name which is fx_globe.tga
Load your module and it should now show like this in game:

Note: Mind that this override will show in all modules you load and not just your own module.

And to make it all easier for you here is a correct sized jpg file with a cleaned globe which you can
download (Right click, save picture as..) and use:

Copy the layer with the globe and select the centre then simply delete it so you still have the frame as
shown on the picture earlier.

13.3 How to add your own Voice Overs


By SCARLETTHORN
I've been doing some custom voice overs for my NWN2 module I have been creating for quite some
time. It is fun and it is very easy to do also! If you have the ability to do many different voices like I do,
then you would probably like to make all of your NPC's and monsters sound just the way YOU would
like them to, with your own voice!
First and foremost, you must have a program that will allow you to record your voice and save it as a
.wav file. I have Acid 4.0 and this works well for me, but I am sure there are many other voice
recording types of software out there. Secondly, you need a microphone (preferably a shielded one
to reduce speaker feedback), but any old one will do.
Set up a conversation in NWN2 between whoever is talking to each other. We will pretend that the
NPC Darkseed is talking to our PC named Vince. Once you have finalized the conversation between
the two and saved, here is where the fun begins.
Take the first line of speech that was said in your conversation editor (we will pretend Darkseed
speaks first and says, "You look pitiful to me mortal") and now use that in our recording software.
Record exactly the first line of speech "You look pitiful to me mortal" over the microphone and save
it to a .wav file called whatever you like, I will choose Darkseed1.wav. Next take the second line of
speech that you created in the conversation editor (we will pretend Vince says, "Yeah whatever")
and record this with your recording software and save as Vince1.wav. For each line in the
conversation editor that someone talks record their verbage and save it as a .wav file. But make sure
that when Darkseed talks a second or third or fourth line that you save the .wav file as
Darkseed2.wav and Darkseed3.wav etc. THIS IS IMPORTANT!
Now we need to add these .wav files that we just recorded for our conversation into the NWN2 area
so that NWN2 will be able to use our new voice files. Simply cut and paste all your saved .wav files
into c:\my documents\neverwinter nights 2\override. Now all your files will be accessible from within
the toolset.
Next we need to open the toolset and once opened we need to also open the conversation that we
want to apply our new sound files to. Once the conversation is opened go to the first line of speech
(this will be Darkseed speaking as we pretended) and click on it. Below the dialogue you will see four
tabs Conditions, Actions, Node, Animations. Open the node tab. Under the node tab you will see a
menu marked Behavior in bold letters. Go down just a bit further and you will see a block marked
Sound with an empty space next to it and a small arrow:

Click the arrow and it will pull up all the sound files that are currently available. This will also include
all of your recorded sounds that you put into your override directory. Pick the one that you named
Darkseed1.wav for the first line of the conversation. For each new line of conversation do the same:
Open Node, go under Behavior, Open the arrow next to sound and simply put in the file that you
recorded for that line of text and voila, you soon will have your very own voice recorded for that
particular conversation. Make sure you save your conversation again after doing this! Now run the
module and listen as your NPC's and PC speak with your very own voice you created!!!

Appendix A Classification Codes


Aberrations{184332}
Animal Companions{184303}
Animals - Dire{184305}|{184307}
- Domestic{184305}|{184317}
- Wild{184305}|{184306}
Companions{184301}
Constructs{184313}
Debug{184326}
Dragons{184312}
Elementals - Air{184321}|{184322}
- Earth{184321}|{184323}
- Fire{184321}|{184324}
- Water{184321}|{184325}
Familiars{184327}
Fey{184320}
Giants{184330}
Humanoid{184314}
Magical Beasts{184318}
Monstrous Humanoids{184328}
NPC{184335}
Outsiders{184308}Outsiders Demons{184308}|{184309}
Outsiders Devils{184308}|{184319}
Placeables CargoShip{184315}|{184316}
Shapechanger{184336}
Special{184304}
Undead{184329}
Vermin - Beetles{184310}|{184311}
Vermin - Spiders{184310}|{184334}

Вам также может понравиться