Professional Documents
Culture Documents
Version 1.01
Table Of Contents
The World Map System ............................................................................................... 1
Overview .................................................................................................................... 1
The World Map System Components ............................................................................... 1
Assumed Knowledge..................................................................................................... 1
Building ...................................................................................................................... 2
Overview .................................................................................................................... 2
Create A Campaign ...................................................................................................... 2
Collate The World Map Assets ........................................................................................ 3
Create The World Map .................................................................................................. 5
Add Map Points ............................................................................................................ 6
Add World Map Transitions ............................................................................................ 7
Test Your World Map .................................................................................................... 7
Building Tutorial ......................................................................................................... 8
Overview .................................................................................................................... 8
Scenario ..................................................................................................................... 8
Requirements .............................................................................................................. 8
Create A Campaign ...................................................................................................... 8
Collate The World Map Assets ........................................................................................ 9
Create The World Map ................................................................................................ 10
Add Map Points .......................................................................................................... 11
Add World Map Transitions .......................................................................................... 13
Add Map Point Switches .............................................................................................. 14
Appendix 1: Troubleshooting.................................................................................... 15
Campaign Issues........................................................................................................ 15
World Map Issues....................................................................................................... 15
Appendix 2: World Map Editor .................................................................................. 17
World Map Editor ....................................................................................................... 17
World Map Properties.................................................................................................. 17
Map point Properties................................................................................................... 18
Appendix 3: Starter Script Set .................................................................................. 19
Map Point Scripts ....................................................................................................... 19
World Map Transition Trigger Scripts............................................................................. 21
TOC
The World Map Transition Trigger is a new blueprint. It is similar to the new Area Transition
Trigger in game but is intended to present the players with the World Map GUI rather than
transporting them directly. You can find it in the Blueprints | Triggers | Empty category.
The World Map GUI
The World Map GUI displays the World Map in game and allows the player to select one of the
available destinations. The World Map is normally displayed whenever a player enters a World
Map Transition Trigger or if they select the World Map option from the Player Menu.
Assumed Knowledge
This guide assumes that you have a basic understanding appropriate for each section but does
not assume any knowledge specific to the World Map System. For example, in the Building
section it is assumed you know how to open the toolset and create a new module but it does
not assume you know how to open the World Map Editor and create a new World Map.
Page 1
Building
Overview
A number of steps are required to integrate a fully functional World Map into your module.
Taking these steps in the following order will avoid many workflow issues:
Create A Campaign
Collate The World Map Assets
Create The World Map
Add Map Points
Add World Map Transitions
All of these topics will be touched on in this section and in the Building Tutorial section.
However, since these are intended as an introduction, some subjects such as scripting and
custom content will only be covered in detail in subsequent sections.
Create A Campaign
A campaign is a new concept for NWN2. When resources, such as blueprints or scripts, are
added to a campaign they become available in each module associated with that campaign.
Since the World Map is a campaign resource you must create a campaign for it to reside in.
Even if you only want to use the World Map in a single, stand-alone module you must still
create a campaign.
1. Select the Plugins | Campaign Editor menu option from the Toolset's menu bar.
2. Click the Add Campaign button on the Campaign Editor's toolbar.
3. Select the New Campaign node from the
Campaign Editor's campaigns list.
4. Configure the following properties in the
Campaign's Properties grid:
a. Description: Enter the text to be
displayed in game when the
campaign's button on the Select
Campaign screen is used.
b. DisplayName: Enter the name to be
displayed in game on the campaign's
button on the Select Campaign
screen.
c. Name: Enter the name to be
displayed in the Campaign Editor's
campaigns list. This is also the name
of the subfolder that is created in
[My Documents NWN2]\Campaigns\.
d. StartingModule: Enter the file name, including or excluding the .mod extension, of
the first module in the campaign.
Page 2
5. Click the Set Module to Use Selected Campaign button on the Campaign Editor's
toolbar (a message will be displayed but since you haven't added any resources to the
campaign yet so you can ignore at this time).
WARNING: if you forget to use the Set Module to Use Selected Campaign button the
module will be unable to access to any campaign resources including the World Map. If you
open a World Map in these circumstances its images will not be displayed.
6. Click the Save Campaign button on the Campaign Editor's toolbar (a message will be
displayed to confirm it has been saved) and close the Campaign Editor.
7. Select the File | Save menu option from the Toolset's menu bar or press Ctrl+S to save
the module.
8. Close and reopen the module before proceeding further.
You can use a modified subset of the above steps whenever we want to associate an additional
module with this campaign:
1. Select Plugins | Campaign Editor from the Toolset's menu bar.
2. Select the appropriate campaign node from the Campaign Editor's campaigns list.
3. Click the Set Module to Use Selected Campaign button on the Campaign Editor's
toolbar.
4. Click the Save Campaign button on the Campaign Editor's toolbar and close the Campaign
Editor.
5. Save your module.
There are other elements of the World Map that can be customised however these are covered
in the Custom Content section.
The World Map Image
The World Map Image is the map element that is displayed to the player. It represents the
geographical location in which your module resides: it could be a map of the world, the
continent, a region or a city: anything!
The default World Map GUI was designed for a World Map Image that measures 647x647
(pixels) and using images with these dimensions will give the best results. Images with
different dimensions will usually work however they may look odd against the blacked out
section of default World Map Background Image. Information on changing the World Map
Background Image is contained in the Custom Content section.
WARNING: An oversized image may interfere with one or more of the other elements in the
World Map GUI thus preventing it from functioning.
Sunjammer's World Map Guide
Page 3
The World Map Image must be a Targa (TGA) or DirectDraw Surface (DDS) image. If you are
unfamiliar with these image formats there are a couple of things to bear in mind:
32-bit TGA images have an alpha layer which must be completely or predominantly
white in order for the image to be visible in the World Map GUI. If alpha layer is
completely black the image will appear in the World Map Editor but will not in game.
The height and width of DDS images must both be a power of two (though they don't
have to be equal). The maximum size for a DDS World Map Images is therefore
512x512 which is smaller that the 647x647 expected by the default World Map GUI.
If your campaign is set around Neverwinter or along the Sword Coast; or if you are simply
experimenting then you can reuse the World Map Image from the OC. The world_map.tga
image can be found in the [Program Files NWN2]\Campaigns\Neverwinter Nights 2
Campaign\ folder. Conversely if your campaign is located elsewhere then in all likelihood you
are going to have to find or create a World Map Image of your own.
Once sourced, copy your World Map Image into your newly created campaign directory, for
example, [My Documents NWN2]\Campaigns\World Map Demo Campaign\.
Map Point Images
A Map Point is an interactive element on the World Map used to indicate a possible destination.
A player can select a Map Point to indicate their desired destination and will be transported to
that location when they click on the Travel button.
Each Map Point can have up to three images associated with it: a different image can be used
for each of a Map Point's three states. In this respect Map Points are very similar to buttons
on a website which have a default state, a rollover state (when you roll or hover over it with
the mouse cursor) and a selected state (when you click on it).
A Map Point Image can be any size (within reason) but must be a TGA or DDS image.
Again the OC can be a useful source of suitable images. There are a number of small TGA
images prefixed with m_ in the [Program Files NWN2]\Campaigns\Neverwinter Nights 2
Campaign\ directory. There should be three variations of each image, one for each state,
suffixed _normal, _hover and _pressed respectively.
Sounds
Each Map Point may have sound (WAV) file associated with it. The sound is played when a
player clicks on the Map Point's icon. All global sound files are contained in the Sounds.zip
archive in the [Program Files NWN2]\Data\ folder. You can also use any custom sound files
copied into the campaign directory.
TIP: the Map Point's Sound property is a currently (v1.04) just plain text field however you
can use another object to preview all available sounds: open the Blueprints panel; create a
new Sounds blueprint and select its Sounds property in the Properties grid. Click on the
ellipsis button that appears to display a Collection form; click on the form's Add button to
create a Sound entry; select the Sound entry; click on its Sound property and finally click on
the dropdown button that appears. You can now use the displayed selector/preview control
to chose and play available sounds.
Scripts
While World Map system uses script extensively, initially you need only be concerned with
identifying, acquiring or creating the following:
Sunjammer's World Map Guide
Page 4
Map Point Conditional scripts to determine if a given Map Point should be visible
when the World Map is displayed to a given player.
COMMENT: Each Map Point's conditional script is evaluated every time the World Map GUI is
displayed. Like a conversation's node if the conditional script equates to TRUE if the Map Point
will be shown otherwise it will be hidden.
Map Point Action scripts to transport the player and/or the party to the location
represented by the Map Point.
COMMENT: a Map Point's action script is executed if the Map Point is selected when a player
clicks the Travel button (unless it represents the player's current location).
A Conversation Action script to reveal Map Point for a hitherto hidden location.
A World Map Transition Trigger OnClick script to show the World Map GUI.
There are a number of global scripts and a greater number of OC campaign scripts. These
resources are reviewed in the Scripting section however the latter are not particularly suitable
for use outwith the OC. Consequently a set of simple scripts has been provided for use with
this guide. You can either copy the script from Appendix 3: A Simple Script Set or copy the
.nss files, from the resource pack that accompanies this guide, into the campaign folder.
Page 5
Name: Enter a unique name for the Map Point that can serve as its Tag for
scripting purposes.
g. Sound: Enter the name of the WAV file you wish to play when the player clicks on
the Map Point.
6. Repeat steps 1 to 5 for each additional Map Point.
7. Save the World Map again.
8. Close the World Map Editor.
Sunjammer's World Map Guide
Page 6
Entering each World Map Transition Trigger causes the World Map GUI to appear and
the appropriate Map Point is selected if an origin was specified.
The World Map Image and all Map Point Images are correctly displayed.
Selecting a Map Point and clicking the Travel button transports the player/party to the
correct location for each Map Point.
There is always at least one potential destination in addition to the origin (if it has been
specified) whenever the World Map is opened.
TIP: If you run into problems testing your World Map refer to the World Map Issues section
in Appendix 1: Troubleshooting section.
Page 7
Building Tutorial
Overview
The purpose of this section is to provide a fun but nonetheless practical example of the steps
outlined in the Building section and to demonstrate some of the variations you may encounter
when creating a World Map for real.
Scenario
Our hero, a resident of Rotten Borough, learns of (yet another) threat to the little village of
Imminent Danger. It transpires that not far from the hamlet the lair of a ravenous beast can
be found. Because of its wicked nature this vile creature has been named Iniquity. Thus the
challenges before our hero are to travel to Imminent Danger, ascertain the location of The
Den Of Iniquity and kill the beast. Once his foe is vanquished our hero can return victorious
to Imminent Danger to collect his reward and thence to Rotten Borough in time for tea.
Requirements
There are many ways in which we could implement this quest however this is a World Map
tutorial so naturally the World Map System is going to be central to our solution.
Using the workflow from the previous section our "to do" list might end up something like this:
Create a Campaign
Collate The World Map Assets
Create The World Map
Add Map Points
Add World Map Transitions
Add Map Point Switches
Create A Campaign
Although not strictly necessary, to ensure we have experience with both inter-area and intermodule transitions, we are going to create a campaign consisting of two modules. The first
module will contain one area (Rotten Borough) and the second will consist of two areas
(Imminent Danger and The Den Of Iniquity).
1. Select the Plugins | Campaign Editor menu option from the Toolset's menu bar.
2. Click the Add Campaign button on the Campaign Editor's toolbar.
3. Select the New Campaign node from the Campaign Editor's campaigns list.
4. Configure the following properties in the Campaign's Properties grid:
Appearance
Description
DisplayName
Name
Behaviour
StartingModule
Page 8
5. Click the Set Module to Use Selected Campaign button on the Campaign Editor's.
6. Click the Save Campaign button on the Campaign Editor's toolbar.
7. Close the Campaign Editor.
8. Save the module as World Map Demo 002.mod.
9. Select the File | New | Module menu option from the Toolset's menu bar.
10. Repeat steps 1, 5, 6 and 7.
11. Save the module as World Map Demo 001.mod.
worldmapdemo.tga
Copy your image into [My Documents NWN2]\Campaigns\World Map Demo Campaign\.
Map Point Images
Our choice of Map Points Images is simpler since they aren't tied to a particular setting and so
we really only need to consider their availability and aesthetic qualities.
I could source or create some Map Point Images but having invested so much time in creating
the World Map Image I'm going to take a shortcut and use some images from the OC. The
[Program Files NWN2]\Campaigns\Neverwinter Nights 2 Campaign\ folder contains
several Map Point Images however I only need images for a cave, city and village. These
Map Point Image files all have an m_ prefix and a tga extension. There should be a _normal,
_hover and _pressed variation for each of the three Map Points.
Copy all nine images into [My Documents NWN2]\Campaigns\World Map Demo Campaign\.
Page 9
Sounds
Assigning sounds to your Map Points isn't actually necessary but will certainly give your World
Map a more polished feel. We could add some colour by assigning a sound effect or snippet of
music appropriate to the Map Point's destination however I'm going to opt for a simple click.
Again I don't want to spend time sourcing or creating my own custom sound so I have selected
gui_button.wav (found in the [Program Files NWN2]\Data\Sounds.zip archive). Since this
is a global resource it is available by default so I don't have to copy it into [My Documents
NWN2]\Campaigns\World Map Demo Campaign\.
Scripts
As mentioned previously the World Map System uses a lot of scripting and much of it is, or will
be, very specific to individual campaigns. Accordingly, as we will see in the Scripting section,
none of the global or OC campaign scripts are really suitable for use in our module as they all
have their limitations and design idiosyncrasies.
Consequently I have created a simple Starter Script Set. The source files can be found in the
resource pack accompanying this guide and the listing is in Appendix 3: Simple Script Set.
Copy your scripts into [My Documents NWN2]\Campaigns\World Map Demo Campaign\, save
the module and then open it again.
WARNING: Currently (v1.04) if the Toolset is open when we copy any campaign scripts into a
[My Documents NWN2]\Campaigns\[Campaign]\ folder, they will not appear in the Campaign
Scripts panel and we will not be able to access them immediately. This issue fixes itself when
we restart the Toolset.
TIP: If we save and open the current module after "importing" campaign scripts we can gain
access to them via Open Conversation/Script and for events even though they still aren't
visible in the Campaign Scripts panel until we restart the Toolset.
worldmapdemo.tga
647
647
World Map Demo
Page 10
Rotten Borough is a thriving town and, more importantly, our hero's base. It should
always be available: it requires a static Map Point.
The Den Of Iniquity is a secret lair that will be revealed by a villager in Imminent
Danger. It should start as unavailable and only become available when its location is
made known: it requires a dynamic Map Point and an initial visible state of FALSE.
We categorise the Map Points as static and dynamic because it indicates which script we should
use. Static Map Points are easy because we can simply assign the global gc_true script as
this script always returns TRUE. Dynamic Map Points are a little more difficult as we could use
any number of scripts to check the player's sex, race, class, level, etc. Alternatively we can
check an abstract "visible" state represented by a local, campaign or global variable.
For consistency we will adopt the last and both of our dynamic Map Points will use the
sj_c_map_point_check_visible script. If we want to use other conditions, such as speaking
to an NPC, we check them in advance and update the visible state prior to showing the World
Map. We will see an example of this when we reveal the Map Point for The Den Of Iniquity.
1. Click the Add button on the World Map Editor's toolbar.
2. Click on the World Map Image to create three Map Points.
3. Select all three Map Points in the Map Points panel.
4. Configure the following common properties
in the combined Map Points' Properties
grid:
Misc
Height
Width
Sound
32
32
gui_button
Page 11
10. Repeat steps 6 and 7 for the Map Points representing The Den Of Iniquity with the
following properties:
Appearance
ActionScript
ConditionalScript
Image
ImageMouseOver
ImageSelected
Misc
DisplayName
Name
TIP: you might notice a similarity between a Map Point's Name and the corresponding
Waypoint's Tag. I use an mp_ prefix for former and a wp_ prefix for the latter but other than
that the values are identical. I find this makes things very easy when setting the values of the
local variables and parameters.
11. Save the World Map again.
12. Close the World Map Editor plugin.
Page 12
TIP: In game a World Map Transition displayed as a circular compass/world graphic. The
radius of the graphic is dictated by the underlying trigger's longest dimension. To ensure the
final size is predicable it helps to paint square triggers. If you turn the Surface Mesh on you
can use gridlines to align and size the World Map Transition trigger. Each square is about
1.6x1.6m so 3 squares on each side makes a reasonably sized World Map Transition.
2. Set the following properties in the Trigger's Properties grid:
Scripts
On Click Script
Variables
sj_tr_show_world_map_en
sMap = worldmapdemo, sOrigin = mp_rotten_borough
3. Select Waypoint | Empty | Waypoint from the Blueprints panel and paint down a
waypoint in front of the World Map Transition Trigger.
4. Configure the following properties in the Waypoint's Properties grid:
General
Tag
wp_rotten_borough
5. Save World Map Demo 001.mod and open World Map Demo 002.mod.
6. Repeat steps 1 to 4 for Imminent Danger using the following properties:
Scripts
On Click Script
Variables
sj_tr_show_world_map_en
sMap = worldmapdemo, sOrigin = mp_imminent_danger
General
Tag
wp_imminent_danger
7. Repeat steps 1 to 4 for The Den Of Iniquity using the following properties:
Scripts
On Click Script
Variables
sj_tr_show_world_map_en
sMap = worldmapdemo, sOrigin = mp_den_of_iniquity
Page 13
General
Tag
wp_den_of_iniquity
sj_mod_world_map_demo_ld
NOTsj_c_map_point_check_visible("mp_den_of_iniquity")
sj_a_map_point_show("mp_den_of_iniquity")
Page 14
Appendix 1: Troubleshooting
Campaign Issues
1. I created and named a campaign however when I go to the Select Campaign
screen the button displays a "Campaign name is not set" error.
Currently (v1.04) the campaign's DisplayName property is used to populate the
buttons on the Select Campaign screen (previously campaign's Name property was
used instead or as well as DisplayName).
2. I created a campaign however I try to open it from the Select Campaign screen
nothing happens.
The Campaign's StartingModule property is unpopulated: ensure the StartingModule
property contains a Module's file name (without the .mod extension) and not the
Module's Name or Tag properties.
3. I created a campaign however when I try to open it from the Select Campaign
screen it appears to start opening, "Unpacking Module..." is displayed but then
the screen fades and the client hangs.
The Campaign's StartingModule property contains an invalid entry: ensure the
StartingModule property contains a Module's file name (without the .mod extension)
and not the Module's Name or Tag properties.
The Campaign's starting module is invalid: ensure you are not trying to access a
module that is corrupt or for which you only have the PWC file.
Page 15
6. A Map Point is visible in the World Map Editor but the "2D Texture Missing" image
is displayed in game either initially, when I rollover it and/or when it is selected.
Ensure the Image, ImageMouseOver and/or ImageSelected properties include the
image file name's .tga or .dds extension.
7. A Map Point is visible in the World Map Editor but is not visible in the destination
list or on the map in game.
Ensure the logic used in the ConditionalScript event of the missing Map Point is
returning the correct value, i.e. TRUE.
If you are using a local/global variable to control the Map Point's visibility ensure that
you have initialised the variable correctly and that all instances are spelt the same.
If you are using a 32-bit TGA image ensure the alpha layer is completely or at least
predominantly white.
8. I carefully positioned all my Map Points in the World Map Editor but in game
they've all shifted down and to the left.
Currently (v1.04) the World Map Editor sets the location using Map Point's centre point
while the World Map GUI uses the Map Point's top-left corner. A temporary workaround
is to translate all Map Point locations by (-Width/2, -Height/2).
Page 16
4. Image Viewer: The viewer displays the World Map Image and the default Map Point
images. You can Add, Select and/or move Map Points in the viewer.
5. Properties Grid: The grid displays the World Map's properties or the currently selected
Map Point's properties.
Width
WorldMapName
File name of TGA or DDS image file. Must reside in the campaign
directory.
The height (in pixels) of the World Map Image. Currently has to be set
manually. If the value differs from the image's actual height the image
is scaled rather than cropped. Using the default value of 0 results in the
World Map Image not being visible on the World Map GUI. The default
World Map GUI expects the height to be 647 pixels.
The width (in pixels) of the World Map Image. Currently has to be set
manually. If the value differs from the image's actual width the image is
scaled rather than cropped. Using the default value of 0 results in the
World Map Image not being visible on the World Map GUI. The default
World Map GUI expects the width to be 647 pixels.
Displayed in the World Map Editor's title bar. Not used by or displayed
on the default World Map GUI.
Page 17
Image
ImageMouseOver
ImageSelected
Misc
Description
DisplayName
Height
Location (X, Y)
Name
Sound
Width
Script to run when Map Point has been selected and Travel button is
clicked. Allows parameters to be passed.
Script to run when World Map is opened to determines if the Map Point
should be visible (the conditional returns TRUE) or not (the conditional
returns FALSE). Allows parameters to be passed.
File name of the default TGA or DDS image to be displayed. Must
reside in the campaign directory.
File name of the TGA or DDS image to be displayed when the mouse
rolls over a Map Point that isn't currently selected. Must reside in the
campaign directory.
File name of the TGA or DDS image to be displayed when a Map Point
has been selected. Must reside in the campaign directory.
Not used by or displayed on the default World Map GUI.
The name that appears in the World Map's Destination List.
The height (in pixels) of the Map Point's images. Currently has to be set
manually. If the value differs from the image's actual height the image
is scaled rather than cropped. Using the default value of 0 results in the
Map Point not being visible on the World Map GUI. Setting the height
does not affect the thumbnail image in the World Map's Destination List.
The X and Y position (in pixels). Set automatically when the map point is
created or dragged. Can be set manually. Currently (v1.04) represents
the Map Point's center point in the World Map Editor and the Map Point
top-left corner in the World Map GUI.
The Map Point's Tag for scripting purposes.
The file name (with or without the .wav) of a sound file in the [Program
Files NWN2]\Data\Sounds.zip archive or in the campaign directory.
Does not accept MP3 files or Sound objects from the Blueprints panel.
The width (in pixels) of the Map Point's images. Currently has to be set
manually. If the value differs from the image's actual width the image is
scaled rather than cropped. Using the default value of 0 results in the
Map Point not being visible on the World Map GUI. Setting the width
does not affect the thumbnail image in the World Map's Destination List.
Page 18
Action Script
// sj_a_map_point_travel
// - sModule:
file name (without .mod extension) of module containing target waypoint
// - sTarget:
tag of the target waypoint
// Transports the player and party to the target's location in current module or in another module.
//-------------------------------------------------------------------------------------------------/*
Conversation/GUI Action event script for the World Map Demo Starter Script Set to transport a
player and his party to a new location within the current module or to transport all players and
their parties to a new location in a different module.
If assigned to a Map Point's Action event the script isn't executed until the World Map's Travel
button is pressed while the Map Point is selected (unless the Map Point represents the player's
current location).
*/
//-------------------------------------------------------------------------------------------------/*
22 Jan 2007 Sunjammer
- created
*/
//-------------------------------------------------------------------------------------------------#include "ginc_transition"
void main(string sModule, string sTarget)
{
object oPC = GetIsObjectValid(GetPCSpeaker()) ? GetPCSpeaker() : OBJECT_SELF;
object oTarget = GetObjectByTag(sTarget);
// check if the target exists in the current module
if(GetIsObjectValid(oTarget))
{
// exists in module: jump the party to the target
SinglePartyTransition(oPC, oTarget);
}
else
{
// does not exist in module: load the appropriate module and jump the party to the target
LoadNewModule(sModule, sTarget);
}
}
Page 19
Page 20
Page 21