Everyone

This Content can be viewed by everyone, even people with no account.

Technical Documentation

 

This section is intended to help those interested in building, or just wanting to know how things like the core scripts work.  Most of this information is NWN2-specific, though we will have some NWN1 technical documents listed here as well in the days to come.  In the meantime, much of this information is outdated or at least in need of organization and qualification.  I will be trying to get it more presentable as time goes on. 

For Everyone:

For Hosts, HDMs, and Hopeful HDMs:

For Builders:

For Scripters:

Reference Documents:

Technical Documentation:

 

For Hosters:

 

Technical / Connecting to the MySQL Database (NWNX4)

  1. THIS PAGE IS SERIOUSLY OUT OF DATE REFER TO https://www.alandfaraway.info/wiki/Basic_Host_Requirements FOR MORE CURRENT INSTRUCTIONS
  2. Download and extract the following NWNX4 files from the link below to a dedicated folder on your host machine (eg. C:\NWNX4):

  3. NWNX4_Controller.exe
    NWNX4_GUI.exe

    madCHook.dll
    NWNX4_Hook.dll
    xp_mysql.dll
    xp_time.dll

    nwnx.ini
    xp_mysql.ini

    http://nwnx.org/index.php?id=nwnx4
     
  4. Copy the madCHook.dll file to your Neverwinter Nights 2 game folder (where the game installed itself).
     
  5. You will need to configure nwnx.ini with your module and game information. The most important line is the parameters entry:

    parameters = -module "My Module" -servervault 1 -publicserver 1

    If you prefer to launch your module in directory mode, use the -moduledir paramater in place of -module.
     
  6. You will need to configure xp_mysql.ini with the correct connection details for the remote database server. Please contact the IA, TA, or DMA for that information.
     
  7. Once you have the file configured, you can launch your server using the NWNX4_GUI.exe program (NOT nwn2server.exe as you normally would). It will automatically launch nwn2server for you.

    Alternatively, you can install NWNX4 as a service on your host machine by issuing the following commands in your NWNX4 folder (only recommended for advanced users):

    NWNX4_Controller.exe -installservice
    NWNX4_Controller.exe -startservice

    NWNX4 will show up as a Windows service, which can be started and stopped like any other service on your machine (via Services in Administrative Tools). You can enable the nwn2server dialog window by navigating to the NWNX4 service, clicking on its properties, selecting the "Log On" tab, and checking the "Desktop Interaction" box.

    Other service commands you can issue using NWNX4_Controller.exe:

    -serviceno Specify service instance number
    -stopservice Stop the NWNX service
    -uninstallservice Uninstall the NWNX service
    -interactive Start in interactive mode
     
  8. Note: NWNX logs are recorded in the nwnx.txt file, and MySQL logs are recorded in the xp_mysql.txt file in the install folder. These will help you identify any configuration or run time sql problems (like bad queries).

Technical / Building ACR Compatible Items

All items should be priced according to 3.5 edition canon (Player's Hand Book, Dungeon Master's Guide, etc), and to the ALFA specific exceptions set forth by ALFA Standards. DO NOT MAKE ITEMS WORTH LESS THAN 1 GP YET! Our currency system for silver and copper pieces is not yet ready, and we may not know how it will work until we have the client in our hands.

Premise: An item should be identifiable from it's tag/resref.

<prefix>_it_<type>_<description>_<ID>

<prefix> is either "abr" (minus the quotes) for default ALFA items, or a three digit code of the server.

<type> is a three-letter abbreviation describing the slot occupied by the item.

<description> is the number of fields necessary to describe any additional properties on the item.

<ID> is an optional two-digit number used to distinguish items with identical properties. Leave the <ID> off of tags - it goes on resrefs only.

Item tags should NEVER be longer than 28 characters. The game allows 32, so don't use them all.

Scripting: For information on how to script items, go here.

Examples: A standard longsword would be, Tag: abr_it_wpn_longsword ResRef: abr_it_wpn_longword_01

TYPE

Ammunition amm Armor arm (includes shields) Boots boo Cloaks clk Gloves glv Helmets hlm Weapons wpn

DESCRIPTIONS

