NWNX:EE  8193.36.12
nwnx_chat.nss
Go to the documentation of this file.
1 #include "nwnx"
6 
7 const string NWNX_Chat = "NWNX_Chat";
8 
26 const int NWNX_CHAT_CHANNEL_DM_DM = 30;
28 
36 int NWNX_Chat_SendMessage(int channel, string message, object sender = OBJECT_SELF, object target = OBJECT_INVALID);
37 
41 void NWNX_Chat_RegisterChatScript(string script);
42 
46 
51 
55 string NWNX_Chat_GetMessage();
56 
60 object NWNX_Chat_GetSender();
61 
65 object NWNX_Chat_GetTarget();
66 
72 void NWNX_Chat_SetChatHearingDistance(float distance, object listener = OBJECT_INVALID, int channel = NWNX_CHAT_CHANNEL_PLAYER_TALK);
73 
77 float NWNX_Chat_GetChatHearingDistance(object listener = OBJECT_INVALID, int channel = NWNX_CHAT_CHANNEL_PLAYER_TALK);
78 
80 
81 int NWNX_Chat_SendMessage(int channel, string message, object sender = OBJECT_SELF, object target = OBJECT_INVALID)
82 {
83  string sFunc = "SendMessage";
84 
87  NWNX_PushArgumentString(message);
88  NWNX_PushArgumentInt(channel);
89  NWNX_CallFunction(NWNX_Chat, sFunc);
90  return NWNX_GetReturnValueInt();
91 }
92 
93 void NWNX_Chat_RegisterChatScript(string script)
94 {
95  string sFunc = "RegisterChatScript";
96 
98  NWNX_CallFunction(NWNX_Chat, sFunc);
99 }
100 
102 {
103  string sFunc = "SkipMessage";
104 
105  NWNX_CallFunction(NWNX_Chat, sFunc);
106 }
107 
109 {
110  string sFunc = "GetChannel";
111 
112  NWNX_CallFunction(NWNX_Chat, sFunc);
113  return NWNX_GetReturnValueInt();
114 }
115 
117 {
118  string sFunc = "GetMessage";
119 
120  NWNX_CallFunction(NWNX_Chat, sFunc);
121  return NWNX_GetReturnValueString();
122 }
123 
125 {
126  string sFunc = "GetSender";
127 
128  NWNX_CallFunction(NWNX_Chat, sFunc);
129  return NWNX_GetReturnValueObject();
130 }
131 
133 {
134  string sFunc = "GetTarget";
135 
136  NWNX_CallFunction(NWNX_Chat, sFunc);
137  return NWNX_GetReturnValueObject();
138 }
139 
140 void NWNX_Chat_SetChatHearingDistance(float distance, object listener = OBJECT_INVALID, int channel = NWNX_CHAT_CHANNEL_PLAYER_TALK)
141 {
142  string sFunc = "SetChatHearingDistance";
143 
144  NWNX_PushArgumentInt(channel);
145  NWNX_PushArgumentObject(listener);
146  NWNX_PushArgumentFloat(distance);
147  NWNX_CallFunction(NWNX_Chat, sFunc);
148 }
149 
150 float NWNX_Chat_GetChatHearingDistance(object listener = OBJECT_INVALID, int channel = NWNX_CHAT_CHANNEL_PLAYER_TALK)
151 {
152  string sFunc = "GetChatHearingDistance";
153 
154  NWNX_PushArgumentInt(channel);
155  NWNX_PushArgumentObject(listener);
156  NWNX_CallFunction(NWNX_Chat, sFunc);
157  return NWNX_GetReturnValueFloat();
158 }
NWNX_GetReturnValueInt
int NWNX_GetReturnValueInt()
Returns the specified type from the c++ side.
Definition: nwnx.nss:94
NWNX_Chat_RegisterChatScript
void NWNX_Chat_RegisterChatScript(string script)
Registers the script which receives all chat messages.
Definition: nwnx_chat.nss:93
NWNX_CHAT_CHANNEL_DM_SHOUT
const int NWNX_CHAT_CHANNEL_DM_SHOUT
Definition: nwnx_chat.nss:22
NWNX_Chat_GetMessage
string NWNX_Chat_GetMessage()
Gets the message.
Definition: nwnx_chat.nss:116
NWNX_CHAT_CHANNEL_PLAYER_TALK
const int NWNX_CHAT_CHANNEL_PLAYER_TALK
Definition: nwnx_chat.nss:14
NWNX_CHAT_CHANNEL_DM_DM
const int NWNX_CHAT_CHANNEL_DM_DM
Definition: nwnx_chat.nss:26
NWNX_CHAT_CHANNEL_PLAYER_WHISPER
const int NWNX_CHAT_CHANNEL_PLAYER_WHISPER
Definition: nwnx_chat.nss:16
NWNX_GetReturnValueFloat
float NWNX_GetReturnValueFloat()
Returns the specified type from the c++ side.
Definition: nwnx.nss:99
NWNX_CallFunction
void NWNX_CallFunction(string pluginName, string functionName)
Scripting interface to NWNX.
Definition: nwnx.nss:54
NWNX_CHAT_CHANNEL_PLAYER_PARTY
const int NWNX_CHAT_CHANNEL_PLAYER_PARTY
Definition: nwnx_chat.nss:19
NWNX_Chat_SetChatHearingDistance
void NWNX_Chat_SetChatHearingDistance(float distance, object listener=OBJECT_INVALID, int channel=NWNX_CHAT_CHANNEL_PLAYER_TALK)
Sets the distance with which the player hears talks or whispers.
Definition: nwnx_chat.nss:140
NWNX_CHAT_CHANNEL_PLAYER_TELL
const int NWNX_CHAT_CHANNEL_PLAYER_TELL
Definition: nwnx_chat.nss:17
NWNX_GetReturnValueString
string NWNX_GetReturnValueString()
Returns the specified type from the c++ side.
Definition: nwnx.nss:109
NWNX_PushArgumentString
void NWNX_PushArgumentString(string value)
Pushes the specified type to the c++ side.
Definition: nwnx.nss:74
NWNX_Chat_SendMessage
int NWNX_Chat_SendMessage(int channel, string message, object sender=OBJECT_SELF, object target=OBJECT_INVALID)
Sends a chat message.
Definition: nwnx_chat.nss:81
NWNX_PushArgumentObject
void NWNX_PushArgumentObject(object value)
Pushes the specified type to the c++ side.
Definition: nwnx.nss:69
NWNX_CHAT_CHANNEL_DM_PARTY
const int NWNX_CHAT_CHANNEL_DM_PARTY
Definition: nwnx_chat.nss:25
NWNX_PushArgumentInt
void NWNX_PushArgumentInt(int value)
Pushes the specified type to the c++ side.
Definition: nwnx.nss:59
NWNX_CHAT_CHANNEL_DM_TELL
const int NWNX_CHAT_CHANNEL_DM_TELL
Definition: nwnx_chat.nss:24
NWNX_Chat_SkipMessage
void NWNX_Chat_SkipMessage()
Skips a chat message.
Definition: nwnx_chat.nss:101
NWNX_Chat_GetChatHearingDistance
float NWNX_Chat_GetChatHearingDistance(object listener=OBJECT_INVALID, int channel=NWNX_CHAT_CHANNEL_PLAYER_TALK)
Gets the distance with which the player hears talks or whisper.
Definition: nwnx_chat.nss:150
NWNX_Chat_GetSender
object NWNX_Chat_GetSender()
Gets the sender of the message.
Definition: nwnx_chat.nss:124
NWNX_CHAT_CHANNEL_DM_TALK
const int NWNX_CHAT_CHANNEL_DM_TALK
Definition: nwnx_chat.nss:21
NWNX_CHAT_CHANNEL_SERVER_MSG
const int NWNX_CHAT_CHANNEL_SERVER_MSG
Definition: nwnx_chat.nss:18
NWNX_CHAT_CHANNEL_PLAYER_SHOUT
const int NWNX_CHAT_CHANNEL_PLAYER_SHOUT
Definition: nwnx_chat.nss:15
NWNX_GetReturnValueObject
object NWNX_GetReturnValueObject()
Returns the specified type from the c++ side.
Definition: nwnx.nss:104
NWNX_CHAT_CHANNEL_PLAYER_DM
const int NWNX_CHAT_CHANNEL_PLAYER_DM
Definition: nwnx_chat.nss:20
NWNX_Chat_GetChannel
int NWNX_Chat_GetChannel()
Gets the chat channel.
Definition: nwnx_chat.nss:108
NWNX_PushArgumentFloat
void NWNX_PushArgumentFloat(float value)
Pushes the specified type to the c++ side.
Definition: nwnx.nss:64
NWNX_Chat_GetTarget
object NWNX_Chat_GetTarget()
Gets the target of the message.
Definition: nwnx_chat.nss:132
NWNX_CHAT_CHANNEL_DM_WHISPER
const int NWNX_CHAT_CHANNEL_DM_WHISPER
Definition: nwnx_chat.nss:23