The Neverwinter Nights 2 (NWN2) toolset is a powerful utility that will allow you to create your own NWN2 modules. This is the same tool that has been used by Obsidian game designers to create the official NWN2 campaign.
This brief guide will help you get started by demonstrating the basics of the toolset. You will learn fastest by experimenting with the toolset and by joining the NWN2 mod community, which can be reached through www.atari.com/nwn2.
We hope you enjoy all of the features of the NWN2 toolset. We appreciate your time and interest and look forward to playing your creations.
Sincerely,
The NWN2 Team
This covers creating a module and areas within that module, as well as the basic components of a module: Areas, Conversations, and Scripts. By the end of this section you will understand the anatomy of a module and know how to create a new area, install a starting point, and try it out in the game.
Areas,
Conversations, and Scripts
This teaches you the basics of placing creatures, placeables, and items into the areas of your module. In addition to basic placement, you’ll explore some basic settings to modify the actors and props of your world without complicated scripting. By the end of this section, you will know how to populate your area with allies, villains, scenery, and loot.
Placing
Items on Creatures and Placeables
This section covers the basics of creating a branching conversation tree that players can explore as they wish. You will learn a little about how condition and action scripts can be used to make your conversations more interesting and powerful. You will also learn how to attach the complete conversation to a creature in your module.
Some
Basic Conversation Tricks
Attaching
a Conversation to a Creature
This will teach you about triggers, and you will learn how to place them in the game. You will also gain a more detailed understanding of two specific types of triggers: speak triggers and area transitions.
This section discusses the basics of items and how to create them. By the end of this section, you’ll know about most of the many properties items can have, as well as how to create your own items. You’ll also have learned about how to create custom appearances for items that appear in game, such as weapons and armors.
Creating
An Equippable Item - Weapons
Creating
An Equippable Item - Armor
This document goes over the basics of exterior and interior map making and how to place the various objects.
What
are Exterior and Interior Maps?
General
Lighting and Additional Considerations
This section is a brief reference guide that explains the scripting naming conventions used in NWN2. It also describes some of the action and conditional scripts intended for use in conversations and some changes made to NWN1 scripts. This section is not a scripting tutorial.
Terrain User
Interface Questions
If you are experienced with the
World Creation
· Terrain Painting. You can sculpt the terrain and apply textures, water, and animated grass. Various brush sizes are available for initial sculpting/painting and refined work.
· Trees. You can quickly generate unique and animated trees.
· Weather Control. You can set sky color and cloud density and velocity.
· Dynamic Day/Night Cycle. You can set various weather and lighting conditions and the game will dynamically move between them as time progresses. For example, you can have a light fog roll in during the dawn and then burn away as the sun rises.
· Special Effects Editor. The toolset comes with the special effects editor that was used for the NWN2 spells.
· Armor Customization. With over 100 different greaves, vambraces, and more, you can custom tailor armors to create your own unique-looking magic items or uniforms. All armor pieces can be individually tinted with multiple colors.
· Object Scaling. You can scale most placeables and creatures easily, allowing you to make a tougher looking bugbear chieftain or a cat-sized giant spider hatchling.
· Enhanced Camera Controls. New camera features allow for more cinematic cut scenes.
· Global Scripts. The NWN2 toolset has a much more robust collection of global scripts that are ready for use in your own modules.
Usability
· Customizable Workspace. You have much more control over where various tools and windows are located and how much space they take up, allowing you to adjust the toolset’s layout as you wish.
· Improved Conversation Editor. You can pass parameters to scripts and assign multiple conditional and action scripts. A “main question node” feature makes it much easier to construct certain types of conversations.
· Level Baking. A semi-automated baking process creates the walkmesh for your level, which causes placeables you specify to automatically block movement without dealing directly with the walkmesh.
· Multi-tasking. You can have multiple areas, conversations, and scripts open simultaneously, allowing for faster content creation.
· Campaign System. Multiple modules can now share resources and journal data.
· Flexible Categories. NWN2 has no item palettes, allowing you to organize your blueprints and instances in whatever categories you’d like.
· Plugins. You can create plugins for the toolset, much like you can for Photoshop or 3DS Max.
To use the toolset, just open the file NWN2ToolsetLauncher.exe. After a few moments, you should see:
All windows within the NWN2 Toolset can be docked, resized, and moved to set things up however you prefer. The main components of the toolset are:
1. Menu Bar.
2. Toolbars.
3. 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.
4. Area Contents. Lists all of the components of the currently selected area, if any. Components include items, creatures, triggers, placeables, and more.
5. Area Viewer. Shows what the area looks like. You can modify terrain and textures, place objects, etc. through the Area Viewer.
6. 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.
7. 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.
8. 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.
9. Tabs to switch from Blueprints to the Terrain (exteriors) and Tile (interiors) tabs.
The HowTos provide additional detail about many of these features. Open the Sample Module to reverse engineer our content and learn more about the toolset’s functionality.
To try the Sample Module, start NWN2, click “New Game,” then “New Module,” and select 0100_UninvitedGuests. To open the Sample Module in the toolset, start the toolset, then File à Open, and select 0100_UninvitedGuests.mod.
Some simple tips:
· If you get stuck, please visit www.atari.com/nwn2 and post on the forums.
· In the Area Viewer, use Ctrl-middle-click to rotate the camera and the mousewheel to move the camera forward and backwards.
· For fast creation of objects (creatures, items, placeables – anything in the Blueprint Categories section) copy the blueprint of an existing object that’s similar to what you want. Then change the properties of the copied blueprint.
· You can use Copy (Ctrl-C) and Paste (Ctrl-V) in the Area Viewer to quickly duplicate placed objects.
· Check View à Options and the Plugins menu to change settings and to access helpful supplemental tools.
This HowTo covers creating a module and areas within that module, as well as the basic components of a module: Areas, Conversations, and Scripts. By the end of this HowTo you’ll be familiar with the anatomy of a module and know how to create a new area, install a starting point, and try it out in the game.
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.
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.
The three main components of a module are Areas, Conversations, and Scripts.
Areas are the playable levels of the module. A playable module needs at least one area, and multiple areas can be packaged into one module. Areas contain a walkable region populated with creatures, placeables (the NWN2 term for stationary objects), and a host of other gameplay objects. An area could be a tavern, a cave, a forest of goblins, a farm, or whatever your imagination would like. It’s important to note that an entire area loads all at once and moving between areas requires a load. If an area is too large, loading it may take forever and the area might run more slowly during play. Conversely, many small areas mean frequent trips to the loading screen. For your first areas, you should err on the side of making them small.
Areas can either be exterior or interior – it is not possible to have an area flagged as both, though you can have an exterior area (a town) that contains several doors in to interior areas (the shops and houses of the town).
Conversations are interactions that are created with the Dialogue Editor. They contain the text and special conditions of a speech, debate, staredown, or any other talking event in the adventure. Conversations are used whenever you’d like to give players a means for talking to someone. At its heart, a conversation is any sort of branching menu, so a conversation doesn’t necessarily have to be two people talking – if you want a player to encounter a panel with three switches, a conversation with three responses is an effective way to present the player with the situation.
Conversations are extremely powerful tools and are covered in later HowTos. For now, just remember that conversations are saved in a module, so any conversation can be used across all areas packaged into one module.
Scripts are text files containing lines of code (written in the game’s C-based programming language) that choreograph special actions and events above and beyond the game’s regular set of actions. A troll placed in a cave knows how to attack adventurers without you giving it any pointers or instructions. If you want the troll to always run away from dwarves, or if you’d like reinforcements to appear when it dies, scripts can let you make those things happen.
With scripting, nearly any sort of custom event, behavior, or cut scene can be crafted by a dedicated designer. However, scripting is a pretty advanced topic so for now just know that custom scripts are saved as part of a module, and can thus be used across all areas packaged into one module.
A module needs at least one area to be playable. To create your first area, use the Dropdown Menus and select File à New à Area.
Once you’ve selected to create a new area from the dropdown menu, the New Area Wizard window appears. Enter a name for your area as the area’s tag (in the above example, the new area will be the area outside of Pitney Lannon’s house so the name “Lannon House Exterior” is used). Tags are used by the toolset and game to identify many different types of things, from areas to creatures to items. Tags do not need to be unique.
Next, select type of area you wish to make (to continue the above example, this will be Pitney’s property, not the inside of his house, so we’ll choose exterior). Press “Next” when you’ve entered the area tag and selected the desired area type. These cannot be changed once the area is created.
Now the New Area Wizard asks for your desired area size. You can either select a pre-defined square sized from Tiny (about the size of a small home or garden) to Giant (a sprawling city or expansive forest) or you can create a rectangle of varying length and width by adjusting the sliders. Press the “Finish” button when you have the desired size. We’ll keep it simple for this example and stick with a small area.
Once you’ve selected the area size, you’ve made a new area! You will see a blank area in your toolset!
With an area in play, all you need is a start location and your module will be playable (albeit slightly lacking in epic content). The start location lets the game know where to place the player characters when they enter the module. Multiple areas can be included in a module, the Start Location can be in any one of those areas (not necessarily the first one you made). There can only be one Start Location per module, so if one is already present in any area, placing a new Start Location erases the old one.
To place a start location, click on the “Set Start Location” text on the action bar running across the top of the screen. It’s next to a red circle with an arrow in it, so it should stand out from the other buttons. Once you’ve clicked it, you can now click anywhere in the terrain to place the Start Location. When placed, it appears as a red compass.
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!
Hey… that blank exterior sure looks familiar…
As you build your module, you can give your adventure a practice test by placing the start location near an area of interest, saving your game, playing the module in the game, and seeing what happens!
One thing to keep in mind if you are going to test out your level in the game: save games include module information. So if you save your game while playing your module, changing the module won’t have an effect on your save game. To get a sense of the latest changes to your module, you should fire it up as a new module instead of loading a save game.
That concludes the basic info on getting your module started. You’re well on your way to creating your own single-session adventures or epic sagas. Now that you’ve completed this HowTo, you should know:
1. How to create a new module (it’s as simple as opening the toolset).
2. The general purposes of areas, conversations, and scripts.
3. How to create a new area.
4. How to place a Start Location.
5. How to save your module and test it out in the game.
This HowTo will teach you the basics of placing creatures, placeables, and items into the areas of your module. In addition to basic placement, you’ll explore some basic settings to modify the actors and props of your world without complicated scripting. By the end of the HowTo, you will know how to populate your area with allies, villains, scenery, and loot.
An object is something that can be placed in your module. The most common objects you’ll probably use are creatures, placeables, and items, which are the meat and potatoes of fantasy adventure. These are the actors and props that will populate your areas with challenge and flavor. Scripts and conversations interact with these elements to make epic quests and branching puzzles… but all that will come later – you can still make a simple adventure from just these easy-to-place and easy-to-tweak game objects.
Creatures are monsters, villagers, beasts, ghosts, rival adventurers, and any manner of non-player characters (NPCs) in the game (and they can even be made into companions that the player could control, though for now, it’s best to just view them as always computer-controlled). Creatures can engage in combat and conversations, move around the game world, use doors and other objects, cast spells and invoke special abilities, and perform complex behaviors through the use of scripting.
Placeables are the name for props and environmental objects in Neverwinter Nights 2. Like creatures, placeables can have scripts, inventories, and conversations, though they lack any sort of behavior.
Items are the weapons, armor, potions, keys, quest objects, and other portable props of the game. Items are rarely placed directly into the game world the same way as creatures and placeables. Instead, items are usually attached to creatures and placeables.
Creatures, Placeables, and Items are created as blueprints – a sort of template or mold from which identical copies can be sewn (all objects have blueprints). Once a creature, placeable, or item is placed into a level from a blueprint, that unique actor or prop becomes an instance.
Advanced Topic: Instances
Changes to one instance have no effect on the blueprint or another instance that came from the same blueprint. Furthermore, an instance is not affected by changes to its parent blueprint after it is placed.
If you place down five goblins from the same blueprint and make one a wizard, the other four do not automatically change to wizards as well. If you place down five goblins of the same blueprint and then add armor to the blueprint, the five instances of goblins placed would not automatically gain armor (though any placed down after the blueprint changed would be armored).
The creatures, placeables, and items discussed in this HowTo are already in the Toolset. Another HowTo discusses how to create your own items and a similar procedure applies to creating new creature or placeable blueprints.
While the name “creature” may evoke images monsters and vermin, this generic term applies to all mobile actors in the game, even kind old ladies and children who need to be rescued from wolves. Creatures fill a wide variety of roles: monsters, conversation encounters, merchants, and background traffic are the most common.
Creatures can be placed into the level with the toolset. To do this, locate the “Blueprints” window in your Toolset. In the default setup, you’ll see this window in the lower-right corner. Press the “Creatures” button (the dragon symbol) to view all creature blueprints. You’ll see several entries with a “+” sign next to the name, click the “+” to expand the list.
Look for Humanoid à Lizardfolk à Lizardfolk Warrior
Click on the Lizardfolk Warrior entry and you will now be able to place Lizardfolk Warriors. Move your cursor into the Area Viewer and click on the map wherever you’d like to place an instance of the Lizardfolk Warrior.
Advanced Topic: Spawning and Encounters
Creatures can also be spawned in. In this case, you don’t actually “paint” the creature into the level in the Toolset. Instead, scripts are used to create, in real-time, X number of instances of Y blueprint. In this way, you could create a scenario where enemies flood in through a trapdoor but only when a certain condition has been met (an alarm raised, for instance). The enemies aren’t actually in the level until the script calls them in, so a crafty player can’t detect them or interact with them until certain conditions have been met. A more automated method of spawning in creatures is through encounters.
Spawning in creatures is an advanced technique that won’t be covered in this HowTo, but it’s important to know that placing creatures directly into the level is not the only method for populating your module. When you are more comfortable with the toolset, you should experiment with encounter blueprints.
Once placed in the level, you can freely change a creature’s properties. Press the “Select Objects” button on the Toolbar at the top of the toolset to make sure your cursor is in selection mode. Click on the creature in the Area Viewer to select it and look at the Property Panel (located in the upper-right corner of the screen by default).
You can alter a creature’s appearance in many ways. The “Properties” tab has entries for overall appearance type, hair, head, body bag, options to make helmets or armor invisible on a creature, and many other such features. Let’s try experimenting with a creature’s scale and color.
Find the entry for “Scale” and 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 creature’s scale. This scale of this creature 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 as your Lizardfolk Warrior increases 50% in every dimension.
To change the color, scroll down to the properties below scale and look for “Tint (Skin).” Click on the adjacent field (which should show a white box and the numbers “255, 255, 255”). Clicking will bring up a color selection tool. Try picking some colors and note that creature’s appearance in your editing window. When you’ve found a color you like, click “OK” to set that color for the Lizardfolk Warrior.
Faction is an important property for creatures as it determines who a creature likes and dislikes. A creature is friendly with creatures of its own faction and neutral or hostile to creatures of other factions. To set a faction, just click on the “Faction” field (scroll down, it’s below the fields for scale and tint and under the “Behavior” subset of properties) and click on the info field. You can then assign that faction to the creature.
How do you know if one faction is friend or foe to another? In the Dropdown Menu, select View à Factions and you’ll see the Faction table for your module. This grid shows how Factions interrelate with 0’s representing hostility, 50 representing a neutral relationship, and 100 representing friendly.
You can Add and Remove factions and click on their entries in the grid to alter names and relationship numbers. The PC faction is the player character’s faction. Note that the Lizardfolk Warrior is part of the Hostile faction which has a “0” rating with the PC faction – the Lizardfolk Warrior hates the PC and will attack the player on sight. By changing the numbers in the relationship matrix, you can influence the overall behavior of creatures without complicated scripting.
When you’re done looking at the Factions window, click the “X” in the upper right corner to close it and return to the regular editing view.
Dungeons & Dragons statistics are easy to modify on creatures, though the Toolset does assume you know what classes, skills, feats, and spells do. Look at the Lizardfolk Warrior’s properties info again (in the upper right corner – make sure the Lizardfolk Warrior is selected) and click on the “Basics” tab.
Here you can modify the Lizardfolk Warrior’s basic properties like name, race, and class. Try adding a level of fighter to the Lizardfolk Warrior. Click the “Add” button and notice that a new class appears in its Classes information. Click the Dropdown Menu to change the barbarian class to fighter. If you wish, assign a level using the up/down buttons to the right of the class name.
Using the properties window, you can switch between the tabs for Statistics, Feats, Skills, etc. to tinker with a creature’s various abilities.
Conversations are placed on any object that will “talk” to the player. Creating new conversations is covered in a different HowTo but learning to place them is very easy. Select the creature and, in that creature’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.
Scripts can be placed on creatures to expand their functionality and behavior. Scripts are listed in the “Properties” tab and you can attach a script to various events of the creature’s existence. A script placed in the “On Death” slot will take place when the creature is killed, and “On Inventory Disturbed” script would trigger when someone tries to pick its pockets and so forth. Creatures made with the basic blueprints will have default scripts in all of these various slots, so you don’t need to know any scripting to have creatures do things like move to a target, attack, use abilities, etc. As you become familiar with the Toolset, you may wish to return to these fields later and try using new scripts… but for now, you can safely ignore them.
Placeables are the non-portable props of Neverwinter Nights 2. Placeables, like creatures, have many settings and variables and can accept scripts and conversations. Placeables are generally used as dynamic props which the player can manipulate or destroy, or as static objects that exist as cosmetic features in the game world.
As with creatures, placeables can be placed or spawned into a level, though spawning placeables is rarely necessary. To place a placeable, locate the “Blueprints” window in your Toolset. In the default setup, you’ll see this window in the lower-right corner of the screen. Press the “Placeables” button (the table symbol) to view all placeable blueprints. You’ll see several entries with a “+” sign next to the name, click the “+” to expand the list.
Try placing a cooking pot Look for 02 – MANMADE PROPS à
POTS {03}
Click on the Pots {03} entry and you will now be able to place a cooking pot into the area. Move your cursor into the editing window and left click on the map wherever you’d like to stamp down an instance of the cooking pot.
Advanced Topic: Text in braces
Text that appears in {braces} will appear in the toolset but not in the game. When naming objects, you can include comments in braces that are notes to yourself but won’t be seen by the players. Goblin{strong} and Goblin{weak} would both show up as just “Goblin” in the game. Similarly, a container called {Trapped}Chest would innocently appear as “Chest” in the game.
Conversations and Scripts can be attached to placeables in exactly the same ways as for creatures. Placeables have a few different ways scripts can trigger compared to a creature, but the setup is the same and, as with creatures, you need not bother with scripts just yet. Conversations may seem an unlikely thing to add to a table, lamp, or other inanimate object. However, keep in mind that conversations are really just branching text and a placeable that is a box with three buttons on it could best be represented with a conversation with four choices (one choice for each button and one to press nothing). For now, you won’t need to bother with either conversations or scripts on your placeables.
Advanced Topic: Environmental Objects
Environmental objects are decorative props that do not interact with creatures in any way. While these objects are non-interactive and aren’t even solid with respect to other creatures, they take very little CPU power compared to other, dynamic objects. If you wish to fill an area with lots of props and would like to make those props completely cosmetic, you can convert them to environmental objects to streamline the performance of your level.
To change a placeable to environmental, simply select it and right-click on it in the editing window. You will see a dropdown window appear, select Convert à Placeables to Environmental Objects
You can return an Environmental object back to being a normal placeable by using the command listed right under the one you just used.
Containers are placeables that have inventory and can be used by a player to access the items and storage space. To set a placeable as a container, select the placeable and look at its properties window.
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
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.
Items are mobile props, including weapons, armor, magic trinkets, keys, and all manner of objects meant to be transported and not stuck in the environment.
Weapons, armor, magic tools, and other equipment-style items have many fields and variables – creating and modifying items is covered in another HowTo. However, when placing your creatures and placeables in the world, you will often want to put equipment and loot on them.
Creatures and placeables have inventories where items are carried. Placing items into either is roughly the same process. Start by selecting the creature or placeable (for example, the lizardfolk in Pitney Lannon’s house) in the area and clicking on the “Inventory” tab of its Properties Panel. There will be an “Edit” button in the corner of this window, click it to access the creature’s inventory.
Let’s add some more weapons to this Lizardfolk. Look for the Weapons category in the list of items in the lower-left. Click on the “+” next to Weapons to expand the categories of weapons.Then expand Bladed and Shortswords. You may need to use the scroll bar to see all your options as the menus expand.
Look for entries called “The Icy Blade” and “The Lucky One” in the lower-left list of items. To equip an item onto a creature, click and drag the item from the lower-left item list to one of the equipment slots on the right-hand side. The Icy Blade is a weapon and so will fit in a creature’s left or right hand – try clicking and dragging it to the left hand slot. If done correctly, the item’s name will appear in the slot.
To put an item into a creature’s general inventory, click and drag it to the upper-left area. The name of the item will then appear in the general inventory section.
Advanced Topic: Item Instances
When you give an item to a creature, you are creating a new instance of it. As with placing instances of creatures, item instances are not directly linked to their parent blueprint. So if you edit an item blueprint, the instances of that item you have already placed will not reflect the changes. Similarly, you can modify an instance of a item without affecting other items made from the same blueprint. It is generally best to create items as blueprints instead of modifying specific instances. Doing so will make it easier for you to later track down specifics for any given item.
The two boxes next to each item in the inventory/equipment areas can be checked to make an item droppable or pickpocketable. By default, when a creature dies, all of its items go with it. An item flagged as “droppable” will be left on the ground when its owner dies. An item flagged “pickpocketable” can be lifted from its owner with the Sleight of Hand skill. Try flagging “The Lucky One” as droppable.
Placing items on containers is done in the same manner as with creatures, but placeables have only a general inventory. It’s also worth noting that droppable and pickpocketable flags have no bearing on items in a container – if a container is destroyed, all items are left on the ground and containers have no pockets to pick (though they can be pried open and looted).
Creatures, placeables, and items are the actors and props of adventure. While all three of these objects have many variables and parameters, they are simple to place and the most important settings are easy to tweak. Now that you’ve completed this HowTo, you should know:
1. General facts about creatures, placeables, and items and their purposes.
2. How to place creatures and placeables.
3. How to make basic changes to a creature’s appearance, behavior and stats.
4. How to make placeables into containers.
5. How to place items into the inventory of a creature or container.
In this HowTo, you will learn the basics of creating a branching conversation tree that players can explore as they wish. You will learn a little about how condition and action scripts can be used to make your conversations more interesting and powerful. You will also learn how to attach the complete conversation to a creature in your module.
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.
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 that node. In these cases, the conversation will proceed to the next red line, allowing an NPC to make multiple statements before the player responds.
1. The text for the currently selected node. All of the information in the Node Properties section (D) refers to this node.
2. A series of options from which the player can choose. After the preceding red node fires, the player will see these options and can click on (or press the number of) the one he wishes to select. Note the + sign to the left of these nodes, which shows that they can each be expanded.
3. Other node information. By right-clicking on this region (choose “Columns”) you can set which columns of information will be displayed. In this screenshot, you can see Actions, Conditions, and Quest information for each node.
4. Node Properties. This section contains more details on the selected node.
5. Text. The text for the selected node is shown here. Just click on the text box and type to change what the NPC says (red node) or what player option is presented (blue node).
The grey nodes are links to other nodes within the conversation. Using links prevents you from having to type the same line for the same situation.
To add a node to a conversation tree, just right click on the preceding node and choose Add. A “New Line” window will appear. Just type in the text 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.)
Scripting in NWN2 is very powerful and can be complicated. In creating the official campaign, we had many scripters who are a specialized type of designer (or a specialized type of programmer, depending upon your perspective) who spent their time mastering the scripting tools and possibilities, creating new global scripts to be used in area creation. The details of scripting are beyond the scope of these HowTos, but 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 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.
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.
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.
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 à Conversion.
Your new dialogue will be entirely empty, save for the Root node. As mentioned in the earlier overview of a conversation, you can add your first line by right-clicking on the Root node and selecting “Add.” This will bring up the New Line window where you can input the first line of the dialogue. Note that the first line after the root is always an NPC line.
Once you hit “OK” the New Line is added and you have the introductory line for the victim.
If you were to add a line to this red NPC line, 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.
End Dialog? If a Player node has NO responses attached to it, it is a conversation-ending 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).
Since these lines don’t yet have any text following them, they are dialogue-enders. 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.
Advanced Topic: 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. Check out the Sample Module
for an example of a store.
1. Store Dialogue Node. This is the dialogue node that accesses the store in the Sample Module.
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.
Links are an incredible time saver when writing large dialogues. If you want the conversation to return to a previous set of options, links let you do so without typing re-typing everything over again.
Continuing with the previous conversation, 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.”
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.
In the Sample Module, 01_ginni is an example of a barkstring conversation. Pitney’s wife always speaks a single line and never allows the player to offer a response.
Advanced Topic: 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 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.
Advanced Topic: 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 drop-down menu. The “Show Once” field defaults to “Always,” which means that the node will always appear, unless Conditions dictate otherwise.
Set the “Show Once” tab to “Once per game” to ensure that the node will only be called once, and will never appear again. Be certain that a fall-through node follows the once-only node, however, or the conversation will simply close.
For Persistent Worlds, it may be wiser to set the “Show Once” field to “Once per creature that uses this conversation.” Otherwise, the node will be displayed for the first player who views the dialog, but will never appear again!
Conversations are placed on any creature or object that will talk to the player. Select the creature or placeable and, in that 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.
Neverwinter Nights 2 offers an extremely powerful conversation system that can look intimidating at first but is quite simple to use. Put your writing skills to the test and see what sort of conversations you can offer your players! Now that you’ve completed this HowTo, you should know:
In this HowTo, you will be introduced to triggers, and you will learn how to place them in the game. You will also gain a more detailed understanding of two specific types of triggers: speak triggers and area transitions.
Unlike most objects that are placed in the game world, triggers are usually invisible to players. They behave as their name suggests – when a PC crosses the border of a trigger, something happens. A trigger might activate a dialog, spring a trap, or spawn a gang of monsters.
If you have played the Sample Module, “Uninvited Guests,” then you have already encountered a simple trigger. When you first approached Pitney Lannon, your PC entered an invisible speak trigger. This trigger caused Pitney to run toward you and opened his dialog window.
The toolset provides a set of pre-made triggers for quick and easy use. More advanced modders will probably make extensive use of the “generic” trigger, which can activate custom scripts and is highly versatile. For the purposes of this tutorial, however, we will focus on some simple pre-made triggers.
A speak trigger opens the dialog window and launches a Conversation file. To place a speak trigger in the world, first open an Area in your module. Then locate the “Blueprints” panel, and select the “Triggers” tab.
Click “SpeakTrigger,” and move your mouse pointer into the Area Viewer. Note that the mouse pointer looks like a crosshairs, instead of an arrow.You will now define the borders of a new SpeakTrigger. Click once in the Area Viewer to set the first corner of your trigger. Then click another point nearby – a line will be drawn, connecting the two points. Click two more points to define a square or rectangle. Press F2 (or right-click once), and your mouse pointer will return to default mode. A trigger can be any shape. You set as many corners as you like, and the toolset will adjust your trigger’s shape accordingly.
Once you have created a trigger, you can move it around the Area, just like any other placeable object. Click your trigger once, and click-and-drag it wherever you want.
Advanced Topic: Reshaping Triggers
If you don’t like the current shape of a trigger, you can right-click it and select “Repaint Trigger” from the Dropdown Menu. This turns your mouse pointer back into a crosshairs. As soon as you click once in the Area Viewer, your old trigger shape will disappear, and you’ll be able to set a new one. When you Repaint a trigger, any properties that you have already set on that trigger remain unchanged.
Your trigger is now placed in the world, but you will need to set its properties before it will have any in-game effect. Start by selecting (clicking) your trigger. Then take a look at the Properties Panel.
First, be sure that the “Properties” tab is selected. Scroll down to the “Scripts” section. Notice that the On Enter Script is already set to gtr_speak_node. Do not change or delete this script – it provides the basic functionality for a speak trigger.
At the bottom of the “Scripts” section is a line labeled “Variables.” Click the field to the right of the “Variables” label (you should see some boldfaced black text in this field), and a browse button (labeled with ellipses) should appear. Click the browse button to open the Variables window.
You should see nine variables listed in the new window, labeled 0 through 8. Click on each of these to view its settings on the right-hand side of the window. We’ll review the most important of these variables, in turn.
1. NPC_Tag. Determines the NPC who will be initiating conversation with the player. Enter this character’s tag in the “ValueString” field. In the sample module, ValueString is set to 01_pitney, which is Pitney Lannon’s tag.
2. Conversation. The most important field – your trigger will do nothing if this field is left blank. This field specifies the tag of the conversation launched by your trigger. Enter this conversation’s tag in the ValueString field. In the sample module, ValueString is set to 01_pitney, which is the tag of Pitney’s conversation.
3. Run. Determines whether the NPC will approach your character when the dialog begins. If you set the ValueInt field to 1, the NPC will run to your character. If you set ValueInt to 0, the NPC will walk. If you set ValueInt to -1, the NPC will remain where he is. In the sample module, this variable is set to 1, so that Pitney comes running over to your character as his dialog begins.
4. TalkNow. Determines whether the dialog starts before the NPC approaches your character. Set the ValueInt field to 1 if you want the dialog to start immediately. Set ValueInt to 0 if you don’t want the dialog to start until the NPC reaches your character. In the sample module, this variable is set to 0, so that Pitney’s dialog doesn’t open until Pitney runs over to your character.
5. MultiUse. Determines whether the trigger will fire every time a PC enters it, or if it fires only once per game. Set ValueInt to 1 if you want the trigger to fire every time a PC crosses its border. If you leave ValueInt set to 0, the trigger will only fire once. In the sample module, this variable is set to 0, so that Pitney only initiates his conversation the first time the player enters the speak trigger.
Advanced Topic: Speak Triggers and Combat
CombatCutsceneSetup. This special variable is useful when a speak trigger is placed in a dangerous area. If there is a chance that hostile enemies might be nearby when a player enters the speak trigger, set this variable to 1. This will cause all hostile creatures to disappear for the duration of the triggered conversation (and prevents your player from being attacked while stuck – and helpless – in dialog). In the sample module, there is no chance of any hostile creatures attacking the player in the Lannon Farm area, so this variable is set to 0.
After the conversation, the hostile creatures will be returned and game play will continue normally.
If you have assigned a conversation tag to the Conversation variable, assigned an NPC tag to the NPC_Tag variable, and made sure that this NPC is placed in your Area, then your speak trigger is ready to test in game!
Now that you have learned the basics of placing a trigger, we will discuss another trigger type: the area transition.
An area transition allows the player to move from one area to another by walking over a trigger. They are useful in situations where a door is inappropriate (for example, if you want the PC to leave an area by walking down a road). This section explains the basic functionality of area transition triggers, defines parameters that need to be set, and notes how they differ from speak triggers.
Place an area transition in the same way as a Speak Trigger. To properly set an area transition so that it will transport players to the area of your choice, first select your area transition trigger, and look at the Properties panel and tab.
Locate the “Behavior” section, and set the following fields:
6. 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.)
7. 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.]
8. 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.
9. Localized Name. You can use this field to remind yourself of an area transition’s purpose and/or destination. It is not displayed to players.
If you have set the properties described above, and made certain that your destination door or waypoint is placed somewhere in your module, then your area transition is ready to test in game!
Advanced Topic: World Map
It is also possible to set up transitions that bring the player to a World Map. The world map is an image that you create that depicts an abstracted map of your entire game world. You can place map points on the map, with an image (such as a city or dungeon icon) associated with each. When the player goes to the World Map, they can just select their desired destination and they will transport there instantly. You can even set-up scripts to cause special events to occur when the player travels to certain areas at different points in the adventure.
To experiment with the World Map Editor, go to Plugins à World Map Editor.
The global script gtr_world_map_en is used in the Official Campaign as an OnEnter script for all triggers that serve as World Map transitions.
Triggers are a useful tool in area design and allow you to create events that happen based upon the location of the player. Now that you’ve completed this HowTo, you should know:
1. How to place a trigger in the game world, and how to redraw it, if necessary.
2. How to trigger a dialog from a trigger.
3. How to use triggers to transition from one Area to another.
This HowTo discusses the basics of items and how to create them. By the end of this HowTo, you’ll know about most of the many properties items can have, as well as how to create your own items. You’ll also have learned about how to create custom appearances for items that appear in game, such as weapons and armors.
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.
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.
To create a new item, click on the “Items” tab in the Blueprint Menu to bring up all of the items in the game. Right-click anywhere in the New Item field to bring up a small pop-up menu: within that menu, go to “Create Blueprint,” and select “Module” (this is unless you wish to create an item usable in any module: if you want to do that, select “Global” instead). This process creates a new item template for you to work with within that particular module group. [Note: another method for item creation involves copying an existing blueprint by clicking on the particular item, right-clicking to bring up the Dropdown Menu, and selecting “Copy Blueprint.” This creates an identical version of that blueprint to modify – which can be beneficial for creating items that only need to be slightly modified from an original version.]
Within the item template are multiple fields that determine the properties of an item: [Note: Some tabs are closed in this screenshot because they do not directly deal with items being created. The Armor tab is closed here because it deals exclusively with armor items, which are addressed after this section. The Misc & and Scripts fields are not used in the creation of standard game items and are thus not touched-on here beyond a brief explanation.]
1. Appearance. This section briefly determines the general look of your item, particularly weapons.
a. Appearance (special effect) – a list of special effects that can be attached to an item. Typically these are not necessary, as weapon effects are actually hard-coded: any weapon with an elemental enhancement bonus that averages to 3 or higher (i.e., 1d6 and up, not 1d4) automatically gains an appropriate visual effect. Visual effects can also be set in the “Behavior” section.
b. Container UI Screen – sets what background graphic is used when a placeable container is opened. Should be left at the default for item-creation purposes.
c. Icon – what icon the item uses (pulls from the list in nwn2_icons.2da).
d. Model Part – what model the item uses (only important for certain equippable items, such as weapons and bard instruments. Wearable items use the armor set tool and are discussed later).
e. Tint – the colors that the item model is tinted (shown in RGB values).
2. Behavior. How the item works within the game world.
a. Additional Cost – how much the item will cost in addition to the preset values (seen three lines below in the unmodifiable “Base Cost” area). Every item is given a base cost in the baseitems.2da: any enchantments on the item are given values via code and added on to the cost. If the user desires any modifications in addition to this code-based value, it can be added here (or set as a negative value to decrease the price).
b. Armor Type (for game rules) – sets the armor type (via the preset armor rules in the 2das). Only important for base armor sets.
c. Armor Rules Info – CANNOT MODIFY. Gives a list of all of the rules attributes for the selected armor type.
d. Base Cost – CANNOT MODIFY. Lists the base cost of the selected item type.
e. Base Item – determines the actual item type. This is likely the most important field in the entire blueprint (aside from the resref, which is discussed below) because it determines item elements such as model used, item weight, weapon stats, and base cost (all of these individual settings are controlled by the baseitems.2da file, and cannot be modified within the toolset itself).
f. Charges – how many total charges a magical item has (only useful for items that cast a spell, and that the user only wants to have a particular number of charges – different spells can have different charge costs, and even be recharged if desired)
g. Container Preference – which type of container the item defaults into when picked up: default is the standard player inventory. This setting can be used, for example, to have a potion box that, by default, will store the 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).
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.
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.
Once the name and resrefs have been set, you need to set the Base Item (in the Behavior field). In the example case, because the Harvest Mead is a small, unequippable item with no special properties needed, it should be set to be a “Miscellaneous Small Object” (this will assure that is assigned the proper settings from the baseitems.2da) – use the Dropdown Menu in the Base Items field to select it, and hit “Enter” to confirm your choice.
Advanced Topic: 2da Files
The term 2da stands for “2 dimensional array.” 2da Files are used by NWN2 to contain data for many aspects of the game, including spells, character classes, and feats. The 2da files are located in the Data folder. baseitems.2da specifies the basic parameters for many different types of items. Each row in a 2da is one entry and each column is a field. For example, all greatswords share the same row in the baseitems.2da. They all do the same amount of base damage, are equipped with two hands, choose their models from the same set of options, etc. Potions, rings, scimitars, etc. each have their own row in baseitems.2da.
Once these main parts of the item are set, the only things that remain are setting the icon for the item (selecting the icon field will create a drop-down, scrolling menu just like the Base Item field: change the icon from temp0 to it_spirits), setting the desired value in the Plot field (it is not necessary to prevent the Mead from being dropped or destroyed, so the field will remain set to False in this case), and writing a proper description for the item in the Localized Description field.
To give the item a little more variety (and to provide an example of how an unequippable item can provide passive bonuses by sitting in 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.
The item should be ready to place within the module.
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 is a weapon, now there will be an actual model available to select [Note: this is the case with most equippable items, but not all – bracers, rods, wands, and jewelry do not have visible models set for them]. Move up to the Appearance area and set the desired model number in the Model Part fields: different base items have a different number of available models and model types, and some have interchangeable model types (swapping out different hilts, blades, and pommels on swords, for example). To find out what model (or combination of models) looks ideal, it is a good idea to change the Model Part values one at a time and swap between the “Properties” and “Preview” tabs to see how the item changes [Note: if a black question-marked cube appears in the Preview window, that is because there is no model set for the given model number].
For the Reptile Bane Cudgel example, type in “2” in the first Model Part field – this will select the second available club model (the metal one). You will be able to check the model by clicking the “Preview” tab at the top of the window, and navigating through the window by using the mouse scroll button to zoom, Ctrl+right-click to move the model around, and Ctrl+middle-button-click to tilt the camera [Note: the “Preview” option on the top bar must be selected, or no model will appear in the Preview window]
Once the club appears correctly, open up the Tint mini-menu in the Appearance area. Three set tints will appear – click on one to bring up the Color Edit Form.
The Color Edit Form sets the individual tints on a model, either by selecting a color by hand from the palette on the left, or by selecting a named swatch on the right (the names of each swatch appear when the mouse cursor is hovered over each swatch). 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 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.
Once this field is set, the weapon should be ready for use.
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 ArmorRulesInfo field below (in gray) update to reflect the rules for that particular armor type.
Once the Armor Type has been set, select the “Armor Set” tab on the far right of the blueprint menu – this will help you to set the actual appearance of the armor itself [Note: the model for the Armor Set tool is a human male: while the majority of the base armor models are identical in appearance across race and gender, some armors may appear different on some race/gender combinations]
As with the Preview window, navigation within the Armor Set window is controlled with a combination of the middle mouse button and the Ctrl key: the mouse scroll controls zoom, Ctrl-middle -click rotates the model, and middle -click-drag moves the model. It is important to note that when using the Armor Set tool that one should turn OFF the Preview option along the top bar of the window: the Armor Set tool will be useable either way, but turning off the Preview option prevents armor flickering within the Armor Set tool when the Preview window loads an updated model.
The first thing to do when creating an armor within the Armor Set window is to set the base appearance of the model, which is listed under the Main Type (which controls the armor appearance type) and Main Variation (selects model variation within the main type) menus. The two armors below are both scale mail, for example, but use different variations.
Advanced Topic: Untraditional Armors
It is possible for the armor appearance and the Armor Type (from the “Properties” tab) to be set differently, so one could have armor that looked like cloth but had the properties of Full Plate mail, and vice versa. This is an option for armor creation, but moreover something to be aware of when creating armor.
For the purposes of the example, select the “Padded” armor from the Main Type menu in the “Armor Set” tab, and select variation 0 for the set.
The second step of creating armor is to decide on the armor attachments. On the bottom right of the Armor Set tab is a scrolling menu listing each armor attachment slot, which allows the user to pick what armor attachment they would like to put in what location [Note: as per the note above, armor appearance and Armor Type are not inherently linked, so it is possible to use any attachment on any base armor without influencing its stats.] To place an attachment, scroll to the desired attachment location (such as “Left leg”), open up the Dropdown Menu (which lists the models available for that attachment slot), and select the desired attachment.
For 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, 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.
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.
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.
Although a first glance at the many fields and settings of an item blueprint may appear intimidating, it should quickly become an easy thing to swiftly create all kinds of items – both fantastical and mundane – with which to populate one’s modules. Now that you have completed this HowTo, you should know:
Map making is a rewarding part of creating your module. It’s the first thing the player sees after making his character. The Neverwinter Nights 2 map making tools are incredibly flexible and you now have far more control over terrain and prop placement. With the added functionality comes more complexity. This document goes over the basics of exterior and interior map making and how to place the various objects.
Areas in the game are either exterior or interior maps. Exterior maps are made with a height map and allow full flexibility in sculpting your terrain. Interior maps are made with the various tilesets and similar to how the original NWN1 maps were created, though with greater flexibility on object placement. Within any given module, you can use both exterior and interior areas. In the Sample Module, for example, you begin in the exterior map outside of Pitney’s home and then can enter the interior map in his home.
The first thing you need to do is create your first map. Create a new area by selecting File à New à Area. The New Area Wizard will come up.
The Area Tag is the name for the map so choose whatever is appropriate. Leave the Area Type on Exterior. The size of the area can be adjusted after the map is made but start with a small map while practicing with the toolset.
You should see a plain green area in the main window. If you click “Grid” on the Toolbar it will show the area grid with Black. Red, and White lines.
The black lines signify tile regions which affect textures, water, & grass limits. The tile regions will be covered in more detail in the appropriate sections.
The White line indicates where the map border starts. Each exterior map has a 2 tile region border that characters can not enter. It’s there purely for decoration so characters won’t see the end of the world! This is a place for hills, snaking roads, trees, etc. that add some beauty and detail to your maps but have no other effect to gameplay.
The toolbar has several handy functions for map making. Not all options will be covered but feel free to play around with the toggles to see what they do!
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.
9. 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.
10. 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.
11. Snap. Used for doors so they will snap into position at the doorframe correctly.
12. Select Objects. The main mode for selecting the various objects on a map.
13. 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.
14. Select Terrain. Allows a tile to be selected. This is handy when working with water or checking texture usage.
15. 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”
16. Tiles. Used for Interior maps, see that section for more details.
17. 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.
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 have a fixed time of day. Also generally used on maps made exclusively for cut scenes.
1. Run. This allows you to see the full day/night cycle running in the editor.
2. Normal Speed/Fast. Adjusts the speed of day/night cycle when “Run” is active. Useful to get a quick feel of how the area looks at all times of the day.
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.
3. Appearance.
3.1. 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 standard lighting settings on some of the sample maps to get a feel for what each control does.
3.2. 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.
4.
Environment.
4.1. 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.
4.2. 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.
4.3. 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.
4.4. Is Always Night? True/False - Normally used for exterior maps that have a fixed “Default” lighting. This setting affects whether races like drow and duergar ever suffer their light sensitivity penalties.
Advanced Topic: Eternal Night
To make an area night all of the time, you have to do more than just set “IsAlwaysNight” to True. Make sure that the Day/Night Cycle is set to False and that the Default lighting setting (#7) is set to the nighttime conditions that you desire.
5. Fog. Not currently functional. Leave at False.
6.
General.
6.1. Interior True/False - For interior maps this should be set to true. Exterior maps should be set to false. Surprise!
6.2. Natural - Natural environments like caves or forests should be set to true. Towns or villages would be set to false.
6.3. Underground - Caves or underground lairs should be set to True.
6.4. 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.
At the top of the Area Properties window are two buttons “Import Properties” & “Export Properties”. These settings will allow you to import and export a group or individual day/night/default lighting settings. Useful if you like a map’s lighting and want to import it to your own map.
Now it’s time to try your hand at painting an exterior map. There are four major tools available.
Terrain is for adjusting the height of the surface mesh, adjusting the walkable areas, and tinting the textures. The brush will match the color of the currently selected tool.
Texturing is used to paint the actual terrain surface with grass, rock, dirt, cobblestones, etc. and has great versatility in brush control for nice mixing effects.
Grass is used to paint various animated grass on the surface mesh and has control for mixing different grass textures, blade size, size variation, and density.
Water can be painted down at any height and has control of color, ripples, speed, & reflections.
All four tools use the Brush to control painting size, brush pressure, height, & density.
1. Size. This is the area of the brush that paints at the full pressure setting. Indicated by the inner circle of the brush.
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.
4. Density. On grass painting this affects how much grass will paint in the current brush size. A high number will make a dense grass section.
5. Height. Controls what level the water will paint. Can be used with the Eyedropper button. More details are in the water section.
6. S, M, L, G. These are predefined buttons for brush size.
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.
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.
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.
This tool is used to paint textures on the terrain. With the pressure option various textures can be layered to add greater detail and variety.
Texture painting has some limits so be sure to plan ahead when making your map. Usually it’s a good idea to pick a couple grass and dirt textures that you plan to use throughout the map. Leave at least one texture space free for later additions. Even though you can use up to six textures per tile region don’t go too heavy on usage. The more unique textures a map has the more video card memory is needed.
1. Texture Selection. This scrolling list shows all the textures included with NWN2 for use with ground texturing. Select a texture on the list and the brush will paint it on the terrain at the size and pressure percentage.
2. Texture Swapper. This option will swap the currently selected texture with another one you pick on the popup list. This will do this swap on the entire map so take care!
3. Fill Map. This will fill the entire map with the selected texture overwriting all current texture painting. There is a confirmation box just to remind you since this is a very dangerous button!
Advanced Topic: Selection
This list shows the currently used textures on a tile region. Each tile region (the black lines when “Grid” is on) can have a unique set of six textures. The position on the list is not an issue when painting from one tile to another. So if you have Dirt05 on two tiles in different positions on the list the editor will paint correctly across tile boundaries. You can individually change a texture on a tile by selecting that texture and picking a new one. If you want to do this for the entire map, use the Texture Swapper. If you already have 6 textures on a tile the editor will not allow you to paint another one.
Animated grass adds some nice movement and dimensionality to a map. It can be sprayed down like a texture and has control on blade size and density.
1. Grass Options.
1.1. Blade Size - Adjusts the size of the grass.
1.2. Blade Size Variation - Adjusts the size variation so grass doesn’t have an even height. The higher the number the more extreme the variation will be.
2. Grass.
2.1. Grass Selection - Pick a grass texture from the list. You can select multiple grass textures and they will be mixed together when you paint.
2.2. Paint - Paint grass with the brush.
2.3. Erase - Erase grass with the brush.
Water is painted down just like textures or grass but conforms to a flat height setting. Each tile region can have its own water height so it’s wise to plan ahead on where you want water if multiple ponds or lakes will be on a map.
1. Water.
1.1. 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.
1.2. Erase - Erase water with the brush.
1.3. 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.
1.4. Import - Import previously saved water.
1.5. Export - Export your favorite water settings for use on other maps.
2. Water Settings.
2.1. Color - Set the color of the water!
2.2. Ripple- Adjust the level of ripple. X & Y can be independently controlled.
2.3. Smoothness - Adjust the choppiness of the water. From a violent sea to a frozen lake.
2.4. Refraction settings - Adjust the reflection level of the water.
3. Water Layers. Water has 3 layers that can be independently controlled. Allows great variety of effects. Controls scroll direction, rate, and angle. Plus two textures are available.
Now that you are familiar with terrain, textures, grass, and water painting its time to place the various objects on a map.
The Blueprints window is where you pick the various objects. Each type has its own tab. For the purposes of map making, we are most concerned with placeables, environment objects, trees, lights, placed effects, and prefabs. Some of these are discussed below.
Placeables are premade objects like buildings, rocks, crates, etc. Just select a placeable from the list and stamp it down on the map. It will conform to the height of the terrain. If you select and drag you can move it around. Shift-right-click & Hold to rotate. Page Up/Down to change height. The Spacebar drops to the ground plane.
There are many properties associated with a placeable. When a placeable is selected its properties will appear in the properties window. Not all will be covered in this document but below are ones more associated with decorating your levels.
1. Tint. Many placeables have areas of the object that can be tinted a selected color. Up to three colors can be changed depending on the object. The object name will indicate if the object has tinting enabled.
2. Scale. Change the X/Y/Z scale value of an object. Can be made large or small but take care not to increase size too much since it will stretch the texture!
3. Static True/False (Static/Dynamic). Static objects (Static True) are default placeables. This means the object takes up space but can not be interacted with. Dynamic objects (Static False) are chests, bookcases, etc. that need to be interacted with. Chests etc. are covered in more detail in other documents.
4. Height/Position Lock. These settings control locking of an object. Height lock is useful when you have an object at the right height and don’t want it to move up/down when you adjust its position. Position lock is good for objects you don’t want to accidentally move later. Quick key for HeightLock is Z. Quick key for Position Lock is L.
5. Stackable. Placing objects on tables can be a pain! But Stackable True solves it for you. Select an object and set Stackable to True. Drag that object to a table and the object will pop up to the top! Quick key is S.
6. Cast/Receive shadows. Shadow casting is processor intensive. For small objects or objects always inside a shadow you can set them to not cast shadows. By turning off receive shadows an object can appear to glow. Useful for arcane circles or torches.
Environmental objects are placeables converted to a less processor intensive format. Any placeable can be converted. Select the placeable and use the “Convert” button at the top of the map screen. Also any environmental object can be converted back to a placeable.
Use this for any object in the Border area or objects like rocks or buildings that the player can never get close to. The engine does not calculate collision with them (character or camera) and does not cut the walkmesh for them. They are useful to give the game fewer things to calculate when running your map. Decorative objects on tables are another good candidate for conversion.
Trees are objects created with the SpeedTree technology. They are designed specifically for high speed processing of natural looking trees and can be used in relatively great numbers without significant processor load.
Trees can be adjusted in scale just like placeables and have standard height and position locking options.
Each tree has a random seed value that can be changed to adjust the look. So if two Oak trees are placed with different seed values both will have different trucks, branches, and leaf positions. Play with the number and see what interesting trees you can make!
Though the number of trees can be relatively great, the number of unique trees should be controlled. The engine spends a fair amount of time calculating each unique tree so limiting the number is a good idea to keep your map running smoothly. At present it is recommended not to have more then five unique trees per map. Please note the same tree with two different seed values is considered two unique trees. But tree scaling is not considered a unique tree so using the same tree/seed value with different scales is an easy way to add variety.
Point lights are lights that can be placed on a map to add interest to a level. You can adjust range, color, intensity, shadow level, & flickering to each light.
1. Placing. Point lights are placed just like other objects. You will notice there is only one listed in the Blueprints. To keep track of your lights they can be named in Light Properties under “Localized Name.” If you select multiple lights all can be named as a group. For example all the torch lights on a level could be named “Small Torch Light.”
2. Color. The color setting controls the color, reflected color, and intensity of the light.
2.1. Diffuse Color. This is the main setting for color and will light all objects within the range that color.
2.2. Specular Color. This is the reflected color that bounces off shiny objects like armor, metal, and glossy objects.
2.3. Intensity. Brightness of the light. Be careful of too high a setting since it can blow out the detail on close objects.
2.4. Lerp Color. Used when Lerp is on. The color a lerp light changes to from the normal color settings.
3. Range. Range of the light. The red dot pattern globe shows the point the light no longer affects tiles, surface mesh, and objects. This range is significant when dealing with lighting performance issues.
4. Shadow/Intensity. Lights can cast dynamic shadows on tiles, surface mesh, objects, & characters. The intensity is how dark that shadow will be. It’s best to keep the intensity close to your directional light shadow settings. Generally a setting of 0.5 or 0.6 is a good level. Turning off shadows helps with performance and works well for lights that should act more like a glow such as magical effects in the environment.
5. Flicker settings. Lights can be set to flicker so objects like torches and fireplaces look more natural. The Flicker Type controls the type of flicker effect. For example Jumpy will make the dynamic shadows move and works wonderfully with campfires and similar.
5.1. Flicker Rate. The speed of the flicker.
5.2. Flicker Variance. The range of the flicker effect. High number will make the flicker more dramatic while a small number will make it more subtle.
6. Lerp settings. Lerp can set a second color for a pulsating light. Use it for a light you want to change between two colors. The Lerp Period controls the rate of the transition.
7. Performance Considerations. Point lights take a fair amount of processor time especially with shadows turned on. Use the range globe to see how many lights are affecting objects, surface mesh, and tiles. A good rule of thumb is to have no more then three lights hitting any of these. Remember if you are using a directional light it should be considered when making your calculations.
Placed effects are premade effects created with the Effects Editor. They include such things as fire, torches, candles, smoke, etc. They are placed like any other object and have few controls to deal with. The yellow “helper” object allows you to select and move the effect around. You can turn this off separately in the Show/Hide filter on the Toolbar.
Prefabs are objects grouped together for easy placement. An example is a chandelier with candle placed effects. When you select the object group it moves and rotates as one item. You can Right-Click on the object group and ungroup them if you prefer. If you want to select just one object in the group Ctrl+click. You can manipulate that one item without breaking the group.
Make your own prefabs by first selecting multiple objects and then right-clicking on one of the objects in that group. A popup allows you to group those items together. Give the group a unique name and you’re done! If you can export that group to your Override folder, it will appear on your Prefabs blueprints window.
Level baking is the process of defining what is and is not walkable by the characters. The process has two basic steps. The first step is to define your walkable region and the second step is to run the “Bake” procedure which imbeds the walk data into the level. You can always modify the map walkable regions but you must “rebake” the level after you do this before running the level in the game engine. If you try to run a level without baking, the characters will be stuck wherever they spawn!
The first step in getting a level ready for baking is defining where on the map a character is allowed to walk. There are basically three levels of control for this procedure. Please note that border area tiles are ALWAYS set to “No Walk”.
The first level is the “Walk/No Walk” buttons under Terrain Tools. This is the lowest level control over where a character can walk. Use the Brush tool to control size of brush similar to how it works for Terrain and Texturing. The black lines are non-walk areas, green lines walk areas, & yellow lines are the border between them. The character in the image is standing in a legal walk area but the hill to his left is not crossable.
It is advisable to paint “No Walk” over large areas of non accessible areas since it will make the baking process much faster and generate a smaller area file.
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 is placed the same way as a normal trigger (see trigger placement info elsewhere) and will define a no walk region when the level is baked. It’s usually best to place these with the camera directly overhead. In the below image our hero now has a tighter exit off this slight rise. He can’t walk in the black area to the left and rear plus is blocked directly in front of him. And he can’t walk inside the area defined by the blue region.
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.
Once you have everything defined it’s time to run the bake procedure. Under “File” is an option called “Bake”. Running this can take some time on large maps so you will be greeted with a warning box just to be sure you really want to do it.
Once you run the baking procedure you can check it to be sure everything is defined as you planned. On the toolbar turn on toggles “Surface Mesh” and “Baked”. In the image below the Walkmesh cutter has cut out the area defined by the blue lines. The rock placeable cut itself out automatically! Our character has much less space to move around now. Note there’s a little sliver of walkable region between the cutter and rock placeable but since each creature in the game has a defined width he shouldn’t be able to move inside there.
If you want to make changes to a walkmesh first turn off the “Baked” toggle button and make any adjustments you want. You can change walkmesh cutters, placeable locations, & terrain walkmesh painting. But before you run your level in the game make sure to “rebake” the level! The Bake toggle will always show the current terrain bake so by turning it on and off will show the changes that you made.
Advanced Topic: Issues with too many objects
Sometimes with densely packed placeables a tile region can get overloaded and fail the bake process. You’ll 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. The below example shows two stools and a campfire that were converted to environmental objects and surrounded by a cutter. This is a simple example and normally the engine would not have an issue with a simple cut like this.
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.
A new area is created just like with an exterior map. Create a new area by selecting File à New à Area. The New Area Wizard will open up.
The Area Tag is the name for the map so choose whatever is appropriate. Switch the Area Type to Interior (terrain). The size of the area can be adjusted after the map is made but start with a small map while practicing with the toolset.
The Tiles Panel displays the seven tilesets available. By opening up each subsection it will show the available tiles for that set. Most tilesets also have “Meta Tiles” that are special larger pieces used either for specific main campaign maps or for added flexibility. The “Caves” tileset for example has many unusual meta tile pieces to help make a cave look more natural.
Placing tiles is as easy as selecting the desired type and clicking it down on the map area. To make mapping easier turn on “Occlusion Grid” on the Toolbar. This will show the tile boundaries and map edges.
1. Rotating tiles. To rotate a tile use the Left/Right Arrow keys.
2. Types. There are many types of tiles and the thumbnail image will give you an idea what the tile is. A blue line means a wall. Red is a door position. A cyan dot is a corner. Arrows indicate a staircase up or down.
3. Tile Variations. Some tile pieces have variations you can choose. Frequently a straight wall will have versions with pillars, windows, damage, etc. To cycle through the variations use the Up/Down Arrow keys.
4. Mixing tilesets. Some tilesets can be mixed such as the Caves and Mines. Doorways will sometimes line up depending on tileset or a special Meta Tile will be available to connect them. Check the sets and experiment to find what you can connect!
5. Border considerations. When placing tiles make sure to leave one tile section around the perimeter of the map. Otherwise the backside of a tile will be visible ingame.
6. Selecting Tiles. On the Toolbar you will note the “Tiles” button is on when placing tiles. You can select multiple tiles by holding the Shift key down. This is useful when tinting (explained below.) When you want to work with objects make sure to switch to “Select Objects.”
7. Deleting Tiles. Just select a tile and press the Delete Key. You can use the Shift Key to select multiple tiles first. If you have any objects on that tile they will stay behind but you won’t be able to see them unless you place another tile down. All deleted tiles are replaced with a “Roof” tile.
8. Tile Tinting. Most tilesets can be tinted. There are separate controls for Walls and Floors. Select a tile or group of tiles and check the Tile Properties window. Under Appearance you can select the colors you want to change. Some tilesets have tinting on the roof pieces. These are not separately tinted but use the Wall colors.
Level baking needs to be done before a map is completed just like exterior maps. Tilesets are predefined for baking. The walls and doorways are already setup to bake properly. Your main consideration will be placeables and other objects. Remember if a tile is overly populated with objects it can fail to bake properly. If this happens that tile will not be walkable and you will either have to remove some objects or convert some to environmental objects and use walkmesh cutters. See the Level Baking section for more info.
Interior maps are lit just like exterior maps but no exterior elements like sky, moon, or sun are visible. Interior maps should be set to “Day/Night Cycle: False” in the Area Properties window. They will only use the “Default” light setting.
1.
Directional light
considerations. Normally you will want to have “Directional Light Casts
Shadows: False” & “Is Always Night?: False” set. The directional light can
be set to True or False. The directional light (SunMoon setting under Default)
can help punch up the
2. Point Light considerations. Point lights are extremely important for interiors to help enhance the lighting of your map. They should be used for torches, candles, fireplace objects, etc. and help add interesting shadows and color to an area. But they do require a fair amount of processor time so limiting the number in an area is important. Usually a good rule of thumb is no more then 3 lights hitting any tile or object at a time. Note that if you have Directional Lighting set to True this will count as another light.
3. Terrain/Texturing/Grass. These terrain tools are not used in interiors.
4. Water. Water can be used in interiors. For example, the cave set has a pool tile that is excellent as a place to put water. You can even use water to simulate a marble floor!
5. Placeables. Placeables and environmental objects work as they do for exterior maps.
6. Trees. Even trees can be placed inside. Try changing the scale and turning a tree into a house plant!
7. Placed Effects. Add torch fires, candles, etc. to your lighting objects for added detail.
8. Prefabs. Many of the prefabs are made specifically for interior use. Some handy ones are the chandeliers with candle flames already placed!
The Neverwinter Nights 2 toolset has extremely powerful capabilities for building and creating beautiful worlds and environments. It can take considerable experience to create your own masterpieces, but dedicated world makers will find the end results to be well worth the effort. Now that you’ve completed this HowTo, you should know:
1. The differences between exterior and interior maps.
2. How to sculpt, texture, and decorate terrain.
3. How to bake levels so that they are ready to be played in the game.
4. How to place objects such as trees and lights.
5. How to utilize tiles to quickly make interior maps.
This document is a brief reference guide that explains the scripting naming conventions used in NWN2. It also describes some of the action and conditional scripts intended for use in conversations and some changes made to NWN1 scripts. This document is not a scripting tutorial.
While some aspects of scripting have changed from NWN1 to NWN2, many of the NWN1 scripts are still valid. Some basic NWN1 scripting tutorials can be found at http://nwn.bioware.com/builders/sctutorial.html (the sections on “Making Skill Checks” and “How Do I Start My Store?” are obsolete as global scripts now accomplish these tasks).
All scripts in NWN2 are are prefixed with one of the following:
Use the following for item scripts:
i_<Item Tag>_ac |
script to execute when item activated |
i_<Item Tag>_aq |
script to execute when item acquired |
i_<Item Tag>_ua |
script to execute when item unacquired |
i_<Item Tag>_eq |
script to execute when item equipped |
i_<Item Tag>_ue |
script to execute when item unequipped |
The module events will be written to automatically execute the proper script.
Conversations have 2 script types.
a_<Speaker>… |
actions taken |
c_ <Speaker>… |
conditional (Text appears when...) |
Scripts for events on objects should have a prefix to indicate the Object Type. If an object has multiple events, a suffix should be added each script to indicate the Event Type.
Object
Type |
Abbreviation |
Area |
use area num |
Creature (Being) |
b |
Door |
d |
Encounter |
e |
Merchant |
m |
Placeable |
p |
Trigger |
tr |
Event |
Abbreviation |
Area** |
Creature |
Door |
Encounter |
Merchant |
Placeable |
Trigger |
|
X |
|
|
|
|
|
||
click* |
ck |
|
|
X |
|
|
|
X |
close* |
cs |
|
|
X |
|
X |
X |
|
combat round end* |
ce |
|
X |
|
|
|
|
|
conversation |
co |
|
X |
|
|
|
|
|
damaged |
da |
|
X |
X |
|
|
X |
|
death |
de |
|
X |
X |
|
|
X |
|
disturbed |
di |
|
X |
|
|
|
X |
|
enter |
en |
X |
|
|
X |
|
|
X |
exhausted* |
ed |
|
|
|
X |
|
|
|
exit |
ex |
X |
|
|
X |
|
|
X |
fail to open |
fa |
|
|
X |
|
|
|
|
heartbeat* |
hb |
X |
X |
X |
X |
|
X |
X |
lock |
lo |
|
|
X |
|
|
X |
|
open |
op |
|
|
X |
|
X |
X |
|
perception |
pe |
|
X |
|
|
|
|
|
physical attacked |
at |
|
X |
X |
|
|
X |
|
rested |
re |
|
X |
|
|
|
|
|
spawn |
sp |
|
X |
|
|
|
|
|
spell cast at |
ca |
|
X |
X |
|
|
X |
|
unlock* |
ul |
|
|
X |
|
|
X |
|
used |
us |
|
|
|
|
|
X |
|
user defined* |
ud |
X |
X |
X |
X |
|
X |
X |
* These abbreviations don’t use the first 2 letters of the event name.
** Areas don’t need abbreviations.
Boldfaced events are defaults and are assumed if no event is given.
Scripts not covered above should use these prefixes
inc_ |
include file |
ai_ |
artificial intelligence (combat ai) |
n_ |
extra miscellaneous script |
Below are descriptions and code for a subset of the many scripting commands available in Neverwinter Nights 2. Within the toolset, you can see the documentation for any available script by selecting it in the Script Assist window – this is the easiest way to see what a script does.
Action scripts are typically used in conversations to change a variable or cause some event to take place, such as an NPC becoming hostile. Any number of action scripts can be attached to a conversation dialogue node.
This script adds the target as a henchman to
the party.
Parameters:
string sTarget = Tag of the henchman to add. If blank, add
dialog OWNER.
This changes the player's alignment
nChange = From a scale from +3 (Saintly) to -3
(Fiendish), how much act affects alignment
nLawGood = 0 means adjust Good/Evil axis, 1 means
adjust Law/Chaos axis
This script makes the sAttacker attack the
PC. It should be placed on an [END DIALOG] node.
Parameters:
string sAttacker = Tag of attacker whom
will attack the PC. Default is OWNER.
ga_attack_target(string
sAttacker, string sTarget)
This script makes the sAttacker attack the
sTarget. It should be placed on an [END DIALOG] node.
Parameters:
string sAttacker = Tag of attacker. Default is OWNER.
string sTarget = Tag of Target. Default is PC.
Create an object
sObjectType = The object type. Only the following are allowed:
"C" =
CREATURE
"P" =
PLACEABLE
"I" = ITEM
"W" =
WAYPOINT
"S" = STORE
Note that you must
specify the correct object type for the
object you wish to
create, or it will not work.
sTemplate = The name of the template of the
object.
sLocationTag = The tag of the waypoint at which to
create the object.
bUseAppearAnimation = Use the appear
animation. Default is false.
sNewTag = The tag to use for the object. If
blank, use default template tag.
fDelay = The delay, in seconds, before
creating the object.
This script makes objects appear dead
sTag = The tag(s) of the object(s) to make
dead. You can pass multiple
tags, seperated by commas
(NO SPACES) to destroy multiple objects
(ie.
"Object1,Object2,Object3")
NOTE: There may
eventually be a function to eat white space
(See Mantis 3296), but for
now do not put spaces in the string.
iInstance = The instance of the object(s) to make
dead. Pass -1 to make
all instances dead.
This script destroys objects
sTag = The tag(s) of the object(s) to
destroy. You can pass multiple
tags, seperated by commas
(NO SPACES) to destroy multiple objects
(ie. "Object1,Object2,Object3")
NOTE: There may
eventually be a function to eat white space
(See Mantis 3296), but
for now do not put spaces in the string.
iInstance = The instance of the object to destroy. Pass
-1 to destroy
all instances.
fDelay = The delay before destroying the
object(s)
This closes a door
sTag
= The tag of the door to close
nLock
= Set to 1 if you want to lock the door after it closes
This opens a door
sTag
= The tag of the door to open
Does an effect on the specified target. This function takes 5 params:
string sEffect - one of the below effects
string sParams - comma delimited list of needed params
string sDuration - I - Instant, P - Permanent, or
T,<duration> - Temporary w/ duration
ex:
temporary 30 seconds would be "T,30.0f"
int iVisualEffect - -1=no visual, 0 = standard visual,
or supply your own from
visualeffects.2da
string sTarget - Tag of who to effect or
"OWNER"= dialog owner, "PC" = indicates
PCSpeaker, "LAST" =
Last Speaker
Effects and Paramaters
Blindness - no
params
Damage -
nDamageAmount, nDamageType, nDamagePower
Death - no
params
Disease -
see DISEASE_* constants in nwscript.nss
Heal -
damage to heal
Paralyze - no
params
Raise - no
params
Visual -
see visualeffects.2da for param options
This script makes sTarget join a new
faction.
sTarget - The target who's faction will change (see Target's
note).
sTargetFaction - Either one of the 4 standard factions
$COMMONER, $DEFENDER, $HOSTILE,
$MERCHANT or a
target who's faction is to be joined (must be a creature)
This script makes sTarget be viewed
differently by a faction.
sTarget - The target who will be viewed differently (see
Target's note).
sTargetFaction - Either one of the 4 standard factions
$COMMONER, $DEFENDER, $HOSTILE,
$MERCHANT or a
target who belongs to the faction (may or may not need to be a creature)
sChange - the amount to change the faction reputation by. (May later be ammended to allow
setting).
ga_force_exit(string sCreature, string sWP, int bRun)
Moves creature with tag
sCreature to the waypoint with tag sWP.
This gives the player some gold
nGP
= The amount of gold coins given to the PC
nAllPCs = If set to 1 it gives gold to
all the PCs (MP only)
This gives the player an item
sItemRR = This is the string name of the item's
ResRef
nQuantity = The number of items (default is 1)
nAllPCs = If set to 1 it gives the item to all PCs
(MP only)
This
gives the player some experience
nXP
= The amount of experience given to the PC
nAllPCs = If set to 1 it gives XP to
all the PCs (MP only)
This script changes a global float variable's
value
Parameters:
string sVariable = Name of variable to change
string sChange = VALUE (EFFECT)
"5.1" (Set to 5.1)
"=-2.3" (Set to -2.3)
"+3.0" (Add 3.0)
"+" (Add 1.0)
"++" (Add 1.0)
"-4.9" (Subtract 4.9)
"-" (Subtract 1.0)
"--" (Subtract 1.0)
This script changes a global int variable's
value
Parameters:
string sVariable = Name of variable to change
string sChange = VALUE (EFFECT)
"5" (Set to 5)
"=-2" (Set to -2)
"+3" (Add 3)
"+" (Add 1)
"++" (Add 1)
"-4" (Subtract 4)
"-" (Subtract 1)
"--" (Subtract 1)
This script changes a local string
variable's value
sScript = This is the name of the variable being
changed
sChange = This is what the global string is set to.
This command heals the PC (and potentially
their party)
nHealPercent = This is the % damage the PC will be
healed, 0 = 100% by default
nFullParty = This is a boolean, by default it is
FALSE and only the PC will be healed, 1
is full party
Jump an object to a waypoint or another
object.
Parameters:
string sTo = Tag of waypoint or object
string sWho = Tag of object to jump. Default is
conversation owner (OBJECT_SELF)
float fDelay = Delay before
JumpToObject(). Default is 0.0f
Jumps the players to a waypoint or another
object.
This must be used in a conversation.
sDestTag = The tag of the waypoint or object.
bWholePary = Jump whole pary? default = 0
bOnlyThisArea = Jump only party members
in the same area? default = 1
Jumps an entire faction to the specified waypoint and arranges
them in a pattern
string sTagOfMember -
tag of any member of faction
string sTagOfWayPoint -
tag of a waypoint
int iFormation -
formation number to use
1 - Ben Ma's
pattern
more to come
int iSpacingPercentage -
% change to the spacing of the formation. Not implemented.
Notes: Might be a quick way to toss the party around, but
there's no error checking on the generated position
so you can easily jump creatures into bad places.
// BMA 4/27/05 Float assignment is
particularly flakey in nwscript.
// float f = 1.0; (f == 1.0) MAY or MAY NOT
evaluate to true. Be warned!
This script changes a local float variable's
value
Parameters:
string sVariable = Name of variable to change
string sChange = VALUE (EFFECT)
"5.1" (Set to 5.1)
"=-2.3" (Set to -2.3)
"+3.0" (Add 3.0)
"+" (Add 1.0)
"++" (Add 1.0)
"-4.9" (Subtract 4.9)
"-" (Subtract 1.0)
"--" (Subtract 1.0)
string sTarget = Target tag or identifier. If blank then use OBJECT_SELF
This script changes a local int variable's
value
Parameters:
string sVariable = Name of variable to change
string sChange = VALUE (EFFECT)
"5" (Set to 5)
"=-2" (Set to -2)
"+3" (Add 3)
"+" (Add 1)
"++" (Add 1)
"-4" (Subtract 4)
"-" (Subtract 1)
"--" (Subtract 1)
string sTarget = Target tag or identifier. If blank then use OBJECT_SELF
This script changes a Target's local string
variable's value.
Parameters:
string sVariable = The name of the variable.
string sValue = The new value for the variable.
string sTarget = The target's tag or identifier, if blank
use OWNER
This moves someone to a waypoint.
sWP = Lists the waypoint the object is
moving to. "wp_" is added automatically.
nRun = Defaults to walk, set to 1 for
running
sTagOverride = If this is null, then OWNER runs the
script. Otherwise the string is the
tag name of who will run it
This makes the object go to the exit
(default nwc_exit) and then vanish
nExitNumber = nwc_exit#N
nRun = TRUE if you want the character to
run there
sWaypoint = go to waypoint nwc_#S then
disappear
sObject = if you don't want the OWNER to
move, use the tag string here
This script removes a henchman from the
party.
Parameters:
string sTarget = Tag of the henchman to
remove. If blank, remove dialog OWNER.
If NPC is not a henchman
of the PC, do nothing.
ga_replace_comp(string sCompToRemove, string sCompToAdd)
replace companion with tag
sCompToRemove with companion with tag sCompToAdd
This adjusts the reputation of the calling
player
nActLevel = How noble or ignoble was the act from +4
(Idolized) to -4 (Vilified)
nRepOver = This overides the reputation to the given
value (DANGER!)
This opens a store
sTag = The tag of the store to open
nStore = This adjusts the price of things in the
store (-nStore = Good for PC)
nPCInv = This adjusts the price merchants will
pay for PC items (+nPCInv = Good for PC)
This takes gold from a player
nGold
= The amount of gold to take
nAllPCs = If set to 1 it takes gold from all PCs
(MP only)
This takes an item from a player
sItemTag = This is the string name of the item's tag
nQuantity = The number of items (default is 1). -1 is
all of the Player's items of that tag.
nAllPCs = If set to 1 it gives the item to all PCs
(MP only)
Set "TalkedTo" flag that you have
talked to the target.
Parameters:
string sTarget = Tag of the NPC. If blank,
use OBJECT_SELF.
Conditional scripts are used to cause a specific dialogue node (and its corresponding actions) from taking place only under specific situations. For example, you might want to let the player ask Pitney about his wife, but only after he has met her. Multiple conditional scripts can be applied to a dialogue node using “and” or “or” statements.
Check if player's alignment is Chaotic
Check if player's alignment is Evil
Check if player's alignment is Good
Check if player's alignment is Lawful
// BMA 4/18/05 note: implementation concerns
me
This checks if player's alignment is greater
than or equal to nCheck.
Parameters:
int nCheck = Checks if alignment of player is greater
than defines.
On a scale of 3 (Saintly)
to -3 (Fiendish)
int nLawGood = 0 means check Good/Evil
axis, 1 means check Law/Chaos axis
This script checks to see if the player
(PC_Speaker) has any levels of a certain class
nClass
= The integer of which class to check for (list boxes will be done
later)
This script checks to see if the player
(PC_Speaker) has any levels of a certain prestige class
nClass
= The integer of which class to check for (list boxes will be done
later)
This
script checks to see if the PC has more than a certain amount of gold
nGold
= The amount of gold you want to make sure the player has
nMP
= If in MP - set this to 1 if you want to make sure all players have
enough gold
This script checks to see if the PC has an
item in their inventory
sItem
= The tag name you want to check to see if the PC has
nMP
= If in MP - set this to 1 if you want to make sure all players have the
item
This script checks to see if the player
(PC_Speaker) has stats above a certain number
nStat
= The integer of which stat to check for (list boxes will be done later)
nVal
= The value the stat needs to equal or exceed
gc_comp_remove(string sCompanion)
returns TRUE if the companion with tag
sCompanion is in the party and can be removed at this point.
Returns true if the creature with tag sCreatureTag is dead.
nInstance = the nth instance of a creature with tag
sCreatureTag
Check to see if a given item is equipped by
a given creature
Parameters:
string sItem = The tag, or partial tag of the item.
string sTarget = The tag of the creature. If blank, use
PCSpeaker.
"$PARTY" is a
non-standard target constant that will check the entire party.
int bExactMatch = If 0, allow sItem to be
a tag substring.
Always returns false.
This script checks a global float
variable's value
sVariable = This is the name of the variable being
changed
sCheck = This is what you want to see what the
global float is set to.
Default is an = check, but you can also specify <,>,or !
So
an sCheck of "<50" returns TRUE if sVariable is less than 50,
an
sCheck of "9" or "=9" returns TRUE if sVariable is equal to
9
and an sCheck of "!0" returns TRUE if sVariable is not equal
to 0.
This script checks a global int variable's
value
sVariable = This is the name of the variable being
changed
sCheck = This is what you want to see what the
global int is set to.
Default is an = check, but you can also specify <,>,or !
So
an sCheck of "<50" returns TRUE if sVariable is less than 50,
an
sCheck of "9" or "=9" returns TRUE if sVariable is equal to
9
and an sCheck of "!0" returns TRUE if sVariable is not equal
to 0.
This script checks a global string
variable's value
sVariable = This is the name of the variable being
changed
sCheck = This is what you want to see what the
global string is set to
This script checks if an enemy creature is
within a given radius around
the object that called this script.
fRadius = The radius of the sphere to check within.
Default: 20.0
iSight
= Flag to check line of sight. Default: 0.
This checks to see if the PC Speaker is female,
returns TRUE if it's a girl
Check if target henchman is in the party.
Parameters:
string sTarget = Tag of the henchman to
check. If empty, use dialog OWNER.
This checks to see if the PC Speaker is
male, returns TRUE if it's a boy
This script checks if any of a certain
object is near a given radius around
the object that called this script.
sTag
= The tag (or part of a tag) of the object you are checking for.
(for example, if you specify
"guard" it will find
objects with "guard"
in the tag, including "guard1", "guard2"
and "blackguard".
sObjTypes = Filter which types of
objects to look for. any combination of
these can be mixed and
matched. Default is "CPI".
It's best to limit this to the
specific types of objects to be checked.
C = creature
I = item
T = trigger
D = door
A = area of effect
W = waypoint
P = placeable
S = store
E = encounter
ALL = everything
fRadius = The radius of the sphere to
check within. Default: 20.0
bLineOfSight = Flag to check line of
sight. Default: 0.
This script checks if the owner of the
dialogue is the given tag
sTag = This is the tag of the object you are
checking for
Compares the number of items with tag
"sItemTag" the speaker possesses to condition "sCheck".
Parameters:
string sItemTag = Tag of the item to sum
string sCheck = Condition and value to check, for
example:
"<5" Less than
5
">1" Greater
than 1
"=9" Equal to 9
"!0" Not equal to
0
int bPCOnly = If equal to 0 then check party's
inventory, else check PC inventory only
Supercedes gc_check_quest (string sItem,
int nMP)
This script compares the state of specified
journal quest to a check value.
sQuestTag - tag of the quest to examine on the PC
sCheck -
conditional to check against. This param
works the same as it does in gc_local_int.
// BMA 4/27/05 Float assignment is particularly
flakey in nwscript.
// float f = 1.0; (f == 1.0) MAY or MAY NOT
evaluate to true. Be warned!
This script checks a local float variable's
value.
Parameters:
string sVariable = This is the name of the
variable.
string sCheck = This is the operation to compare local
float to.
e.g. If sCheck =
"<10.0" then return TRUE if sVariable < 10.0
If sCheck =
"9.0" or "=9.0" then return TRUE OR FALSE if sVariable
equals 9.0.
We cannot guarentee float accuracy,
so == comparisons will generally fail.
string sTarget = Identifier or tag of the Target. If blank
then use OWNER.
This script checks a local int variable's
value.
Parameters:
string sVariable = The name of the variable
string sCheck = The operation to check on the value of
the variable.
Default is ==, but you
can also specify <, >, or !
e.g. sCheck of
"<50" returns TRUE if sVariable's value is <50
a sCheck of
"9" or "=9" returns TRUE if sVariable's value is equal to 9
and a sCheck of
"!0" returns TRUE if sVariable's value is not equal to 0.
string sTarget = Tag or identifier of Target. If blank
then use dialog OWNER.
This script checks a local string variable's
value.
Parameters:
string sVariable = This is the name of the variable checked.
string sCheck = This is the string to compare equality
against.
string sTarget = This is the tag or identifier of the
Target. If blank then use OWNER
gc_max_companion()
Returns TRUE if the party has
the maximum possible number of companions.
Used on nodes of a dialog to specify its index.
iNodeIndex -
This Node's index (for use w/ gtr_speak_node)
Determines if object is valid (e.g. exists,
!= OBJECT_INVALID)
Parameters:
string sTag = The tag of the object to search for.
int bAreaOnly = Set to "0" to
only search area; any other value to search entire module.
Used to randomly pick a dialog response.
Use parameters 2 through X for each entry
after the first, decrementing by 1 for each branch down.
Example:
3 entries would have the following conditionals:
gc_rand_1of(3)
gc_rand_1of(2)
The final entry doesn't need a check since
it is a certainty.
This checks the reputation of the speaking
player
nRepLevel = Checks how noble the player's rep is from
+4 (Idolized) to -4 (Vilified)
nRepNumber = See if it is over a specific number value
(overrides previous int)
Determine if PC Speaker's skill roll is successful.
Parameters:
int nSkill =
skill int to check
int nDC =
difficulty class to beat
Determine if PC Speaker has sufficient rank in a particular
skill.
Parameters:
int nSkill =
skill int to check
int nRank = minimum
rank to return TRUE
This checks to see if you have not talked to
this person before. See ga_talkto.nss.
Parameters:
string sTarget = Target of the NPC. If
blank, use dialog OWNER.
gc_true()
Returns TRUE
The changes and new scripts described below are not exhaustive, but are some of the updates made to the NWN1 scripting library.
There is a new parameter to ActionRest() called bIgnoreNoRest. It’s false by default, which will make the function work like it always had before. If you change it to TRUE, then the ActionRest() script command will ignore the Area-Specific No Rest flag. It will not ignore other conditions, like trying to rest in combat, etc. But the No Resting flag in the area will be ignored.
It will post a string at the indicated x and y pixel
location and keep it there for the duration given as a parameter.
The debug text will get sent from the server to the client
and the client then needs to display it. As a result, the string will
technically not show up until after the script has finished executing. So if
you are using the Script Debugger, you may hit a DebugPostString() function but
not see the string appear on your screen until the script has finished.
DebugPostString() can be enabled/disabled with nwn.ini setting:
[Game Options]
Debug Text=0/1
FadeToBlack now has an optional 3rd parameter that indicates how long the fadeout should remain in effect before fading back in no matter what.
void ActionStartConversation(
object oObjectToConverseWith,
string sDialogResRef="",
int bPrivateConversation=FALSE,
int bPlayHello=TRUE,
int bIgnoreStartDistance=FALSE,
int bDisableCutsceneBars=FALSE
);
new parameters:
bIgnoreStartDistance – Ignore maximum distance check for starting a conversation
bDisableCutsceneBars – Cinematic conversation presentation without letterbox black bars (assuming conversation file is initially flagged as a “cutscene”)
void
TriggerEncounter(object oEncounter, object oPlayer, int iCRFlag, float fCR)
This script commands allows the triggering of an encounter instance on a player (or other creature).
//These
are allowed values for the iCRFlag parameter of the TriggerEncounter() function
//These are enumerated types in CNWSEncounter
int ENCOUNTER_CALC_FROM_CR = 0; // Use the CR value
passed in determining the spawn pool
Returns TRUE if this is a single player only game, otherwise returns FALSE.
DisplyGuiScreen(
oPlayer, sScreenName, bModal)
sScreenName has to match the ‘field name’ in ingamegui.ini located in ui\default\ingamegui.ini
Only GUI screens listed under [ScriptGUIs] will be accessible to script.
Currently, the party selection script is in the ingamegui.ini, so you can do:
DisplayGuiScreen(
GetPCSpeaker(), "SCRIPT_SCREEN_PARTYSELECT", TRUE );
to force the PartySelectionScreen to pop up. Making it Modal will mean that the user needs to respond to the screen and close it before doing anything else.
New bonus hit points effect and item property.
"Bonus Hitpoints" effect added to the game, which can be used as either a spell effect, or as an item property. These add hitpoints to the creature's normal hitpoint pool, and are "permanent", for as long as the effect is active on the creature. This means that they can be healed by resting, spells, etc., unlike temporary hitpoints. You can stack multiple versions of this effect on a single creature. They do not change your current hitpoints when added or removed, so if you equip an item that gives you bonus hitpoints, you will need to rest to "top off".
itemproperty
ItemPropertyBonusHitpoints(int nBonusType);
effect
EffectBonusHitpoints( int nHitpoints );
void
SpawnSpellProjectile( object oSource, object oTaget, location lSource, location
lTarget, int nSpellID, int nProjectilePathType );
void
SpawnItemProjectile( object oSource, object oTaget, location lSource, location
lTarget, int nBaseItemID, int nProjectilePathType, int nAttackType, int
nDamageTypeFlag );
These commands allow you to spawn a projectile, which will travel from the source to the target. They use the same logic that standard spell or item projectiles use, which is primarily 2DA driven. Some notes:
· For spell projectiles, the trail and impact effects are defined in the Spells.2DA. You can specify a custom projectile path, or use the one that that is defined in the 2DA
· For item projectiles, you need to supply the Base Item Type of the "projectile launcher", such as longbow, crossbow, etc. This will then determine the ammo type. These are all defined in BaseItems.2DA and AmmunitionTypes.2DA. The attack type determines if the attack will hit the target(HIT), the ground near the target (MISS), or the target's shield (PARRIED). The damage type flag will determine if the projectile is on fire or whatever. We haven't hooked up the VFX for these yet, however.
· These are mostly in so that Brian Heins can get jiggy with some of the trickier spells, but I thought they might be generally useful. Not all of the NWN1 projectile path types may work correctly, and I'll fix up which ever ones we need for NWN2, and then remove the others. They are defined at the top of nwscript.nss, at PROJECTILE_PATH_TYPE_WHATEVER.
void
SetFirstName(object oTarget, string sFirstName);
void
SetLastName(object oTarget, string sLastName);
void
SetDescription(object oTarget, string sDescription);
string
GetFirstName(object oTarget);
string
GetLastName(object oTarget);
string
GetDescription(object oTarget);
These names are pretty self-explanatory. Basically, you can
now set the name of any valid object. *HOWEVER* only objects that
previously had visible names (ie. Creatures, Items and non-static placeables)
will have names that are visible in the game. Similarly, objects that only have
one name (like items and placeables) will only display the “first name.” You
can certainly use the last name (or description or whatever) in a script if you
like.
What can this do?
· Play any animation that exists for a model without worrying about the lists.
· Automatically fills in skeleton information, so the script doesn’t have to change when appearance does.
· Optionally fills in stance information (use the ‘*’ prefix) in case you ever want to force certain stances.
· This has no effect on the actual stance / state of the creature – it’s just a visual appearance.
· Weapons are automatically visually hidden with the ‘dialog’ priority. ( You don’t have to hide them per animation now. )
· Using another script command you can force the visual appearance of weapons until you call script to toggle them back off.
· These custom animations automatically take preference over talk_normal ( dialog default ), but obey walk/action precedence.
· Play emotions in game ( using the '#' prefix ): #off, #annoyed, #angry, #surprized, #amused, #frown, #smile, #scared, etc
· Disable custom playback control ( using the '%' prefix )
· Speed setting allows you to control speed of playback: 1.0 is normal, < 1 is slower, > 1 is faster; negative values are backwards.
PlayCustomAnimation(object ObjectId, string AnimName, int Looping, float fSpeed);
Some examples:
object
obj = GetIdByTag(“n_kana”);
//
Play sitidle animation on n_kana in a loop – in this case it will play the file
P_HHF_siteat.gr2
PlayCustomAnimation(obj,
“sitidle”, 1);
//
Play sitdrink animation on n_kana just once, then you’ll resume the sitidle
loop
PlayCustomAnimation(obj,
“sitdrink”, 0);
//
Play idlem on n_kana in a loop, and force her to idle with C2h stance
PlayCustomAnimation(obj,
“C2h_idlem”, 1);
//
Play combat idle on n_kana in a loop, this adjusts for whatever weapons she has
equipped
PlayCustomAnimation(obj,
“*idlem”, 1);
//
Play 1attack01 on n_kana once, this adjusts for whatever weapons she has
equipped
PlayCustomAnimation(obj,
“*1attack01”, 0);
//
You may need to add timing here for duration of this attack
//
Play unequip on n_kana once, this adjusts for whatever weapons she has equipped
PlayCustomAnimation(obj,
“*unequipw”, 0);
NOTE: Custom animation takes priority over TALK_NORMAL and IDLE animations by design. The '%' command just lets you preempt custom animations with IDLE. This is really just to allow 'built in' ambient life animations to restart on scripted characters once a scripter is done doing their custom animations.
int
SetWeaponVisibility( object oObject, int nVisibile, int nType=0 );
// Returns TRUE if it found an object to set weapon visibility on
// oObject is the object to set weapon visibility on
// nVisibile 0 for invisible, 1 for visible, and 4 to 'set to default engine
action'
// nType is the 'mode' for hiding: 0 - weapon, 1 - helm, 2 – both
SetWeaponVisibility allows scripting to force (un)equipping of weapons at
anytime ( visually ). This means it makes the weapon(s) [not]
appear, but it's still equipped for gameplay purposes. This works both
inside and outside of dialogs/cutscenes.
Calls up a string input box, with text description field and script callback for the results
Usage:
//This
script function displays a text input box popup on the client of the
//player
passed in as the first parameter.
//////
//
oPC - The player
object of the player to show this message box to
//
nMessageStrRef- The STRREF for the Message Box message.
//
sMessage - The text to display in the message box.
Overrides anything
//
- indicated by the nMessageStrRef
//
sOkCB - The callback script to
call if the user clicks OK, defaults
//
- to none. The script name MUST start with 'gui'
//
sCancelCB - The callback script to call if the user
clicks Cancel, defaults
//
- to none. The script name MUST start with 'gui'
//
bShowCancel - If TRUE, Cancel Button will appear on the message
box.
//
sScreenName - The GUI SCREEN NAME to use in place of the default
message box.
//
- The default is SCREEN_STRINGINPUT_MESSAGEBOX
//
nOkStrRef - The STRREF to display in the OK button,
defaults to OK
//
sOkString - The string to show in the OK button.
Overrides anything that
//
- nOkStrRef indicates if it is not an empty string
//
nCancelStrRef - The STRREF to dispaly in the Cancel button, defaults to Cancel.
//
sCancelString - The string to display in the Cancel button. Overrides anything
//
- that nCancelStrRef indicates if it is anything besides empty string
//
sDefaultString- The text that gets copied into the input area,
//
- used as a default answer
//
sVariableString- Doesn’t do anything right now
void
DisplayInputBox( object oPC, int nMessageStrRef,
string sMessage, string sOkCB="",
string sCancelCB="", int bShowCancel=FALSE,
string sScreenName="",
int nOkStrRef=0, string sOkString="",
int nCancelStrRef=0, string sCancelString="",
string sDefaultString="", string sVariableString="" );
Example
script and callback, where “gui_input_ok” is the callback script activated when
the user presses “OKAY”:
<script
input_test>
void
main()
{
DisplayInputBox( OBJECT_SELF, 0, "Test Message",
"gui_input_ok", "", 1,
"SCREEN_STRINGINPUT_MESSAGEBOX", 0, "OKAY", 0,
"CANCEL", "DefaultSTR", "VariableSTring" );
}
<script
gui_input_ok>
void
main( string sInput )
{
ActionSpeakString( sInput );
}
“Associates” (henchmen, familiars, & etc.) don’t get XP. If you award XP to a PC, all roster members get XP, too. In multiplayer, this only happens to the first PC in the party list; roster members don’t all get XP if you award XP to other PCs. This keeps rosters members from getting multiple XP awards if you’re walking through the PC list granting XP awards. XP is then modified by multiclass penalties and any percentage XP modifier set by the designers. Finally, XP is capped at the campaign XP amount.
The color param for DebugPostString() is: first byte is
alpha (level of transparency) (untested); the 3 right bytes control RGB values
Most other color params will likely be similar.
const int COLOR_RED = 4294901760; //
FFFF0000
const int COLOR_GREEN = 4278255360; // FF00FF00
const int COLOR_BLUE = 4278190335; // FF0000FF
· Make sure you have the .NET Framework version 1.1 installed. It's available at http://msdn.microsoft.com/netframework/downloads/framework1_1/
· Make sure you have DirectX 9.0c installed. (http://www.microsoft.com/downloads/details.aspx?FamilyId=2DA43D38-DB71-4C1B-BC6A-9B6652CD92A3&displaylang=en)
Control-middle-click rotates the camera. The mousewheel moves the camera forward and backwards.
Make sure that you're in "select objects" mode. Pick the objects you want to move, and then left-drag selected objects to move them around. To rotate them, you can press shift-right-click. Alt-right-click moves the selection up or down.
Yes and no. Unfortunately, because of the many technological improvements made to the NWN2, we were unable to support NWN1 areas themselves.
However, it was a priority of ours to support the NWN1 mod efforts as much as possible and we thus made the toolset backwards compatible in many ways. You can open up a NWN1 module with the NWN2 toolset. All of your conversations and scripts will be available. You can then use the NWN2 toolset to export this work and then import it into your new NWN2 creation.
Note that more recent NWN1 scripts that have been released will not be in the NWN2 toolset. You will need to import these scripts if your module makes use of them. On the other hand, the NWN2 toolset comes with many new scripts that you’ll be able to use.
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.
Under View à Options, you will find autosave settings.
The 2da files can be found in source safe in NWN2\Data\Resources\Override\2DA\
The 2da files in the located in \Data\2da.zip
You can place a 2da in the override directory
Builds\Game\Override\
(You may have to create the "Override" directory in certain builds)
This will override the corresponding 2da in the zip file when playing the
game.
2da stands for "2 dimensional array". 2da files can be edited
in any text editor. They are "whitespace" delimited, not comma
delimited, so care should be taken when attempting to edit w/ Excel.
For specific technical information on the file format of 2da files, see the official documentation located here: http://nwn.bioware.com/developers/Bioware_Aurora_2DA_Format.doc
(Information on all NWN file formats available here: http://nwn.bioware.com/developers/ )
· Holding down ALT while moving them will raise/lower them.
· Shift-right-drag will spin/yaw them (same as all other objects).
· Holding down ALT+SHIFT and right-dragging will pitch the camera up and down.
· Holding down CTRL+SHIFT and right-dragging will roll the camera.
Set a local string variable called “DeathScript” on the creature whose death you want to cause a script to fire. (The standard on death script has been modified to help accommodate this.) When the creature dies, this script will be called from that creature’s normal OnDeath script. So say you want a trigger to spawn in 2 baddies that will run to the player, and will have a script “12_b_gith_inn_de” that executes when they die. You could do the following in the trigger’s OnEnter script:
#include
"ginc_actions"
void main()
{
object oPC =
GetEnteringObject();
object oCrit1 = SpawnCreatureAtWP(RR_CRITTER1,
"wp_critter1");
object oCrit2 =
SpawnCreatureAtWP(RR_ CRITTER2, "wp_critter2");
// Set a script
to run on oCrit1’s death
AssignCommand(oCrit1,
SetLocalString(OBJECT_SELF, "DeathScript",
"12_b_gith_inn_de"));
//Set a script tp
run on oCrit2’s death
AssignCommand(oCrit2,
SetLocalString(OBJECT_SELF, "DeathScript",
"12_b_gith_inn_de"))
AssignCommand(oCrit1,
ActionMoveToObject(oPC, TRUE, 7.0));
AssignCommand(oCrit2,
ActionMoveToObject(oPC, TRUE, 7.0));
}
You do not need to modify these creatures’ standard OnDeath scripts in order to get this script to work.
Typically, you will want the death script to run when a group of creatures is killed. The way to do this is keep track of the number of creatures killed. If that number equals the number of creatures in the group, then you execute your special “group is dead” code.
const int
NUM_TO_KILL = 5; //the group has 5
critters
void main()
{
//this is a
death script! So nCrittersKilled should
be increased by 1 since //someone was
just killed.
int nNumKilled =
GetGlobalInt(“nCrittersKilled”) + 1;
SetGlobalInt(“nCrittersKilled,
nNumKilled);
//If all the creatures have been
killed
if (nNumKilled
== NUM_TO_KILL)
{
// Stuff to do
once the whole group is dead
}
}
So in the above example, you would have set each critter in the group’s DeathScript variable to each run the above script on death. The 5th time that script is triggered, whatever code you have within that ‘if’ statement will be executed – all 5 critters are dead.
Note: If you need to get the PC in the death script, the best way in this situation is:
object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC);
There are functions in ginc_misc that make this a little easier. What you want to do is put your conditions at the top that will exit out of the trigger. At the bottom, be sure to mark your trigger as having completed. The following code can be used as a template:
#include
"ginc_misc"
void main()
{
object objPC =
GetEnteringObject();
// check
conditions
//If we’ve done this before, exit the
script early.
if
(IsMarkedAsDone())
return;
//if the entering object isn’t a PC, exit
the script early.
if (!GetIsPC(objPC))
return;
//
// put trigger
code here
//
MarkAsDone();
}
Alternately, you can use this:
#include "ginc_misc"
void main()
{
If (PCTriggeredOnce())
Return;
//
// put trigger
code here
//
}
At this point in time we don’t have a GUI for this, and so it has to be done within a conversation. You’ll need to use three main global scripts:
gc_max_companion() is a conditional that you would apply to a node to see whether the party has already reached the maximum number of companions, and hence would require forcing a companion out of the party in order to force in a different companion.
ga_replace_comp(string sCompToRemove, string sCompToAdd) is an action that will replace the companion with tag sCompToRemove with the companion with that sCompToAdd. Don’t forget that CNPC tags are all lowercase now.
gc_comp_remove(string sCompanion) checks whether it’s okay to remove the companion with tag sCompanion from the party. If they’re not in the party, or if they have an integer variable on them “bForced” set to TRUE, then this function will return FALSE – the player shouldn’t have the option to remove them.
As long as you want the character to be forced into the party, they should have a local int on them “bForced” set to TRUE. Once they’re no longer required, reset it to FALSE.
So, as an example, say that the maximal number of companions was 2, and that the PC already has Neeshka and Grobnar in his party, but Khelgar needs to be forced in because the PC has just entered an area that’s important for Khelgar’s development. You’d just make sure that a conversation initiates upon entering that area with Khelgar, and you need the end of that conversation to work like this:
(khelgar) “Blah blah I’m joining your party and you have to deal with it because I’m a racially stereotypical stubborn dwarf.”
->if AND gc_max_companion()
AND gc_comp_remove(neeshka) “[Remove Neeshka from the party]”
->ga_replace_comp(neeshka, khelgar)
->if AND gc_max_companion()
AND gc_comp_remove(grobnar) “[Remove Grobnar from the party]”
->ga_replace_comp(grobnar,
khelgar)
->else “[END DIALOGUE]” ga_add_companion(khelgar)
(The ‘if’ and ‘else’ above are just there to denote how the conditional should flow.)
As a shortcut, you may want to have a blue node with no text that checks gc_max_companion, and then blue nodes beneath that that node check gc_comp_remove for each companion – since you’ve guaranteed that each of those nodes has passed the gc_max_companion check, you don’t have to make that check again at every node.
You may also need another action to get rid of the removed CNPC and send them to the Sunken Flagon or wherever. ga_force_exit() comes to mind. That was left out of ga_replace_comp() to allow for special cases where you wouldn’t want removed players to exit.
Make sure your spawn script has the following:
if (GetIsEncounterCreature())
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS,
TRUE);
The group on death scripts utilizes nw_c2_default7's alternate death script execution. (e.g. if an alternate "DeathScript" is specified, execute it.)
Set up the death script execution for the group, like so:
GroupSetLocalString (sGroupName, "DeathScript", "<your script name here>");
The script naming convention is:
"<mod_num>_g_death_<something>" to indicate it is a group
death script
For example:
35_g_death_trig_enc
Now, as each member of your group dies, it will call the specified script.
Next, create the group death script. Use the template "gg_death_XXX" in the scripttemplates directory in source safe. It will look something like this:
#include "ginc_group"
void main()
{
// Get group this creature belongs to
string sGroupName = GetLocalString(OBJECT_SELF,
OBJ_GROUP_MY_GROUP);
// Add code here to run when any creature in the group is
killed
// If no one in the group is alive nor valid
if (GetIsGroupValid(sGroupName, TRUE) == FALSE)
{
// Add code here to run when entire group
has been killed
}
}
Simply add your code in the if statement above.
It should be read the same as in the faction editor from the original toolset. Each row represents a faction's feelings about the other faction. In other words, faction ROW's rating of faction COLUMN is located in [ROW, COLUMN]. In the example below, CellarDwellers are hostile to Police (rating 10), but Police rate CellarDwellers as neutral (40).
# |
CellarDwellers |
Police |
CellarDwellers |
50 |
10 |
Police |
40 |
50 |
The two circles represent the visual mouse brush interface for
terrain modification. The two circles will follow the contours of the terrain
when you are in Paint Terrain
Mode. The
Value controls the strength of the brush. The meaning of the value control might change depending on what elevation control you are using. For example, valid values for raising and lowering terrain are in between 0 and 1.0, but values for terrain flattening can of any range.
· R - Raise - raises the terrain by the value amount.
· L - Lower - lowers the terrain by the value amount.
· F - Flatten - flattens out the terrain to the value amount.
· S - Smooth - smooths out the terrain (works best with values in the .1-.4 range).
· N - Noise - makes the terrain bumpy/rock like. (works best with values in the .8-1.0 range).
· FU - Flatten Under Selected - flattens out the terrain below the selected object. Good for making ground under buildings flat.
It should be located under the Plugins menu in the toolset, titled VFX Editor.
Visual effects are composed of effect files, which are individual components of an effect (a particle system, a trail, a billboard, etc.), and SEF files, which point to the effect files and organize them into a more complex visual effect.
First, create the individual effects. Under File->New, you will see the different effect types. Select one and then, in the editor that opens, modify its properties until you achieve the results you desire. Then, create a new SEF file, and press the Add Event button on the toolbar to select a type of event to add. The event will appear in the tree list in the upper-left corner of the window. By selecting the event, you can then change the DefinitionFile property, which determines the individual effect file that the event references. Select the effect you created earlier, and then press Play on the toolbar to see your visual effect in action.
Make sure to save your work when you are done.