You are on page 1of 23

Sunjammer's World Map Guide

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

Sunjammer's World Map Guide

TOC

The World Map System


Overview
If you haven't played the Official Campaign (OC) then you may not have encountered the
World Map System and you might be wondering what all the fuss is about.
The World Map System provides a new interface for long distance travel. In NWN we might
have used a dynamic conversation or custom tileset however in NWN2 we have the means to
design and display an interactive map, which players use to select a destination simply by
clicking on an icon.
Inevitably the World Map System consists of new elements that must be woven together in
order to integrate a fully functioning world map into an NWN2 campaign. This guide has been
produced to assist designers with this task.

The World Map System Components


The NWN2 World Map System consists of
several components:

The World Map Editor


The World Map Transition Trigger
The World Map GUI

The World Map Editor


The World Map Editor is a NWN2 Toolset
plugin. It will enable you to quickly assemble
and configure the various elements required
to create an interactive World Map. You can
access the World Map Editor from the
Toolset's Plugins menu.
The World Map Transition Trigger

The Official Campaign's World Map GUI

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.

Sunjammer's World Map Guide

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\.

Step 3: Viewing a new campaign's properties

d. StartingModule: Enter the file name, including or excluding the .mod extension, of
the first module in the campaign.

Sunjammer's World Map Guide

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.

Collate The World Map Assets


A typical World Map will require you to identify, acquire or create the following types of assets:

The World Map Image


Map Point Images
Sounds
Scripts

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.

A Module OnModuleLoad script or similar to initialise any dynamic Map Points.

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.

Create The World Map


Once you have collated the various resources required for the World Map in the campaign's
directory it's time to start putting them together. To do this you must use the World Map
Editor plugin.
TIP: You may find it useful to have the Appendix 2: World Map Editor section to hand to
provide additional information on the Editor and on each property.
1. Select the Plugins | World Map Editor menu option from the Toolset's menu bar.
2. Select the File | New menu option from the World Map Editor's menu bar (the World Map
Image viewer will turn black and a Properties grid will appear).
3. Configure the following properties in the World Map's Properties grid:
a. WorldMapImage: Click the ellipsis button to select a World Map Image file or
simply enter its file name (including the .tga or .dds extension).
b. Height/Width: Enter the height and width (in pixels) of the World Map image.
c. WorldMapName: Enter the text to be displayed in the World Map Editor's title bar.
4. Select the File | Save menu option from the World Map Editor's menu bar and save the
World Map in the appropriate campaign directory. You may have to navigate to it, as the
file selector does not automatically point to the Campaigns directory.
TIP: The World Map's file name doubles as the World Map's Tag for scripting purposes and it
is a good idea to name it accordingly.

Sunjammer's World Map Guide

Page 5

Add Map Points


Once you have created your World Map you can begin adding Map Points to it.
Each Map Point represents a destination that the player can potentially travel to. Since Map
Points are controlled entirely through scripting they can be hidden or shown as required and
their ultimate destination can be altered.
1. Click the Add button on the World Map Editor's toolbar.
2. Click on World Map Image where you want a Map Point. A small box with pale yellow and
black borders will appear centred on the location of your mouse click.
3. Click the Select button on the World Map Editor's toolbar.
TIP: If you want to add and configure a number of Map Points you can avoid repeatedly
switching between Add and Select by remaining in "add mode" and using the Map Points
panel to select the Map Points.
TIP: If you want to configure several Map Points with the same properties, for example the
same images or scripts, you can use the Map Points panel to multi-select Map Points using the
standard Shift+Click or Ctrl+Click combinations.
4. Click the Map Point you just added. The pale yellow border will change to bright yellow and
the Map Point's properties will appear in the Properties grid.
5. Configure the following properties in the Map Point's Properties grid:
a. ActionScript: Click the ellipsis button to display the Script Selector/Preview control
and select the appropriate script. If the script takes parameters click the Refresh
button and insert an appropriate value for each parameter.
b. ConditionalScript: Click the ellipsis button to display the Script Selector/Preview
control and select the appropriate script. If the script takes parameters click the
Refresh button and insert an appropriate value for each parameter.
c. Image/ImageMouseOver/ImageSelected: Enter the file name of the image to
be displayed by default, when the cursor is rolled over the Map Point and when the
Map Point has been selected.
d. DisplayName: Enter the name you wish to be displayed in the World Map GUI's
Destinations List.
e. Height/Width: Enter the height and width (in pixels) of the Map Point images.
COMMENT: the Height and Width properties apply to all three Map Point images therefore
these images should all have the same dimensions.
f.

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

Add World Map Transitions


