This plugin closely replicates the functionality of the NWNX2 hashset plugin, and the interface was kept as close as possible to the original for sake of compatibility. Below is a list of new functions. The original list of functions can be found here.
- HashSetTokenize: tokenizes a string and looks up each token in the specified map. See documentation in the .nss file for a detailed explanation.
- HashSetGetNextToken: invoke after HashSetTokenize to look up subsequent token mappings
- HashSetCreateFromFile: loads a hashset from a text file, assumed to be in the same location as xp_hashtable.dll. If a hashset for the same object/name already exists, it is replaced.
The function HashSetGetNthKey has been deprecated. GetKey/Value functions can be used independently. However, any changes to the hashset will cause unpredictable results if performed while processing GetFirst/GetNext calls. More detailed documentation for these functions can found in the file nwnx_hashset, and will also display in ScriptAssist.
At this time, I do not recommend using PCs as your hashset objects. In the demo module, I have had repeated issues with the first-used hashset function getting called automatically when the user logs out of the server. These issues have crashed the server; but do not occur when using NPCs or other objects for hashset storage. Once the new hooking system is available in 1.05, hopefully this will be resolved. In the interim, I have put some safeguards in the .nss file and in the dll itself which help to alleviate this issue (but do NOT completely resolve it).
The download nwnx_hashset.zip contains the following files:
- hashtable-src.zip : the source files. Most folks won't need these.
- nwnx_hashset.erf: this contains the nwnx_hashset.nss file. Import this into your module to have access to the hashset functions.
- nwnx_hashset_demo.mod: This contains a demonstration which demonstrates shows most of the functions available
- demo.ini: if you want to use the "load from file" feature of the demo, put this in the same location as NWNX4_Controller.exe
- xp_hashtable.dll: the plugin itself. Put this in the same location as NWNX4_Controller.exe