NWNX4 is a launcher for NWN2Server that injects code into the server process, in order to provide additional features and bug fixes.
You must install:
- Download and extract the NWNX4 zip file in any directory
- Copy all files from the
config.example/
folder to your nwnx4 folder (i.e. to their parent directory) - Customize the configuration files you just copied to suit your needs:
nwnx.ini
:plugin_list
: the list of all nwnx4 plugins that will be loaded. You may want to add or remove some of them.nwn2
: full or relative path to the NWN2 install folderparameters
: nwn2server command line arguments. Examples:-module YourModuleName
if your module is a .mod file-moduledir YourModuleName
if your module is a directory
xp_*.ini
: these are the plugins configuration files. Most plugins are shipped with convenient defaults, but you may need to tweak some of them. Note that the presence of a plugin configuration file does not mean the plugin will be loaded (seeplugin_list
innwnx.ini
).
- Copy the
.nss
files from thenwscript/
folder into your module folder, or importnwscript/nwnx.erf
into your module using the NWN2 toolset. Overwrite existing files if necessary. - Start NWNX4:
- Run
NWNX4_GUI.exe
for the GUI version - Run
NWNX4_Controller.exe -interactive
in a shell for the command-line version.
- Run
- Download and extract the NWNX4 zip file into your existing nwnx4 directory, and overwrite everything
- Only configuration files inside
config.example/
are updated. The existing configuration files in the NWNX4 folder are not overwritten. You may need to manually update the existing configuration files (see the release notes). - Copy the
.nss
files from thenwscript/
folder into your module folder, or importnwscript/nwnx.erf
into your module using the NWN2 toolset. Overwrite existing files if necessary.
NWNX4 was originally written by Virusman, Grinning Fool, McKillroy, Skywing, Papillon and many contributors. This repository is based on the original codebase, but with modern build tools and new maintainers.
The original source code can be found here: https://github.com/NWNX/nwnx4
# Initialize git submodules (if you did not clone this repo with `--recurse`)
git submodule init
git submodule update
# Bootstrap vcpkg
vcpkg\bootstrap-vcpkg.sh
# Install dependencies (can take a while)
vcpkg\vcpkg.exe install --triplet=x86-windows-static-md --clean-after-build
From a x86 MSBuild prompt (i.e. x86 Native Tools Command Prompt for VS 2019
if you installed Visual Studio 2019):
# Setup build
meson builddir
# Build project
cd builddir
meson compile
# Install nwnx4 at a given location
meson install --destdir=%cd%\..\nwnx4-install
Meson can generate solutions for Visual Studio. The following command will
create a NWNX4.sln
that you can open with Visual Studio:
meson setup --backend=vs2019 vsbuild
This section will guide you through the process of creating a folder / zip file containing everything players will need to quickly run a NWN2 server with your custom content, for single-player or multi-player usage.
Download this repository and copy the package-skel
directory to any
location. This folder contains some handy scripts, and the base structure for
your package, that you will need to configure and fill with your content.
package-skel\
├── ClientExtension\ Contains Skywing's Client Extension
├── home\ Replaces Documents\Neverwinter Nights 2.
├── nwnx4\ Contains NWNX4 files and config
├── start-game.bat Launcher for the game (with the client extension)
└── start-server.bat Launcher for the server (with nwnx4)
Download the nwnx4 zip file, and
extract it into package-skel\nwnx4\
.
You must configure NWNX4 as explained in nwnx4's README.md.
In order to run nwnx4 in a portable manner, you must add -home "$NWNX4_DIR\..\home"
to the parameters
variable. Other arguments are
recommended but not required:
# Configure the parameters to auto-start your module
# -home <DIR> The provided path will replace the Documents\Neverwinter Nights 2\ folder
# -moduledir <MODNAME> Your module name (if you're saving in directory mode)
# -module <MODNAME> Your module name without the .mod extension (if you're not in directory mode)
# -publicserver Disable server online advertising
# -maxclients Maximum number of connected players
parameters = -home "$NWNX4_DIR\..\home" -moduledir YourModule -publicserver 0 -maxclients 1
Skywing's Client Extension can automatically detect NWN2 installation
directory (and provides a better NWN2 player experience). Download it from
the
NWVault
and extract the zip into the package-skel\ClientExtension\
folder.
By default, start-game.bat
will:
- Copy
nwn2.ini
andnwn2player.ini
fromDocuments\Neverwinter Nights 2\
topackage-skel\home\
(so player game settings are kept). If these files are already present in the home folder, they will not be overwritten. You can use this behavior to provide your own customnwn2player.ini
. - Launch the game using the Client Extension
- Automatically connect to the server at
127.0.0.1:5121
You must install your custom content (modules, campaigns, haks, tlks,
override, ...) inside the package-skel\home\
folder. This custom content
will be used by both the server and the game client.