1. Select the Trigger | Empty | World Map Transition from the Blueprints panel and
paint down a trigger in the appropriate area.
2. Set the following properties:
a. On Click Script: Click the ellipsis button to display the Script Selector/Preview
control and select the appropriate script or simply enter its name directly.
b. Variables: Click the ellipsis button to display the Collection form for the local
variables. Set the sMap and sOrigin local variables with appropriate values.
COMMENT: As parameter passing is not possible from a normal event, a World Map Transition
trigger must use an alternative method, such as local or global variables, to pass information
to the World Map GUI.
3. Select Waypoint | Empty | Waypoint from the Blueprints panel and paint down a
waypoint close to the World Map Transition trigger.
4. Set the following properties:
a. Tag: Enter a unique identifier for the waypoint.
5. Repeat steps 1 to 4 for each additional World Map Transition.
WARNING: Currently (v1.04) the World Map Transition Trigger is preconfigured to use an OC
script that is not available in the Toolset. You must replaced it or copy gtr_worldmap_cl from
[Program Files NWN2]\Campaigns\Neverwinter Nights 2 Campaign\.

Test Your World Map


Having put all that effort into creating the World Map it's now time to reward yourself by
enjoying your handiwork in game.
When you are testing remember to check the following:

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.

The visible state is correctly set for each Map Point.

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.

Sunjammer's World Map Guide

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

A campaign for testing the World Map System.


World Map Demo
World Map Demo Campaign
World Map Demo 001

Sunjammer's World Map Guide

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.

Collate The World Map Assets


World Map Image
Over and above availability and aesthetic qualities there are a couple of considerations that will
influence our choice of World Map Image.
With locations like Rotten Borough and
Imminent Danger our module is more likely
to be set on the Discworld than Abeir-Toril. In
addition we are talking about a relatively small
area: a region rather than a continent or world.
Taking these into account I think we can rule
out using the OC World Map Image. This
means we are left with sourcing or creating an
alternative.
I've opted to create worldmapdemo.tga, which
you can find it in the accompanying resource
pack and which I'm sure you'll agree is an
artistic triumph! You're more than welcome to
use it too however if for some inexplicable
reason you feel compelled to scour the web for
another or to design your own then remember
to rename your image or replace references to
worldmapdemo.tga with your image's file name.

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\.

Sunjammer's World Map Guide

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.

Create The World Map


1. Select the Plugins | World Map Editor menu option from the Toolset's menu bar.
2. Select the File | New menu option from the World Map Editor's menu bar.
3. Configure the following properties in the
World Map's Properties grid:
Appearance
WorldMapImage
Misc
Height
Width
WorldMapName

worldmapdemo.tga
647
647
World Map Demo

4. Select the File | Save menu option from


the World Map Editor's menu bar and save
the World Map in the [My Documents
NWN2]\Campaigns\World Map Demo
Campaign\ folder as worldmapdemo.wmp.

Sunjammer's World Map Guide

Step 3: Configure the World Map

Page 10

Add Map Points


In total we will need three Map Points however, before we start adding them to the World Map,
we have to decide how they are to behave over the course of our campaign.
I divide Map Points into two categories: static and dynamic. Static Map Points will always be
shown on the World Map, whereas dynamic Map Points will be hidden or revealed depending
on whether certain conditions are met when the World Map is displayed.
The distinction between static and dynamic Map Points is important because it affects the
scripts we can use to control that Map Point.
If we look at our three Map Points we find each has slightly different requirements:

Rotten Borough is a thriving town and, more importantly, our hero's base. It should
always be available: it requires a static Map Point.

Imminent Danger is a well-known hamlet however I have a feeling that sooner or


later one of the many threats it faces will overwhelm it and it will cease to exist. It
should be available initially but that may change when disaster strikes: it requires a
dynamic Map Point and an initial visible state of TRUE.

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

5. Click the Select button on the World Map


Editor's toolbar to avoid accidentally
creating more Map Points.
6. Click on the Map Point you want to
represent Rotten Borough.
Sunjammer's World Map Guide

Step 4. Configure common Map Point properties

Page 11

7. Configure the following properties in the Map Point's Properties grid:


Appearance
ActionScript
ConditionalScript
Image
ImageMouseOver
ImageSelected
Misc
DisplayName
Name

sj_a_map_point_travel("World Map Demo 001", "wp_rotten_borough")


gc_true()
m_city_normal.tga
m_city_hover.tga
m_city_pressed.tga
Rotton Borough
mp_rotten_borough

TIP: To correctly configure an ActionScript or ConditionalScript with parameters remember


to press the Refresh button and fill in the blanks after you have selected the script.
9. Repeat steps 6 and 7 for the Map Points representing Imminent Danger with the
following properties:
Appearance
ActionScript
ConditionalScript
Image
ImageMouseOver
ImageSelected
Misc
DisplayName
Name