Materials

  • Abyssal Bloodiron ay
  • Adamantine ad
  • Alchemical Silver sa
  • Arandur aa
  • Astral Driftmetal as
  • Aurorum au
  • Bluewood bw
  • Cold Iron ci
  • Copper co
  • Darksteel dk
  • Darkwood (Zalantar) za
  • Dlarun dl
  • Dragonbone db
  • Dragonfang df
  • Dragonhide dh
  • Dragonscale ds
  • Duskwood du
  • Fever Iron fr
  • Fiendbone fb
  • Frystalline fy
  • Gold go
  • Hide hi
  • Hizagkuur hz
  • Laminated Steel ls
  • Living Metal lm
  • Mithral mi
  • Obsidian ob
  • Pandemonic Silver ps
  • Platinum pt
  • Serren se
  • Silver sv
  • Solarian Truesteel tr
  • Sondarr so
  • Suzailian Chainweave ch
  • Weirwood ww
  • Ysgardian Heartwire ys

Quality

  • Arcane Spell Failure -10% asf1
  • Drowcraft dc
  • Masterwork mw
  • Plus one e1
  • Poor po
  • Armour Class +1 ac1
  • Bonus Spell, Level 0 sb0
  • Bonus Spell, Levels 0, 1, 2 sb012
  • Damage Resistance 1 dr1
  • Damage Resistance 5/magic dr5m
  • Damage Resistance Fire 5 drf5
  • Feat: Alertness fale
  • Feat: Ambidexterity famb
  • Feat: Combat Casting fcca
  • Feat: Darkvision fdar
  • Feat: Dodge fdod
  • Feat: Extra Turning fext
  • Feat: Mobility fmob
  • Feat: Spell Focus (One) fsf1
  • Feat: Spell Penetration fpen
  • Feat: Two Weapon Fighting ftwf
  • Feat: Weapon Finesse fwfi
  • Spell Immunity, Level 0 si0
  • Spell Resistance 12 sr12
  • Freedom of Movement fom
  • Immunity: Death Magic ide
  • Immunity: Disease idi
  • Immunity: Drain idr
  • Immunity: Fear ife
  • Immunity: Gas iga
  • Immunity: Magic Missle imm
  • Immunity: Paralysis ipa
  • Immunity: Poison ipo
  • Save, Acid +1 sac1
  • Save, Cold +1 sco1
  • Save, Death +1 sde1
  • Save, Disease +1 sds1
  • Save, Fear +1 sfe1
  • Save, Fire +1 sfi1
  • Save, Fort +1 sfo1
  • Save, Mind +1 smi1
  • Save, Negative +1 sne1
  • Save, Poison +1 spo1
  • Save, Reflex +1 sre1
  • Save, Sonic +1 sso1
  • Save, Universal +1 sa1
  • Save, Will +1 swi1
  • Hide +1 hi1
  • Damage, Acid +1 da1
  • Damage, Bludgeoning +1 db1
  • Damage, Cold +1 dc1
  • Damage, Divine +1 dd1
  • Damage, Fire +1 df1
  • Damage, Magic +1 dm1
  • Damage, Negative +1 dn1
  • Damage, Piercing +1 dp1
  • Damage, Slashing +1 ds1
  • Damage, Sonic +1 do1
  • Feat: Cleave fcle
  • Feat: Disarm fdis
  • Feat: Improved Critical ficr
  • Feat: Point Blank Shot fpbs
  • Feat: Rapid Shot frap
  • Feat: Weapon Specialisation fwsp
  • Keen ke
  • Massive Criticals +1 mc1
  • Mighty +1 m1
  • Sure Striking sst
  • Vampiric +1 dv1
  • Wounding +1 dw1

CLASSIFICATION This is added in the toolset with a string seperated by the '|' character for each category. The HDMs of every server are free to make their own rules as too where items should be placed, but be aware the DM client cannot see more than one step "deep" into the category tree.

Technical / ACR Data Persistence

Data persistence API

The following functions are available for use in scripts to store persistent data (available across server resets). Be sure to delete any data that is no longer needed or to set expiration on data that you know will only be relevant for a fixed duration. This will help keep the size of the database down and minimize latency on queries (that can lag the game).

Note: NWNx4 must be installed and configured properly? on the host server for these functions to work.

This function executes an SQL statement. - sSQL: The SQL string to execute - Returns: Nothing void ACR_SQLQuery(string sSQL)

This function retrieves the next row of the result set returned by the most recent query. Call this before using ACR_SQLGetData(). - mode: Selects a result set in a multi set result
Leave the parameter empty to advance to the next row in the resultset.
Pass "NEXT" as parameter to fetch the first row of the next resultset. - Returns: SQL_SUCCESS if there is a row, SQL_ERROR if there are no more rows. int ACR_SQLFetch(string mode = " ")

