The Complete Builders Guide For The Neverwinter Nights 2 Toolset
Transcription
The Complete Builders Guide For The Neverwinter Nights 2 Toolset
The Complete Builders Guide For The Neverwinter Nights 2 Toolset BY NWNmaster Version 1.1 http://www.nwn2toolset.com 1 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 or questions then please visit us at http://www.nwn2toolset.com . http://www.nwn2toolset.com 2 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. 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 “Don’t 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. http://www.nwn2toolset.com 3 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.6 Day & Night Settings 3.7 Area Properties 3.8 Walkmesh 3.9 Interior Area 3.10 Baking 3.11 Exploring Your Module Chapter 4 Creatures 4.1 Create an NPC 4.2 Encounters 4.3 Create your own custom encounters 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 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 http://www.nwn2toolset.com 4 Chapter 7 Sounds Coming soon Chapter 8 Triggers & Waypoints 8.1 New Area Transition 8.2 Walkmesh Trigger 8.3 Waypoints Chapter 9 Merchants 9.1 Create a Store Chapter 10 Conversation 10.1 Conversation basics 10.2 Anatomy of a conversation 10.3 Conversation scripting basics 10.4 Writing a conversation Chapter 11 Scripts Coming Soon 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 Appendix A – Classification Codes http://www.nwn2toolset.com 5 Chapter 1: The Interface The whole toolset layout: http://www.nwn2toolset.com 6 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. http://www.nwn2toolset.com 7 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. http://www.nwn2toolset.com 8 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 won’t 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. http://www.nwn2toolset.com 9 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. It’s recommended to have this option off during normal use so you don’t accidentally select more then 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. http://www.nwn2toolset.com 10 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.” http://www.nwn2toolset.com 11 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: (Can’t 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 http://www.nwn2toolset.com 12 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. http://www.nwn2toolset.com 13 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) http://www.nwn2toolset.com 14 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. http://www.nwn2toolset.com 15 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. http://www.nwn2toolset.com 16 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. http://www.nwn2toolset.com 17 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: http://www.nwn2toolset.com 18 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. It’s 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. Don’t 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. http://www.nwn2toolset.com 19 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: http://www.nwn2toolset.com 20 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. http://www.nwn2toolset.com 21 Now that you’re 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 don’t 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. http://www.nwn2toolset.com 22 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. http://www.nwn2toolset.com 23 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: http://www.nwn2toolset.com 24 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: http://www.nwn2toolset.com 25 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. http://www.nwn2toolset.com 26 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: http://www.nwn2toolset.com 27 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: http://www.nwn2toolset.com 28 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: http://www.nwn2toolset.com 29 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: http://www.nwn2toolset.com 30 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). http://www.nwn2toolset.com 31 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. http://www.nwn2toolset.com 32 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. http://www.nwn2toolset.com 33 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: http://www.nwn2toolset.com 34 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). http://www.nwn2toolset.com 35 Third, I laid down the default water as shown below: http://www.nwn2toolset.com 36 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 http://www.nwn2toolset.com 37 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 placables) to match their own mossy colors. And/or beach sand textures can also be added as well as underwater 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. http://www.nwn2toolset.com 38 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 ). 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. http://www.nwn2toolset.com 39 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. 3.6 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 you’ll 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 it’s 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. http://www.nwn2toolset.com 40 editor. 1. Run. This allows you to see the full day/night cycle running in the 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.7 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 it’s best to look at one of the http://www.nwn2toolset.com 41 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 there’s a button (Show North) above the Area Viewer that places a North arrow in the center of the map. It’s a very good idea to save before doing a resize since there is no undo command. http://www.nwn2toolset.com 42 3.8 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. http://www.nwn2toolset.com 43 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. http://www.nwn2toolset.com 44 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.9 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 the 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. http://www.nwn2toolset.com 45 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: http://www.nwn2toolset.com 46 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: http://www.nwn2toolset.com 47 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. http://www.nwn2toolset.com 48 The above picture is a very simple layout, but you can see that my pillars have four corners in place. 3.10 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': http://www.nwn2toolset.com 49 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. http://www.nwn2toolset.com 50 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). http://www.nwn2toolset.com 51 3.11 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 you’d like to explore the area you’ve made, you’ll 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 you’re 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 you’re ready to walk around your level! http://www.nwn2toolset.com 52 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: http://www.nwn2toolset.com 53 Now right click in the Blueprint toolbar and then left click on Create Blueprint and then Module from the popout menu: http://www.nwn2toolset.com 54 You will now see a blueprint called creature1 and if you drag it into your area preview then it will look something like below: http://www.nwn2toolset.com 55 When your new creature is selected you should see the properties of the NPC: http://www.nwn2toolset.com 56 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. http://www.nwn2toolset.com 57 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. http://www.nwn2toolset.com 58 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. http://www.nwn2toolset.com 59 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. http://www.nwn2toolset.com 60 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. http://www.nwn2toolset.com 61 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. http://www.nwn2toolset.com 62 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. http://www.nwn2toolset.com 63 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: http://www.nwn2toolset.com 64 http://www.nwn2toolset.com 65 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. http://www.nwn2toolset.com 66 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: http://www.nwn2toolset.com 67 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: http://www.nwn2toolset.com 68 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. http://www.nwn2toolset.com 69 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. http://www.nwn2toolset.com 70 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. http://www.nwn2toolset.com 71 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. http://www.nwn2toolset.com 72 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. http://www.nwn2toolset.com 73 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: http://www.nwn2toolset.com 74 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): http://www.nwn2toolset.com 75 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 http://www.nwn2toolset.com 76 Object properties Whilst the church is select you can look at the properties of it in the properties pane: http://www.nwn2toolset.com 77 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, you’ll 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. http://www.nwn2toolset.com 78 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: http://www.nwn2toolset.com 79 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. http://www.nwn2toolset.com 80 There will be an “Edit” button in the corner of this window, click it to access the creature’s 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. http://www.nwn2toolset.com 81 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 http://www.nwn2toolset.com 82 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). http://www.nwn2toolset.com 83 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. http://www.nwn2toolset.com 84 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. http://www.nwn2toolset.com 85 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). http://www.nwn2toolset.com 86 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 http://www.nwn2toolset.com 87 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). http://www.nwn2toolset.com 88 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: http://www.nwn2toolset.com 89 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). http://www.nwn2toolset.com 90 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: http://www.nwn2toolset.com 91 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. http://www.nwn2toolset.com 92 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 troll’s lair to the gold coins you sell it to the merchant for. http://www.nwn2toolset.com 93 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 character’s 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 one’s 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.] http://www.nwn2toolset.com 94 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 itemcreation purposes. http://www.nwn2toolset.com 95 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 player’s 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 wouldn’t 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). http://www.nwn2toolset.com 96 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 character’s 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 item’s material properties. a. Damage Reductions – sets the item’s 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 aren’t made with alchemical silver. Now that the terms have all been defined, you have the foundation you need to create items. http://www.nwn2toolset.com 97 6.3 Creating an unequippable item The first item to be created for the example is a non-equippable item – Pitney Lannon’s 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 item’s 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 http://www.nwn2toolset.com 98 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 one’s 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 character’s inventory. http://www.nwn2toolset.com 99 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 (Lannon’s 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 http://www.nwn2toolset.com 100 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 http://www.nwn2toolset.com 101 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). It’s 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 http://www.nwn2toolset.com 102 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, it’s 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. http://www.nwn2toolset.com 103 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. Pitney’s 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 http://www.nwn2toolset.com 104 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] http://www.nwn2toolset.com 105 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. http://www.nwn2toolset.com 106 For Pitney’s armor, since it’s a bit fancier than the armor of the other militiamen, he’s 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, http://www.nwn2toolset.com 107 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 Pitney’s 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. http://www.nwn2toolset.com 108 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 item’s magical properties to be usable even when the item is unequipped. http://www.nwn2toolset.com 109 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. http://www.nwn2toolset.com 110 You will now see "item1" added to your blueprints: http://www.nwn2toolset.com 111 Now left click on item1 so that it is selected and we need to amend the properties: http://www.nwn2toolset.com 112 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: http://www.nwn2toolset.com 113 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: http://www.nwn2toolset.com 114 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: http://www.nwn2toolset.com 115 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. http://www.nwn2toolset.com 116 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: http://www.nwn2toolset.com 117 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). http://www.nwn2toolset.com 118 Now you should test to see if it works and if it does not then double check the tags and there spelling etc...: http://www.nwn2toolset.com 119 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. It’s 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. http://www.nwn2toolset.com 120 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. http://www.nwn2toolset.com 121 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. http://www.nwn2toolset.com 122 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: http://www.nwn2toolset.com 123 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_: http://www.nwn2toolset.com 124 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 int iNextWP = iCurrentWP+1; if (iCurrentWP>4) iNextWP = 1; SetNextWaypoint(iNextWP); } Add this to the NPC heartbeat script and it will walk to random waypoints. http://www.nwn2toolset.com 125 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. http://www.nwn2toolset.com 126 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 like to see what you have" and then right click on the white space below again and then 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, http://www.nwn2toolset.com 127 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 http://www.nwn2toolset.com 128 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 everyone’s 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: http://www.nwn2toolset.com 129 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 doesn’t 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 Pitney’s 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 player’s responses. A blue “[CONTINUE]” means that the player has no choice to make at http://www.nwn2toolset.com 130 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. http://www.nwn2toolset.com 131 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 you’d 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 scripter’s 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 we’ll 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 Pitney’s dialog nodes will be displayed, based upon the player’s 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. http://www.nwn2toolset.com 132 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 Let’s try writing a conversation for victim of the lizardfolk holed up in Pitney Lannon’s 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. http://www.nwn2toolset.com 133 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 rightclicking 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, you’d be adding a player response node. If you wanted the NPC to say two lines before the player responded, you’d have to make an empty player node between the red NPC nodes. Try adding a blank line to the introduction. http://www.nwn2toolset.com 134 End Dialog? If a Player node has NO responses attached to it, it is a conversationending node. Let’s 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, let’s 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 can’t 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). http://www.nwn2toolset.com 135 Since these lines don’t yet have any text following them, they are dialogueenders. If you’d like, you could continue to add NPC nodes, and subsequent player nodes, to your heart’s 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 store’s 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 store’s 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 can’t be displayed, the process ‘falls through’ to the next red NPC node down the line. As mentioned earlier in our discussion of conditions http://www.nwn2toolset.com 136 and actions, a node can be given a condition and if that condition is FALSE, the line will not be displayed. Observe Pitney Lannon’s 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 he’s 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 it’s five completely different dialogues, all custom-tailored to what events took place already when really, it’s 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, Pitney’s 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 player’s 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 dropdown menu. The “Show Once” field defaults to “Always,” which means that the node will always appear, unless Conditions dictate otherwise. http://www.nwn2toolset.com 137 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 object’s 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. http://www.nwn2toolset.com 138 Continuing with the previous conversation, let’s 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. There’s an easier way using links to streamline this conversation. First step is to remove everything after the “Who are you?” line – it’s 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.” http://www.nwn2toolset.com 139 Once in, you’ll 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 don’t 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 won’t forget your kindness!” The conversation’s author can keep tabs on what kind of response this is and leave a note to return later and add a bump to the player’s 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 speaker’s head without any halt in gameplay. http://www.nwn2toolset.com 140 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. http://www.nwn2toolset.com 141 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 coulde 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 http://www.nwn2toolset.com 142 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; http://www.nwn2toolset.com 143 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. http://www.nwn2toolset.com 144 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! You’ve 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; http://www.nwn2toolset.com 145 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() http://www.nwn2toolset.com 146 { 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; http://www.nwn2toolset.com 147 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 Roeder’s .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. http://www.nwn2toolset.com 148 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 it’s 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 http://www.nwn2toolset.com 149 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 toolset’s 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 http://www.nwn2toolset.com 150 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.Area.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: http://www.nwn2toolset.com 151 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: http://www.nwn2toolset.com 152 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. http://www.nwn2toolset.com 153 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. http://www.nwn2toolset.com 154 The effects property should look something like this: Now save the effect in your campaign directory and do not forget to make a backup. http://www.nwn2toolset.com 155 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: http://www.nwn2toolset.com 156 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. http://www.nwn2toolset.com 157 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 Rogue Dao Studios for his tutorial which was the main inspiration of the tutorial. 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: http://www.nwn2toolset.com 158 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: http://www.nwn2toolset.com 159 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": http://www.nwn2toolset.com 160 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"; http://www.nwn2toolset.com 161 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); http://www.nwn2toolset.com 162 // 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 http://www.nwn2toolset.com 163 to be added later if(!GetIsSinglePlayer()) { if(GetWorldMapLocked()) { SendMessageToPC(oPC, GetStringByStrRef(STRING_REF_MAP_LOCKED)); return; } else { SetWorldMapLocked(); } } SinglePartyTransition(oPC, oDestination); } http://www.nwn2toolset.com 164 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. http://www.nwn2toolset.com 165 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" http://www.nwn2toolset.com 166 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 ) http://www.nwn2toolset.com 167 { 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. http://www.nwn2toolset.com 168 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} http://www.nwn2toolset.com 169 http://www.nwn2toolset.com 170