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 
 
shout from command line

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development
View previous topic :: View next topic  
Author Message
Meldawn



Joined: 10 Aug 2010
Posts: 1

PostPosted: Tue Aug 10, 2010 17:54    Post subject: shout from command line Reply with quote

I have looking for a way to send a shout to the module from the server command line. I don't want to send a message, the say command won't work for me.

Is this possible?
Back to top
View user's profile Send private message
Ginden



Joined: 07 Feb 2009
Posts: 4

PostPosted: Tue Aug 10, 2010 19:56    Post subject: Reply with quote

Yes, it's possible.
You must hook the server message by nwnx_chat. Then you should use SpeakMessage... Very Happy
_________________
In Soviet Russia, NWNX edit you!
Back to top
View user's profile Send private message
Ravine



Joined: 26 Jul 2006
Posts: 105

PostPosted: Tue Aug 10, 2010 20:12    Post subject: Reply with quote

Yeah, that's what i do too. Grab the 'say' message from console, and redirect it to an NPC, who shout it.
However, the 'say' command not sending one message to the server. It sends the message to every player individually. So if there are 3 players on the server, the NPC will shout it 3 times, so you have to script this (also, if the server is empty, no message will be sent).
Back to top
View user's profile Send private message
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Wed Aug 11, 2010 0:41    Post subject: Reply with quote

Yes, 'say' sends the message individually to each PC so nwnx_chat fires once for each message. The best way to get round this is probably to have a variable "LAST_MESSAGE" (or whatever) set on the module to whatever the most recent message hooked by the chat server_script is, and an integer variable "LAST_MESSAGE_EXPIRE" set to 1, with a DelayCommand of one second setting it to 0. Then if the current message is equal to the last message and LAST_MESSAGE_EXPIRE == 1, suppress the message and do nothing with it.
Back to top
View user's profile Send private message
Ravine



Joined: 26 Jul 2006
Posts: 105

PostPosted: Wed Aug 11, 2010 9:24    Post subject: Reply with quote

I simply use the "if(GetFirstPC() == cmMessage.Recipient) " check. FirstPC should be the same inside the cycle (but i saw it fail once).
Back to top
View user's profile Send private message
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Thu Aug 12, 2010 14:34    Post subject: Reply with quote

Ravine wrote:
I simply use the "if(GetFirstPC() == cmMessage.Recipient) " check. FirstPC should be the same inside the cycle (but i saw it fail once).


That's a good idea, just be aware that if the PC in question is in the process of leaving the server, then yes, it will fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development All times are GMT + 2 Hours
Page 1 of 1

 
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