sj_a_map_point_travel("World Map Demo 002", "wp_imminent_danger")


sj_c_map_point_check_visible("mp_imminent_danger")
m_village_normal.tga
m_village_hover.tga
m_village_pressed.tga
Imminent Danger
mp_imminent_danger

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

sj_a_map_point_travel("World Map Demo 002", "wp_den_of_iniquity")


sj_c_map_point_check_visible("mp_den_of_iniquity")
m_cave_normal.tga
m_cave_hover.tga
m_cave_pressed.tga
The Den Of Iniquity
mp_den_of_iniquity

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.

Sunjammer's World Map Guide

Page 12

Add World Map Transitions


Before adding any World Map Transitions we
need to ensure that we have created all three
areas: one area in World Map Demo 001.mod
for Rotten Borough and two areas in World
Map Demo 002.mod for Imminent Danger
and The Den Of Iniquity.
The World Map Transitions is preconfigured
with an OnClick script and the names of two
local variables. As this script is in fact an OC
campaign resource we will simply replace it
with sj_tr_show_world_map_en. The new
script will still use the same local variables.
1. Select the Trigger | Empty | World
Map Transition from the Blueprints
panel and paint down a trigger in the
appropriate area.

A World Map Transition Trigger in game

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

Sunjammer's World Map Guide

Page 13

General
Tag

wp_den_of_iniquity

Add Map Point Switches


Since the default visible state for our dynamic Map Points is always FALSE, we must switch it to
TRUE just before we need them to appear in the World Map GUI.
Imminent Danger
The Map Point for Imminent Danger is to be available initially but subsequently it might
become unavailable. Accordingly we must ensure we've switched its visible state before then
the World Map GUI is displayed for the first time. We will use the OnModuleLoad event set the
Map Point's visible state to TRUE.
1. Set the following properties in the Module's Properties grid:
Scripts
On Module Load

sj_mod_world_map_demo_ld

The Den Of Iniquity


The Map Point for The Den Of Iniquity is to remain hidden until a resident of Imminent
Danger reveals The Den's location. We will set the Map Point's visible state to TRUE in a
conversation where the NPC offers to mark the location of The Den Of Inequity on the
player's map.
2. Add the following entries on the Conversation Node's script tabs:
Conditions
Actions

NOTsj_c_map_point_check_visible("mp_den_of_iniquity")
sj_a_map_point_show("mp_den_of_iniquity")

Sunjammer's World Map Guide

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.

World Map Issues


1. I created and saved a World Map however when I test it in game the World Map
Transition doesn't do anything.
Ensure the World Map Transition Trigger's OnClick event slot is populated; that the
script exists in the Campaign's directory; and that it has been successfully compiled
(i.e. both the .nss and .ncs versions exist).
Ensure the World Map Transition Trigger's sMap variable is set to the World Map's file
name (without the .wmp extension).
2. I create a World Map, saved it and tested it in game. Now none of the images are
visible when I open it in the World Map Editor.
Ensure you have one of the campaign's modules open rather than, for example, temp0.
Ensure the module you opened is set to use the currently selected campaign.
3. The World Map Image is visible in the World Map Editor but is not visible in game.
Check the Height and Width properties. One or both may still be using the default
value of 0. These properties must be manually set to the correct value for the World
Map Image (normally 647x647 pixels).
If you are using a 32-bit TGA image ensure the alpha layer is completely or at least
predominantly white.
4. The World Map Image is visible in the World Map Editor but a "2D Texture
Missing" image is displayed in game.
Ensure the WorldMapImage property includes the file name's .tga or .dds extension.
5. A Map Point is visible in the World Map Editor and in the destination list in game
but it is not visible on the map in game.
Check the Height and Width properties. One or both may still be using the default
value of 0. These properties must be manually set to the correct value for the Map
Point Image (normally 32x32 pixels).
Sunjammer's World Map Guide

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).

Sunjammer's World Map Guide

Page 16

Appendix 2: World Map Editor


World Map Editor
The World Map Editor is a NWN2 Toolset plugin. It will enable you to quickly assemble and
configure the various elements required to create an interactive World Map. You can access
the World Map Editor from the Toolset's Plugins menu.
1. Menu Bar: The File menu contains
standard file options and allows you to
create a New World Map or Open an
existing one. The View menu provides
access to the Map Properties.
2. Toolbar: The Toolbar buttons allow you to
Add new Map Points or Select an existing
one. Once selected a Map Point can be
dragged to a new location.
3. Map Points Panel: The panel lists all Map
Points by Name. It allows you to select one
or more Map Points (which reveals its/their
properties). Once selected a Map Point can
be removed using the Delete key.

The World Map Editor Plugin

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.

World Map Properties


