A powerful set of functions that allow scripters full control over PC chat. Includes hooking, suppression and more. Note: This requires NWNX2.
Included in this package: NWNX-Chat plugin for NWNX, two scripts, and detailed instructions to help you get started. The library (fb_inc_chat.nss) is required for all these functions, the chat script (fb_chat.nss) is a good foundation for a very potent and entirely unique chat system.
Please do edit fb_chat.nss to your heart's content! I am only providing the groundwork for you to easily implement many useful functions; it's your job to code them in.
FEATURES INCLUDED:
- Ability to suppress text spoken with one simple function: fbCHSuppress();
- Ability to identify the target of a tell
- Complete control over every chat channel; every line spoken by every PC.
- A more powerful version of the SpeakString function: fbCHSpeakString. It allows you to speak in any chat channel, and specify a target if the Tell channel is chosen.
- Automatic emote parsing: simple roleplaying emotes such as *bows* will automatically make the PC perform that action visually.
- Anti-death-cheating: blocked talk and whisper messages sent when dead (optional).
- Customisable console: contains the basis for a potent and efficient "console" system, which allows players to enter certain commands to perform special actions (thus eliminating the need for clunky player and DM widgets).
COPYRIGHT NOTICE:
This is released under the GDL (GPL and Drinks License) which includes all the freedom of the GPL, except it also recommends that, if you like this package, you buy the maker a drink (or send some money via paypal to [email protected] so I can buy the drink myself). You are entirely free to distribute, modify, hack, blow to pieces and do whatever with this package as long as you include this statement somewhere in it (preferably somewhere that people will read it). Please give the original author of the scripts (Fireboar) some credit.
CREDITS:
- nwnx_chat.dll plugin for NWNX by dumbo and virusman (http://dumbo.nm.ru/). For linux users, nwnx_chat.so is available from this location.
- fb_chat.nss: Originally based around Gigaschatten's Dynamic Listeners script, but now all that is left of the original are tattered remains. By Fireboar.
- fb_inc_chat.nss: Originally by Dumbo; loads of added extensibility and documentation added by Fireboar.
- NWNX: Not part of the package, but I ought to give them credit anyway. Kudos to the clever people at Avalis for making all of this possible. (http://nwnx.org/)
NOTE FOR NWN 1.69 USERS:
Please see the nwnx.org forums and use the updated chat plugin, since the current one will only work for 1.68 and below. Windows users need nwnx_chat 0.3.4 or later, Linux users need nwnx_chat 0.3.5 or later.
So it is! How strange... why would I put in a silly error like that I wonder? Well, I'm uploading this minor fix now.
Posted by knightmb at 2008-03-16 13:14:10 Voted 10.00 on 09/01/08
Ok, I found out why this doesn't work, in your fb_inc_chat script, you have the Const of:
const int CHAT_CHANNEL_DM = 7;
which is the wrong number, that channel is actually 14, so to fix this you need to set it like this:
const int CHAT_CHANNEL_DM = 14;
Save and compile all scripts, good to go!
Posted by knightmb at 2008-03-15 01:20:47 Voted 10.00 on 09/01/08
The plugin works mostly great for me, but it doesn't capture the text in the DM channel that comes from players. Everything else it captures just fine. Any ideas why?
There are two errors with the ".nss" scripts supplied.
1) in "fb_inc_chat.nss", there are two places where "oRecipient" is spelt "oRecipent"; change both these to the former.
"fb_inc_chat.nss" affects the three module event scripts that you have to type (OnClientEnter, OnClientLeave, OnModuleLoad) plus "fb_chat.nss". Once this error is fixed, these four scripts need to be compiled.
2) in "fb_chat.nss", all the action strings, such as *kneels*, *threatens*, and so on down to *bows*, are missing their double quotes; they should be "*kneels*", "*threatens*", "*bows*", et cetera.
"fb_chat" will then compile.
And then it works. Whoo-hoo!
Also, looking at the code in "fb_inc_chat.nss", the following two global variables (which, apparently are "at bad thing" in nwscript):