logo logo

NWNX4/System version 2.1 [NWN2 patch 1.22, NWNX4 1.09]



NWNX4/System version 2.1  [NWN2 patch 1.22, NWNX4 1.09]

 

Description

This plugin sets the CPU core of the game server process and it may also be used to reset the server from inside the game, or get the server's CPU usage, with NWScript.

 

Installation

Extract xp_system.dll and xp_system.ini to your NWN2 folder.

Extract NWNX4System.mod and nwnx_system.erf to your NWN2 Modules folder.

To test the Reset plugin, open your nwnx.ini file, and under the parameters section update it as follows:

parameters = -module "NWNX4System"

Save your changes and close the nwnx.ini file.
NWNX4 can now load the NWNX4System module for testing the plugin.

To set the processor core which the NWN2 server uses, open the xp_system.ini file, and set the cpuid entry to the core of your choice, for example to set it to use core 1 only do this:

cpuid = 2

Save your changes and close the xp_system.ini file.

You're ready to play!
Run NWNX4, by doubleclicking NWNX4_GUI.exe.
Start your NWN2 game, and connect to your server running NWNX4 and the NWNX4System module.

Pulling the one lever in the area will reset the server, and the other will give you the CPU usage of the server.

To use the NWNX4System plugin in your own module, import the nwnx_system.erf file into your module.
You may examine the include file, nwnx_system, for more information.

 

 
Prototypes

void ResetServer( );
This function resets the current instance of the NWN2 server.
It returns nothing.


string GetCPU( );
This function gets the CPU usage of the NWN2 server.
It returns the CPU usage as a string value.

 

Todo

Comments and ideas are welcome.

Download NWNX4/System version 2.1

xp_system2.1.zip   109 K

NWNX4/CHARACTER VERSION 0.0.1.0 [NWN2 VERSION 1.13 AND NWNX4 1.09]

NWNX4/CHARACTER VERSION 0.0.1.0  [NWN2 VERSION 1.13 AND NWNX4 1.09]

CREDIT
Please thank Nemrod for the Archive Character function!