The World Map's properties are displayed when you first create, or subsequently load, a world
map file. You can also access them by clicking on View | Map Properties.
Appearance
WorldMapImage
Misc
Height

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.

Sunjammer's World Map Guide

Page 17

Map point Properties


A map point's properties are displayed when you first create, or subsequently select, a map
point.
Appearance
ActionScript
ConditionalScript

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.

Sunjammer's World Map Guide

Page 18

Appendix 3: Starter Script Set


Map Point Scripts
Conditional Script
// sj_c_map_point_check_visible
// - sMapPoint:
name (tag) of the Map Point to check
// Checks the visible state of sMapPoint and returns TRUE (if visible) or FALSE
//-------------------------------------------------------------------------------------------------/*
Conversation/GUI Conditional event script for the World Map Demo Starter Script Set to check
the visible state of a Map Point. It will return TRUE (if the Map Point is visible) or FALSE.
*/
//-------------------------------------------------------------------------------------------------/*
22 Jan 2007 Sunjammer
- created
*/
//-------------------------------------------------------------------------------------------------int StartingConditional(string sMapPoint)
{
// show the map point if it's visible state is set to TRUE
return GetGlobalInt(sMapPoint + "_visible");
}

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);
}
}

Sunjammer's World Map Guide

Page 19

Initialise Map Points


// sj_mod_world_map_demo_ld
// Initialises any dynamic Map Points that should start as visible.
//-------------------------------------------------------------------------------------------------/*
Module OnLoad event script for the World Map Demo Starter Script Set to initialise any dynamic
Map Points that need to be visible when the World Map GUI is first displayed.
*/
//-------------------------------------------------------------------------------------------------/*
22 Jan 2007 Sunjammer
- created
*/
//-------------------------------------------------------------------------------------------------void main()
{
// check "do once" flag
if(GetLocalInt(OBJECT_SELF, "OnLoad_DoOnce"))
return;
// initialise map points
SetGlobalInt("mp_imminent_danger_visible", TRUE);
// raise "do once" flag
SetLocalInt(OBJECT_SELF, "OnLoad_DoOnce", TRUE);
}

Show Map Point


// sj_a_map_point_show
// - sMapPoint:
name (tag) of the Map Point to check
// Sets sMapPoint's state so it will be shown next time the World Map containing it is opened.
//-------------------------------------------------------------------------------------------------/*
Conversation/GUI Action event script for the World Map Demo Starter Script Set to set the Map
Point's visible state to TRUE. This will cause the Map Point to be shown the next time the
World Map containing it is opened.
*/
//-------------------------------------------------------------------------------------------------/*
22 Jan 2007 Sunjammer
- created
*/
//-------------------------------------------------------------------------------------------------void main(string sMapPoint)
{
SetGlobalInt(sMapPoint + "_visible", TRUE);
}

Hide Map Point


// sj_a_map_point_hide
// - sMapPoint:
name (tag) of the Map Point to check
// Sets sMapPoint's state so it will be hidden next time the World Map containing it is opened.
//-------------------------------------------------------------------------------------------------/*
Conversation/GUI Action event script for the World Map Demo Starter Script Set to set the Map
Point's visible state to TRUE. This will cause the Map Point to be hidden the next time the
World Map containing it is opened.
*/
//-------------------------------------------------------------------------------------------------/*
22 Jan 2007 Sunjammer
- created
*/
//-------------------------------------------------------------------------------------------------void main(string sMapPoint)
{
SetGlobalInt(sMapPoint + "_visible", FALSE);
}

Sunjammer's World Map Guide

Page 20

World Map Transition Trigger Scripts


OnClick Script
// sj_tr_show_world_map_en
// Displays the World Map GUI specified by the sMap local variable and selects the Map Pont
// specified by the (optional) sOrigin local variable.
//-------------------------------------------------------------------------------------------------/*
World Map Transition Trigger OnClick event script the World Map Demo Starter Script Set to
display the World Map GUI to the clicking player.
The trigger has two local variables:
- sMap:
the file name (with or without the .wmp exention) of the World Map to display
- sOrigin
the name (tag) of the Map Point representing the player's current location
NOTE: this is a very simple version, designed to be built upon as requirements grow.
*/
//-------------------------------------------------------------------------------------------------/*
22 Jan 2007 Sunjammer
- created
*/
//-------------------------------------------------------------------------------------------------void main()
{
object oClicker = GetClickingObject();
// we only allow players to use the World Map
if(GetIsPC(oClicker))
{
// read the trigger's world map settings
string sMap = GetLocalString(OBJECT_SELF, "sMap");
string sOrigin = GetLocalString(OBJECT_SELF, "sOrigin");
// open the world map gui
ShowWorldMap(sMap, oClicker, sOrigin);
}
}

Sunjammer's World Map Guide

Page 21

You might also like