SimTools v1.2

From Nwnx

Contents

Author: FunkySwerve

Source: NWN Vault

I am writing this how-to for Windows users. By default SIMTools uses the standard Bioware database. With a flip of a switch in the fky_cht_config script, however, it is ready for use with he built-in database that comes with NWNX. If you have no idea what that means, and this is the first time you will be using NWNX, don't worry. If you are a Linux user, or are already using the old version of Letoscript, or you want to use another database program, this will not work for you. If that is the case, or if you are curious about other uses of NWNX (it is amazingly versatile), you may find help here:

http://www.nwnx.org/ (NWNX homepage - links to their forum)

I'm including a slightly long-winded explanation first, and then a checklist below that. Setup consists of 2 parts, software installation, and Scripting. This means that you must have NWNX installed in your NWN folder (Software), and the correct scripts installed in your module (Scripting).

Detailed Explanation

Software Installation, Setup and Configuration

I have included 6 files in the self-extracting zip filed named NWNX2andNWNX_chat.exe. Double click it, and put all 6 in your NWN folder. The normal path to the NWN folder in a default installation is C:\\NeverwinterNights\\NWN. The files are named: NWNX2.exe NWNX.INI nwnx-module.dll madCHook.dll chat.dll odbc.dll

Normally to host a server you would use nwnserver.exe, and select the module to host, player limit, and so on, from there. To use NWNX and chat, however, you MUST launch NWNX2.exe. It will load nwnserver for you, and will restart it most of the time if it crashes. You can still make most changes like player limit directly in nwserver, but you will need to choose the module you are going to load beforehand, in the NWNX.ini file. The NWNX.ini file included it setup to launch the SIMTools_Test.mod. If you want to see the system at work, simply double click the NWNX2.exe to start up NWNX. You'll see the NWNX box pop up, and a few moments later nwnserver will load. Note that the module name shows as unselectable, because you must set it in the ini (I will explain how next). You may then login and experiment to your heart's content. The only necessary aspects of the system are the scriupts, though there are twp items included that list all the possible commands for easy reference. They also list the !list commands, !list emotes, and dm_listcommands commands, which will pull up identical lists in your combat log.

To run your own module using NWNX: Double click on NWNX.ini to edit it. Find the line that reads: ModuleName = "SIMTools_Test"

Change the name in the quotes to the name of your module. For instance, if your mod's filename is UberFastLevelling.mod, the line should look like: ModuleName = "UberFastLevelling"

That's it, you're set. Clicking on NWNX2.exe will now load your module with NWNX running. All NWNx plugins that you have installed will run correctly (though if you are following this tutorial exactly the only plugins installed are ODBC and chat - don't worry about what ODBC is, you can read more on the NWNX page if you like).

ADVANCED USERS: If you are already using nwnx for other applications, simply add the chat.dll to your NWN folder, and add the following 3 lines at the bottom of NWNX.ini:

[CHAT]
chat_script=fky_chat
server_script=fky_chat_srv

The same is true for users of the Higher Ground Legendary Level System.

Scripting

Once your software is set up to use NWNX, you must still put the scripting commands in your module that will tell NWNX what to do. This is just like importing any other script into your module. There are only two files needed for NWNX to hook into your module:

aps_include aps_onload

Aps_include is included in the SIMTools.erf file, and aps_onload was merged into fky_chat_modload, which is also included in that erf. Unzip SIMTools.zip. Put the SIMTools_Test.mod in your modules folder in the NWN folder, and the SIMTools.erf in the erf folder in the NWN folder. Import* the Legendary_Levels.erf into your module. Ignore any missing resources warnings. Save your module, then build** it, then save again.

Now that all the scripts you need are in your module, you need to add a few scripts to the module events. With your module still open in the toolset, click the Edit tab, and select Module Properties. In the events tab, put the following scripts in the following events:

Event		Script
-----		------
OnClientEnter	fky_chat_clenter
OnClientLeave	fky_chat_clexit
OnModuleLoad	fky_chat_modload
OnPlayerLevelUp fky_chat_levelup

If you already use your own custom scripts in those events, you will need to merge the scripts. Telling you how is beyond the scope of this tutorial, so if you find yourself in this situation, simply post the two scripts on the Bioware scripting forum and ask for help combining them. The address of the scripting forum:

http://nwn.bioware.com/forums/viewforum.html?forum=47

You're almost done! All you need to do is make some changes to the fky_chat_config script. Open the script editor, and open fky_chat_config. Most of the changes are explained in detail in that script. Two, however, are very important and worth mentioning here: 1) First, you need to select or create three waypoints at locations you want players to be sent when dms use the dm_porthell, dm_portjail, and dm_porttown. The waypoints need not be in 'hell', a jail, or a town; you can set them them whereever you like. Once you have created them, ensure that their tags are descriptive enough to be unique, and then enter those tags in the DM_PORT DESTINATIONS section of fky_chat_config. 2) Second, you must enter the cdkeys of everyone you want treated as a dm in this system into the VerifyDMKey function. If you do not, none of the dm commands or message routing will function for dms. 3) Third, you must enter the cdkeys of everyone you want treated as an admin in this system into the VerifyDMKey function. If you do not, none of the dm commands or message routing will function for admins. 4) Fourth, you must enter the names of your subraces in the SubraceSpeaks functions, designating which of your subraces speak what languages. If you do not, only class and race languages will work.


IF YOU DO NOT KNOW THE CD KEYS of the people you need tagged as dms, simply skip this step for the time being. When you run the module, you will be able to use the !playerinfo command on anyone whose cdkey you need. Please note that these cdkeys are the PUBLIC versions of the private keys, readily available on any server. There is no security threat in being able to see them. Once you have the needed keys, return to this script and enter them. You will have to build the module again and save it again for the change to take.


After entering in the waypoints and cd keys, save the script, exit the script editor. Save the module, then build it again, then save a final time. You're done!

Footnotes:

*How to import: Open your module in the toolset. Click the File tab, and select Import. This will pull up a window allowing you to choose what erf to import. By default, it starts in the erf folder in NWN. Select the Legendary_Levels.erf, click Open.

**How to build the module: Click the Build tab, and select Build Module. Because you only need to build the scripts for this, to save time you can build only the scripts. Click the Advanced Controls box, and make sure tat only Compile has a check in it, and only Scripts is selected below it. Click the Build button.

Checklist

Software 1) Double click NWNX2andLetoscript24.exe, and put all 7 files in your NWN folder. 2) Double click on NWNX.ini to edit it. Find the line that reads: ModuleName = "SIMTools_Test" and change it to the name of your mod (leave off the .mod extension)

Scripting 1) SIMTools.zip. Put the SIMTools_Test.mod in your modules folder in the NWN folder, and the SIMTools.erf in the erf folder in the NWN folder. 2) Import SIMTools.erf into your module. Ignore the missing resources warnings. Save your module, then build it, then save again. 3) In Edit/Module Properties/Events, set the OnClientEnter event to fky_chat_clenter, the OnClientLeave event to fky_chat_clexit, the OnModuleLoad event to fky_chat_modload, and the OnPlayerLevelUp event to fky_chat_levelup. 4) Configure the fky_cht_config script for the settings that you want. You must designate 3 waypoints in that file for 3 of the dm-port commands, and list the cd keys of everyone that you want the system to treat as a DM or Admin, and designate what languages your subraces speak if any.

Running the module once NWNX is installed in your NWN folder and the Legendary Level system is installed in your module: 1) Double click NWNX2.exe to start NWNX. A few moments later nwnserver will load.

Personal tools