DESCRIPTION
This plugin makes certain changes to player character files (BIC's), which aren't currently available ingame.

INSTALLATION

This is quite a lengthy installation, but I've tried to be thorough in my explanation of things, so please read everything carefully.

Extract xp_character.dll and BicFunctions.exe to the root of your Neverwinter Nights 2 (NWN2) folder.

Extract NWNX4Character.mod and nwnx_character.erf to your NWN2 Modules folder.

Configure your servervault paths by editing nwn2.ini as well as the plugin's include file.
Open the nwn2.ini file which is in your NWN2 root folder.
Locate the SERVERVAULT entry and point it to where you want your servervault to be.
By default it's '.\servervault' excluding quotes, which means that your servervault will probably be located at:

C:\Documents and Settings\<Username>\My Documents\Neverwinter Nights 2\servervault

However, if you prefer to have your servervault elsewhere then you may do so by modifying the nwn2.ini file as follows:

SERVERVAULT=C:\NWN2\servervault

It's entirely up to you, although I would recommend leaving everything default myself.
Characters will be stored in their own folders, the folders of which are named according to the Gamespy account name which creates them.

Save your changes to nwn2.ini and close the nwn2.ini file.

We've configured the servervault path for the NWN2 game, but now we need to configure the servervault for the NWNX4 Character plugin, we'll do this next.

Open the NWNX4Character module in your toolset, and doubleclick to open the nwnx_character script file from the Scripts tab.
Locate the SERVERVAULT constant, it's at the top of the script, and reads as follows:

const string SERVERVAULT = "C:/Documents and Settings/Kungfoowiz/My Documents/Neverwinter Nights 2/servervault/";

Modify the username to match the username of your own My Documents folder, if you're intending to use the servervault path which NWN2 is configured for by default.
Please note that you must use forward slashes in the path otherwise they'll be mangled by the NWScript in the Character plugin. So please don't use backslashes, rather use forward slashes!

 
However, if you've set your own servervault path, then you'll need to modify accordingly, for example:

const string SERVERVAULT = "C:/NWN2/Servervault/";

Press Compile and Save to save your changes, and then close the NWN4Character module.

Okay, we're half done. Now we're going to configure your NWN2 game again, for some multiplayer settings. Open the nwn2player.ini file which is in your root NWN2 folder.

If you're intending to change ability scores and skill ranks, then you'll have to disable what's known as Enforce Legal Characters (ELC), which is used by the server to verify that a character file isn't cheating. Therefore, by disabling it, you should have alternate checks in place to prevent unauthorized character modifications.
However, if you're not going to be modifying abilities and skills, then you needn't worry about disabling ELC.

To disable ELC, locate the Enforce Legal Characters entry. Set its value to 0, like so:

Enforce Legal Characters=0

Now, we need to make sure that NWN2 will read and write our multiplayer characters to the servervault. To do this, we need to locate the AllowLocalChars entry and set its value to 0, like so:

AllowLocalChars=0

We're nearly finished configuring NWN2 and the Character plugin! Save and close the nwn2player.ini file.

We should make sure that the NWNX4Character module is being loaded by NWNX4, so make sure you've installed the latest version of NWNX4!
Open the nwnx.ini file which is in the root of your NWN2 folder.

Under the parameters section, it should read something like this:

parameters = -module NWNX4Character

This means that NWNX4 will load the NWNX4Character module, when you run NWNX4 that is.

Okay, that's it! Save and close the nwnx.ini file.

You can run now NWNX4, just doubleclick the NWNX4_GUI.exe file. I'm assuming you've installed NWNX4 correctly here. Then start your NWN2 game, and connect to your server running with NWNX4 and the NWNX4Character module and plugin.

There are several levers which you can pull to see the various functions that the Character plugin provides. If all went well, then you should see the effects of pulling the levers when you log back in. For the changes to take effect, you must be booted from the server.

To use the NWNX4Character plugin in your own module, import the nwnx_character.erf file, from your NWN2 Modules folder where you extracted it. Examine the include file, nwnx_character script file on how to use the plugin's functions.
You may also examine the scripts in the NWNX4Character module to learn more.

 
LIST OF FUNCTION PROTOTYPES

void SaveCharacter( object oPC );
This internal function saves player characters.
object oPC refers to the player object. This function returns nothing.

void BootAndUpdateCharacter( object oPC );
This function will update your character with any changes you designate with the Character plugin's functions. In other words, make your changes, and then make a call to this function to save them permanently to your character. This operation will boot your character from the server and perform the changes you made with the following functions.
object oPC refers to the player object. This function returns nothing.

string GetBICFilename( object oPC );
This internal function acts as a wrapper to Obsidian's of similar functionality. This wrapper will get the full path to the BIC filename of your character, instead of the relative path.
object oPC refers to the player object.
This function returns the full path string to your character's BIC filename.

string ParseAbility( int nAbility );
This internal function parses an integer ability name into a string ability name.
int nAbility refers to the integer ability.
This function returns the string name of the integer ability.
ABILITY_CHARISMA for example, would be returned as, Charisma.

void SetAbilityScore( object oPC, int nAbility, int nScore );
This function sets abilities with the scores you specify. You may call this function multiple times to set different abilities, all in one go.
object oPC refers to the player object.
int nAbility refers to one of the abilities, you may use the ABILITY_* constants.
int nScore refers to the score you want to set a particular ability to.
The ability scores are technically limited to 50, but the variable size has a value range of 0 to 255.
This function returns nothing.

void SetBaseSkillRank( object oPC, int nSkill, int nRank );
This function sets base skills with the ranks you specify. You may call this function multiple times to set different skills, all in one go.
object oPC refers to the player object.
int nSkill refers to one of the skills, you may use the SKILL_* constants.
int nRank refers to the base rank you want to set a particular skill to.
The base skill ranks are technically limited to 100, but the variable size has a value range of 0 to 255.
This function returns nothing.

void DeleteCharacter( object oPC );
This function deletes the currently-playing character from the servervault. The character file will be unrecoverable, so make that you confirm any such deletions!
object oPC refers to the player object.
This function returns nothing.

 
void ArchiveCharacter( object oPC );
This function archives the currently-playing character by renaming it as an archived character. Character will no longer appear in the players' servervaults, but they may still be unarchived by a server administrator if players would wish to unarchive their characters. There is currently no UnarchiveCharacter function.
object oPC refers to the player object.
This function returns nothing.

void SetWing( object oPC, int nWingType );
This function sets the character's wing to a gargoyle, devil's and many others!
object oPC refers to the player object.
int nWingType refers to the wing you'd like to attach, you may use the WING_* constants.
This function returns nothing.

void SetTail( object oPC, int nTailType );
This function sets the character's tail type to a succubus or even a dragon's tail!
object oPC refers to the player object.
int nTailType refers to the tail you'd like to attach, you may use the TAIL_* constants.
This function returns nothing.

void SetHairTint( object oPC, int part1R, int part1G, int part1B, int part2R, int part2G, int part2B, int part3R, int part3G, int part3B );
This function sets the colour tint of your character's hair!
object oPC refers to the player object.
part1R, part1G, part1B are RGB (additive) colour values for your hair accessory.
part2R, part2G, part2B are colour values for your first (front) hair highlight.
part3R, part3G, part3B are colour values for your first (back) hair highlight.
This function returns nothing.

void SetHeadTint( object oPC, int part1R, int part1G, int part1B, int part2R, int part2G, int part2B, int part3R, int part3G, int part3B );
This function sets the colour tint of your character's head!
object oPC refers to the player object.
part1R, part1G, part1B are RGB (additive) colour values for your face.
part2R, part2G, part2B are colour values for your eyes.
part3R, part3G, part3B are colour values for your eyebrows.
This function returns nothing.

void SetBodyTint( object oPC, int part1R, int part1G, int part1B, int part2R, int part2G, int part2B, int part3R, int part3G, int part3B );
This function sets the colour tint of your character's body!
object oPC refers to the player object.
part1R, part1G, part1B are RGB (additive) colour values for your misc body part.
part2R, part2G, part2B are colour values for your torso.
part3R, part3G, part3B are colour values for your limbs.
This function returns nothing.

 
string TransformMatrix( int part1R, int part1G, int part1B, int part2R, int part2G, int part2B, int part3R, int part3G, int part3B );
This internal function transforms an integer matrix (tints) into a string, with padding. part1R, part1G, part1B are three integer values.
part2R, part2G, part2B are three integer values.
part3R, part3G, part3B are three integer values.
This function returns a string value of the integer matrix.

TODO
Implement some more functions, particularly one to alter character hitpoints if possible.

Download:

xp_character.zip   184 K

NWNX4/SYSTEM VERSION 0.0.1.0 [NWN2 VERSION 1.13 AND NWNX4 1.09]

NWNX4/SYSTEM VERSION 0.0.1.0  [NWN2 VERSION 1.13 AND NWNX4 1.09]

DESCRIPTION
This plugin sets the CPU core which the server uses, and it can also reset the server on demand.

INSTALLATION
Extract xp_system.dll and xp_system.ini to your root Neverwinter Nights 2 (NWN2) folder.

Extract NWNX4System.mod and nwnx_system.erf to your NWN2 Modules folder.

To test out the plugin, open your nwnx.ini file, which is in the root of your NWN2 folder.

Under the parameters section, it should read something like this:

parameters = -module NWNX4System

This means that NWNX4 will load the NWNX4System module.

Save and close the nwnx.ini file.

If you would like to set the CPU core which your computer uses for this particular instance of the NWN2 server, then open xp_system.ini in your root NWN2 folder.

Set the cpuid entry to the core of your choice, for example to set to core 1, do this:

Cpuid = 2

Right, you're ready to play!

We'll now run NWNX4, so doubleclick the NWNX4_GUI.exe file. I'm assuming you've installed NWNX4 correctly here. Then start your NWN2 game, and connect to your server running with NWNX4 and the NWNX4System module and plugin.

There is one lever which you can pull, it will boot all players from the server and then reset the game server.

To use the NWNX4System plugin in your own module, import the nwnx_system.erf file, from your NWN2 Modules folder where you extracted it. Examine the include nwnx_system script file on how to use the plugin's functions.
You may also examine the scripts in the NWNX4System module to learn more.

LIST OF FUNCTION PROTOTYPES

void ResetServer( );
This function resets the server game. It returns nothing.

TODO
Some sort of CPU monitoring when the NWN2 server is running. It could be useful.
And then whatever requests you have, please post them in the forums.

Download:

xp_system.zip   151 K

NWNX4/CLOCK VERSION 0.0.1.0 [NWN2 VERSION 1.13 AND NWNX4 1.09]

NWNX4/CLOCK VERSION 0.0.1.0  [NWN2 VERSION 1.13 AND NWNX4 1.09]

CREDIT
Please thank CarterDC for refactoring this plugin to NWNX4 1.08.

DESCRIPTION
This plugin gets the time and date of the local computer's clock, and it also gets epoch time.

INSTALLATION

Extract xp_clock.dll to the root of your Neverwinter Nights 2 (NWN2) folder.

Extract nwnx_clock.erf to your NWN2 Modules folder.

To test out the plugin, open your nwnx.ini file, which is in the root of your NWN2 folder.

Under the parameters section, it should read something like this:

parameters = -module NWNX4Clock

This means that NWNX4 will load the NWNX4Clock module.

Save and close the nwnx.ini file.

Okay, let's run NWNX4, doubleclick the NWNX4_GUI.exe file. I'm assuming you've installed NWNX4 correctly here. Then start your NWN2 game, and connect to your server running with NWNX4 and the NWNX4Clock module and plugin.

There is one lever which you can pull, it shows the current local time and date, as well as epoch time.

To use the NWNX4Clock plugin in your own module, import the nwnx_clock.erf file, from your NWN2 Modules folder where you extracted it. Examine the include nwnx_character script file on how to use the plugin's functions.
You may also examine the scripts in the NWNX4Clock module to learn more.


LIST OF FUNCTION PROTOTYPES

string GetSystemDate( );
This function gets the local computer's date in the format, MM.DD.YYYY.
It returns the date as a string.

string GetSystemTime( );
This function gets the local computer's time in the format, HH:MM:SS.
It returns the time as a string.

int GetUNIXTime( );
This function gets the epoch time, the time in seconds since the 1st of January 1970. It's useful for timestamping events and objects.
It returns the epoch time as an integer.

TODO
Nothing at the moment, although you're welcome to post some ideas.

Download:

xp_clock.zip   151 K