logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Chat plugin for NWNX4?
Goto page Previous  1, 2, 3 ... 6, 7, 8, 9, 10, 11  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Development
View previous topic :: View next topic  
Author Message
PNJ



Joined: 30 Jun 2007
Posts: 67

PostPosted: Sat Sep 29, 2007 18:16    Post subject: Reply with quote

Nevermind still working fine.
Back to top
View user's profile Send private message
seed



Joined: 01 Dec 2006
Posts: 44

PostPosted: Wed Oct 10, 2007 16:03    Post subject: Reply with quote

PNJ wrote:
my code is :
Code:
string sText = NWNXGetString("CHAT", "TEXT", "", 0);
int nMode = StringToInt(GetStringLeft(sText,2));
int nTo = StringToInt(GetSubString(sText,2,10));

   if (nMode==4)
   {
   oPCn = dmb_getPC(nTo);
   Debug("!FROM! "+GetName(oPC)+" !TO! "+GetName(oPCn)+" : "+sText);
   }


got the sender & the message, but not the receiver.


virusman wrote:
Ok, I'll fix this bug, but only after Sept 9th.


Any update on this bug? I have updated to 1.08 for the MotB release and now my chat system seems broken. I can't live without this excellent plugin!
Back to top
View user's profile Send private message
GodBeastX



Joined: 09 Aug 2006
Posts: 65

PostPosted: Wed Oct 10, 2007 23:10    Post subject: Reply with quote

I've fixed the bug, it's an issue with initialization and mode numbers changed too.

17 == Standard Talking
18 == Shout
19 == whisper
20 == tell
30 == DM

In the chat include, a function needs to change:

Code:
int dmb_GetClientID(object oPC)
{
    if (!GetIsObjectValid(oPC))
        return -1;

    if (!GetIsPC(oPC) && !GetIsPossessedFamiliar(oPC) && !GetIsDM(oPC) && !GetIsDMPossessed(oPC))
        return -1;

    return NWNXGetInt("CHAT", "GETID", ObjectToString(oPC), ObjectToInt(oPC));
}



And Module On Enter Needs this at least:

Code:
   int nID = dmb_GetClientID(oPC);

   SetLocalObject(GetModule(), dmb_LIST_ITEM_NAME  +  IntToString(nID), oPC); 


Or something similar.

We're able to get sender AND reciever on Sundren for tells.
Back to top
View user's profile Send private message
seed



Joined: 01 Dec 2006
Posts: 44

PostPosted: Thu Oct 11, 2007 0:08    Post subject: Reply with quote

thanx GBX -

but now I am getting a new error. I installed MOTB today and now I am getting this error with the chat plugin v0.3.3:

from nwnx.txt :

Quote:
Loading plugin xp_chat.dll: Error 14001. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.


From Event Viewer:
Quote:
Generate Activation Context failed for C:\Program Files\Atari\Neverwinter Nights 2\xp_chat.dll. Reference error message: The operation completed successfully.


Am I missing something on my server?

UPDATE/EDIT:

I installed "Microsoft Visual C++ 2005 SP1 Redistributable Package (x86)"

found here : http://www.microsoft.com/downloads/details.aspx?FamilyID=200B2FD9-AE1A-4A14-984D-389C36F85647&displaylang=en

and it works.
Back to top
View user's profile Send private message
GodBeastX



Joined: 09 Aug 2006
Posts: 65

PostPosted: Fri Oct 12, 2007 10:14    Post subject: Reply with quote

Ahh yes, I recompiled mine with latest windows SDK so...
Back to top
View user's profile Send private message
NewPoint



Joined: 23 Oct 2007
Posts: 13

PostPosted: Tue Oct 23, 2007 21:09    Post subject: Reply with quote

Is there some documentation available for this plugin? The examples provided are helpful but I don't think they cover everything. Also the example are not comment much. The functions of dmb_chat are totally uncommented.

What I'm looking for is a simple list of command that can be use with the chat plugin.

For example:

NWNXGetString("CHAT", "TEXT", "", 0) retrieves an encoded sting with the original message, the channel it was sent on and the intended recipient.

NWNXSetInt("CHAT", "SUPRESS", "", 0, 1) will suppress the message but I have no idea how it know what message to suppress or how it plugin know when to allow a message to pass.

I know this little bit from looked at the example code.

It would be nice to have a simple document that explained what calls can be made to the chat plugin, what parameters there are, what the return value is, and what effect they have.
Back to top
View user's profile Send private message
GodBeastX



Joined: 09 Aug 2006
Posts: 65

PostPosted: Fri Dec 07, 2007 22:38    Post subject: Reply with quote

GodBeastX wrote:
I've fixed the bug, it's an issue with initialization and mode numbers changed too.

