NWNX Setup Instructions

From Nwnx

  1. Copy madCHook.dll, NWNX.ini, NWNX2.exe and nwnx-module.dll into your NWN folder.
  2. Edit NWNX.ini and you will see the following default values:
; NWNX2 configuration file
; These are the default values for NWNX2. Values specified on the command
; line take precedence.

[NWNX]
ServerPort = 5121
ModuleName = "aps_demo"
WatchdogProcess = yes
UpdateIntervalProcess = 5
WatchdogGamespy = no
UpdateIntervalGamespy = 20
GamespyRetries = 5
OldGamespyProtocol = no
RestartDelay = 5

[ODBC2]
; Log file
MaxLogSize = 512 ; in KByte
LogLevel = 2 ; 0=nothing, 1=only errors, 2=everything

; Use these two settings for the SQLite internal database
source = sqlite
file   = sqlite.db

; Use these two settings for ODBC connections
;source = odbc
;dsn    = nwn

; Use these five settings for MySQL connections
;source = mysql
;server = localhost
;user   = nwn
;pwd    = nwn
;db     = nwn

; Set hookscorco to false if you want to disable hooking of
; StoreCampaignObject and RetrieveCampaignObject entirely
hookscorco = true

[PROFILER]
MaxLogSize = 512 ; in KByte
LogLevel = 1 ; 1=overall statistics, 2=full script callstack

To use MySQL as your database, comment out the SQLite db lines with ; and uncomment the SQL db lines like so:

; Use these two settings for the SQLite internal database
;source = sqlite
;file   = sqlite.db

; Use these five settings for MySQL connections
source = mysql
server = localhost
user   = nwn
pwd    = nwn
db     = nwn

If you want to change the module started, change the following line under the NWNX header:

ModuleName = "aps_demo"

Next, we change the ini file to use our new database and user that we set up using the MySQL DB Setup Instructions:

; Use these five settings for MySQL connections
source = mysql
server = localhost
user   = nwnx
pwd    = nwnxp@ss
db     = nwn

Personal tools