This function retrieves the data in a specific column within the current row of the result set. - nCol: The index of the column to retrieve (max column size 65K) in the result row - Returns: The data in column nCol string ACR_SQLGetData(int nCol = 0)

This function returns the number of rows that were affected by the last INSERT, UPDATE, or DELETE operation. - Returns: Number of rows affected int ACR_SQLGetAffectedRows()

This function handles special characters (like ') for database storage. Problems can arise with SQL commands if variables or values have single or double quotes in their names. This function encodes these quotes so the underlying database can safely store them. - sString: The string to encode string ACR_SQLEncodeSpecialChars(string sString)

This function stores a persistent string. - oObject: The object for which the data is being stored - sVarName: The unique variable name - sValue: The value to record Optional parameters: - iExpiration: The number of days the persistent variable should be kept in database (default: 0=forever) void ACR_SetPersistentString(object oObject, string sVarName, string sValue, int iExpiration = 0)

This function stores a persistent integer. - oObject: The object for which the data is being stored - sVarName: The unique variable name - iValue: The value to record Optional parameters: - iExpiration: The number of days the persistent variable should be kept in database (default: 0=forever) void ACR_SetPersistentInt(object oObject, string sVarName, int iValue, int iExpiration = 0)

This function stores a persistent float. - oObject: The object for which the data is being stored - sVarName: The unique variable name - fValue: The value to record Optional parameters: - iExpiration: The number of days the persistent variable should be kept in database (default: 0=forever) void ACR_SetPersistentFloat(object oObject, string sVarName, float fValue, int iExpiration = 0)

This function stores a persistent location. - oObject: The object for which the data is being stored - sVarName: The unique variable name - lValue: The value to record Optional parameters: - iExpiration: The number of days the persistent variable should be kept in database (default: 0=forever) void ACR_SetPersistentLocation(object oObject, string sVarName, location lValue, int iExpiration = 0)

This function stores a persistent vector. - oObject: The object for which the data is being stored - sVarName: The unique variable name - vValue: The value to record Optional parameters: - iExpiration: The number of days the persistent variable should be kept in database (default: 0=forever) void ACR_SetPersistentVector(object oObject, string sVarName, vector vValue, int iExpiration = 0)

This function stores a persistent object. - oObject: The object for which the data is being stored - sVarName: The unique variable name - oItem: The object to record Optional parameters: - iExpiration: The number of days the persistent variable should be kept in database (default: 0=forever) void ACR_SetPersistentObject(object oObject, string sVarName, object oItem, int iExpiration = 0)

This function retrieves a persistent string. - oObject: The object for which the data is being retrieved - sVarName: The unique variable name - Returns: '' on error string ACR_GetPersistentString(object oObject, string sVarName)

This function retrieves a persistent int. - oObject: The object for which the data is being retrieved - sVarName: The unique variable name - Returns: 0 on error int ACR_GetPersistentInt(object oObject, string sVarName)

This function retrieves a persistent float. - oObject: The object for which the data is being retrieved - sVarName: The unique variable name - Returns: 0 on error float ACR_GetPersistentFloat(object oObject, string sVarName)

This function retrieves a persistent location. - oObject: The object for which the data is being retrieved - sVarName: The unique variable name - Returns: 0 on error location ACR_GetPersistentLocation(object oObject, string sVarname)

This function retrieves a persistent vector. - oObject: The object for which the data is being retrieved - sVarName: The unique variable name - Returns: 0 on error vector ACR_GetPersistentVector(object oObject, string sVarName)

This function retrieves a persistent object. - oObject: The object for which the data is being retrieved - sVarName: The unique variable name - Returns: 0 on error object ACR_GetPersistentObject(object oObject, string sVarName)

This function deletes a persistent record. - oObject: The object for which the data is being deleted - sVarName: The unique variable name void ACR_DeletePersistentVariable(object oObject, string sVarName)

This function converts a location to a string. - lLocation: The location to convert - Returns: A string equivalent string ACR_LocationToString(location lLocation)

This function converts a string to a location. - sLocation: The string to convert - Returns: A location location ACR_StringToLocation(string sLocation)

This function converts a vector to a string. - vVector: The vector to convert - Returns: A string equivalent string ACR_VectorToString(vector vVector)

This function converts a string to a vector. - sVector: The string to convert - Returns: A vector vector ACR_StringToVector(string sVector)

This function retrieves the CD Key of the player - always use this with exit events in place of the normal NWScript function (it returns null). - oPC: player whose CD Key to retrieve - Returns: oPC's CD Key string ACR_GetPCPublicCDKey(object oPC)

This function retrieves the database ID of the character (useful for direct queries using ACR_SQLQuery()). - oPC: player whose character ID to retrieve - Returns: oPC's character ID int ACR_GetCharacterID(object oPC)

 

Auxiliary database connections

There is support for creating "auxiliary" database connections (to other MySQL servers), though this support is not recommended for most usage.  Use the standard data persistence API instead in nearly all cases.

Auxiliary database connection documentation page.

Technical / Defining Rest Areas &amp; Healing Bonuses

 

 

Resting

Resting will only be permitted in specific rest areas. Rest areas are defined with special triggers for both interiors and exteriors, the boundaries of which can extend to the limits of an entire area, if so desired. How small or how large a rest area will be is entirely up to each builder. There are no superficial limits.  Please Note: The Area Property "No Resting Allowed" must be set to False. If No Resting Allowed = True, a Rest Area Trigger will not function.

Rest Area Configuration Options (Local Variables) Each rest area trigger should have the following options defined.

ACR_REST_ZONE: This integer value represents one of two possible states:

 1 - Indoor rest zone
 2 - Outdoor rest zone

ACR_REST_BONUS: This integer value represents a heal bonus as a percentage of Hit Dice (x% * Hit Dice) that resting players will heal on a successful rest. This healing is in addition to normal rates gained from resting as well as any bonuses earned from medicinal items.

ACR_REST_DISEASE: This floating point value represents a disease that is spread at the specified rest zone along with its DC to save. The format of this variable is X.YY, where X is an integer value representing the disease ID (found in nwscript.nss) and YY is the two digit difficulty class of the disease for saving throw purposes.

NOTE: Disease IDs begin at 0, so in the absence of any disease at the rest zone, be sure that ACR_REST_DISEASE_CHANCE is 0 (delete the variable entirely or set the value to 0).

ACR_REST_DISEASE_CHANCE: This integer value represents the percentage chance that the disease at the rest zone will be contracted. The default is 0, which means no chance for contraction exists.

 

Healing

To create medicinal items that apply a straight healing bonus on successful rest, create an item with the tag abr_it_mi_medicine. This will invoke a script of the same name, which applies the healing properties of the item on the next rest cycle.

Healing Configuration Options (Local Variables) Each medicinal item should have the following options defined.

ACR_REST_HEAL_BONUS: This integer value represents a straight heal bonus in hit points that resting players will heal on a successful rest. This is typically reserved for items who's properties work in tandem with resting.

 

Technical / ALFA Core Rules

The ACR (ALFA Core Rules) is the set of scripts which run ALFA servers. It is primarily made up of complex systems that interact with the game and alter NWN to meet our specific needs. The object of the ACR is to bring NWN as close to the Pen and Paper role playing experience as possible and to facilitate the administration of the game for DMs and admins alike. Exceptions exist wherever the demands of a real time game or limitations in the engine create a significant balance problem-- the tech team handles these designs on an individual basis, and will attempt to emulate pen and paper as closely as is feasible for the environment of our play.
 

View the status of our current active projects

In order to compile the ACR, or a module using the ACR, builders and scripters will need Skywing's advanced script compiler, which can be found here:
http://nwvault.ign.com/View.php?view=nwn2plugins.Detail&id=99

The ACR contains three sorts of scripts:

ACR Scripts Like the name might indicate, they are the meat and bones of the ACR. These files are located in haks, and cannot be changed by individual server teams. Should a team need to alter one of these files, they should contact the ALFA Tech staff via our forums.

All ACR scripts begin with the 'acr_' prefix. Any scripts which begin with an underscore are considered private and should not be included by any server-side script. It is expected that ACR scripts will be included and used locally by server teams for various purposes. Functions, constants, or variables prefixed with an underscore within the ACR are considered private, which means they should only be accessed within the script itself (ie nothing external to it). Using these locally within custom scripts may break the ACR. Functions, constants, or variables prefixed with "ACR_" are considered public, which means they can [and were designed to] be accessed by any script from anywhere, including local scripts created by a server team.

ACR Item Scripts Item scripts are the scripts which execute when an item is activated in-game. These scripts are named with the tag of the item.

ACR Configuration Files These files begin with the 'acf_' prefix and are used to configure the ACR to a server team's needs. They are only issued with the ALFA Base Module, and are never updated or changed by ACR updates. That means any customization a server has done in these files will never be overwritten.

If you wish to learn more or participate in the development of ACR systems, please visit the ACR forum. All released content is available for download on our project download page under a public reciprocal license.

Syndicate content