17 == Standard Talking
18 == Shout
19 == whisper
20 == tell
30 == DM

In the chat include, a function needs to change:

Code:
int dmb_GetClientID(object oPC)
{
    if (!GetIsObjectValid(oPC))
        return -1;

    if (!GetIsPC(oPC) && !GetIsPossessedFamiliar(oPC) && !GetIsDM(oPC) && !GetIsDMPossessed(oPC))
        return -1;

    return NWNXGetInt("CHAT", "GETID", ObjectToString(oPC), ObjectToInt(oPC));
}



And Module On Enter Needs this at least:

Code:
   int nID = dmb_GetClientID(oPC);

   SetLocalObject(GetModule(), dmb_LIST_ITEM_NAME  +  IntToString(nID), oPC); 


Or something similar.

We're able to get sender AND reciever on Sundren for tells.


Okay, the IDs were right before, but DMs get 0x10 added to the chat mode, so tells are 0x04 and if a DM sends a tell it's 0x14
Back to top
View user's profile Send private message
AcadiusLost



Joined: 15 Dec 2007
Posts: 26
Location: Charlottesville, VA

PostPosted: Sat Dec 15, 2007 11:02    Post subject: Reply with quote

As a default behavior, this plugin seems to generate a logfile containing all chat, shouts, even private tells on the server. We're currently just using the chat script to check periodically to make sure players aren't logged in AFK (we're implementing XP timers that reward for time logged in, but only while showing signs of "life").

Is there a way to suppress the tells (or everything) being sent to the logfile? I've got a few lines borrowed from SimTools in, but nothing that should be generating that kind of a log from what I can tell- seems to be coming from the xp_chat.dll - is there a setting I can add to the .ini or a variable I can set on the module to block tells (or everything) from logging to xp_chat.txt ?
_________________
Technical Administrator
A Land Far Away, a Persistent World Project
Back to top
View user's profile Send private message Visit poster's website
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Thu May 22, 2008 0:12    Post subject: Reply with quote

NWNX4 Chat 0.3.5
http://data.virusman.ru/nwn/nwnx4/xp_chat-0.3.5.rar
  • Replaced MadCHook library with Detours
  • New scripting library - nwnx_chat.nss
  • Added 'loglevel' ini setting
    • 0 = minimal logging
    • 1 = errors only
    • 2 = everything
    • 3 = debug
  • Fixed an issue with Recipient ID not being passed correctly
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
PNJ



Joined: 30 Jun 2007
Posts: 67

PostPosted: Thu May 22, 2008 0:29    Post subject: Reply with quote

the full const int for the chat canal are:
Code:

const int CHAT_CHANNEL_TALK        = 1;
const int CHAT_CHANNEL_SHOUT       = 2;
const int CHAT_CHANNEL_WHISPER     = 3;
const int CHAT_CHANNEL_PRIVATE     = 4;
const int CHAT_CHANNEL_SERVER_MSG  = 5;
const int CHAT_CHANNEL_PARTY       = 6;
const int CHAT_DM_WHIPSER       = 19;
const int CHAT_DM_SHOUT       = 18;
const int CHAT_DM_PRIVATE      = 20;
const int CHAT_DM_PARTY         = 22;
Back to top
View user's profile Send private message
PNJ



Joined: 30 Jun 2007
Posts: 67

PostPosted: Mon Jun 02, 2008 16:45    Post subject: Reply with quote

i m a bit lost with the new version, i can't get it to work with my olde scripts, you say nwnx_chat is the new script library, so we don't need anymore dmb_chat ?
Back to top
View user's profile Send private message
pdwalker



Joined: 09 Aug 2005
Posts: 22

PostPosted: Sun Jun 15, 2008 18:50    Post subject: Help: my chat_script is not running? Reply with quote

Right, I believe I've got nwnx4 installed properly (i.e. I can read/write to my database, and the profiler is working.

I've just added in the xp_chat.dll into my nwnx4 directory along with the following xp_chat.ini file
Code:
class = CHAT

chat_script=chat_script
server_script=chat_script
processnpc=1
ignore_silent=0

loglevel = 3


When I start nwnx4, I see the following in my nwnx.txt file

Code:
NWN Extender 4 V.0.0.8
(c) 2007 by Ingmar Stieger (Papillon)
visit us at http://www.nwnx.org

* Loading plugins...
* Loading plugin xp_chat.dll: Successfully registered as class: CHAT
* Loading plugin xp_mysql.dll: Successfully registered as class: SQL
* Loading plugin xp_profiler.dll: Successfully registered as class: PROFILER
* Loading plugin xp_sqlite.dll: Successfully registered as class: SQLoff
* Loading plugin xp_time.dll: Successfully registered as class: TIME
* Disabling general protection fault error dialog.
* NWNX4 activated.


I see the following in my xp_chat.txt
Code:
NWNX4 Chat Plugin V.0.3.5
(c) 2005-2006 by dumbo (dumbo@nm.ru)
(c) 2006-2007 by virusman (virusman@virusman.ru)
visit us at http://www.nwnx.org

* Log level set to 3 (debug)
ChatFunc found at 0x4328d0
RunScript found at 0x73e260
GetPCobjByOID found at 0x451ce0
Chat function is hooked.
* Plugin initialized.


In my scripts, I've added the nwnx_chat.nss to my module and added the NWNXChat_Init() function to my module load event, the NWNXChat_PCEnter() function to my client enter event script and NWNXChat_PCExit() function to my client exit event script.

My chat_script is only a simple stub function so that I can verify the script is being called:
Code:
#include "nwnx_chat"

void main()
{
   WriteTimestampedLogEntry("chat_script:");
}


I've verified that all my scripts are compiled and that I've saved the module.

I've verified that I can get WriteTimestampedLogEntry() entries into my log.

The problem is, it appears that the chat_script is not being called as I get no messages in my log file at all. Nor do I get any further messages in my xp_chat.txt log file with loglevel set to 3 or 2.

Am I missing something obvious, or can someone tell me how I might be able to debug this problem a bit better?

Any help or insights would be greatly appreciated.



I've using the latest version of everything as of today.
- nwn2 1.12 (1295)
- nwnx4 0.0.8
- xp_chat 0.3.5

nwnx4 is installed in one directory, while nwn2 is installed in another directory - if that matters.

I've verified programmatically via the nwnx functions that the plugins are actually installed
Code:
[Mon Jun 16 00:42:23] plugins installed: 5
[Mon Jun 16 00:42:23] plugins 1: CHAT
[Mon Jun 16 00:42:23] plugins 1 desc:
[Mon Jun 16 00:42:23] plugins 2: TIME
[Mon Jun 16 00:42:23] plugins 2 desc: This plugin provides highly accurate timers.
[Mon Jun 16 00:42:23] plugins 3: SQLoff
[Mon Jun 16 00:42:23] plugins 3 desc: This plugin provides database storage. It uses SQLite 3.3.17 as databaserver server and therefore is very ease to configure and maintain.
[Mon Jun 16 00:42:23] plugins 4: SQL
[Mon Jun 16 00:42:23] plugins 4 desc: This plugin provides database storage. It uses MySQL 4 or 5 as database server.
[Mon Jun 16 00:42:23] plugins 5: PROFILER
[Mon Jun 16 00:42:23] plugins 5 desc:


Thanks in advance for your help.

- Paul
Back to top
View user's profile Send private message
abraxas77



Joined: 17 Nov 2006
Posts: 15

PostPosted: Thu Jun 19, 2008 2:55    Post subject: Reply with quote

I'm using xp_chat v0.3.3 ... which is working well for me. This version would only work when it was in the same folder as nwn2server.exe, but if that was your problem, it wouldn't load successfully.

Have you tried any of the nwnx functions for it? Are able to get or suppress the text entered into the chat window?
Code:
NWNXGetString("CHAT", "TEXT", "", 0);
NWNXSetInt("CHAT", "SUPRESS", "", 0, 1);

_________________
aka. twp_andrew

:: Lead Script Design :: The World of Paladium II ::
Back to top
View user's profile Send private message
Undertowe



Joined: 03 Jan 2005
Posts: 33

PostPosted: Mon Aug 04, 2008 11:04    Post subject: Reply with quote

Has anyone been able to get 0.3.5 to work yet? If so, what function library are you using - dmb_chat or nwnx_chat? I spent a couple hours trying to get 0.3.3 working back in the day and IIRC had to re-write some of the functions in dmb_chat because they were broken. Is it the same story with 0.3.5 or does the code actually work now?
Back to top
View user's profile Send private message
Undertowe



Joined: 03 Jan 2005
Posts: 33

PostPosted: Mon Aug 04, 2008 11:52    Post subject: Reply with quote

I just tried 0.3.5 and I'm having the same issue as pdwalker. Nothing (aside from the initialization stuff) is being logged in xp_chat.txt despite trying several values for loglevel, nor does my chat script (written for 0.3.3) work. If I swap out 0.3.5 for 0.3.3 then everything works correctly, including my chat script.

I'm using:

nwn2server.exe 1.13.1407
NWNX4 1.08

EDIT: I should mention that all my chat script does is write extra information to xp_chat.txt, so if that's not working, and nothing else is getting written by the plugin, maybe something got messed up with the new loglevel setting?

Is the following the correct syntax?

loglevel=X
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Development All times are GMT + 2 Hours
Goto page Previous  1, 2, 3 ... 6, 7, 8, 9, 10, 11  Next
Page 7 of 11

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group