Difference between revisions of "SendMessageToPC"

From NWN Lexicon
Jump to: navigation, search
 
Line 34: Line 34:
 
====Remarks====
 
====Remarks====
  
Useful tool for debugging scripts; you can use it to display the value of variables, position within a script, etc. <br /><br /> If you attempt to send too many SendMessageToPC() commands at the same time the messages will begin to be dropped, causing some of the messages to not appear at all. <br /><br /> It is possible to have the messages appear in all sorts of colors. It is very easy, but it requires a little more than just scripting. You can download a small demo-module with documentation on how to do this at this url: <br /> http://nwvault.ign.com/Files/scripts/data/1041698002718.shtml
+
Useful tool for debugging scripts; you can use it to display the value of variables, position within a script, etc. <br /><br /> If you attempt to send too many SendMessageToPC() commands at the same time the messages will begin to be dropped, causing some of the messages to not appear at all.
 +
 
 +
It is possible to have the messages appear in all sorts of colors. It is very easy using the function [[StringToRGBString]].
  
 
<br />
 
<br />
Line 58: Line 60:
 
| width="1px" align="right" valign="top" | <font color="gray">functions: </font>
 
| width="1px" align="right" valign="top" | <font color="gray">functions: </font>
 
|
 
|
[[  SendMessageToPCByStrRef  | SendMessageToPCByStrRef ]]
+
[[  SendMessageToPCByStrRef  | SendMessageToPCByStrRef ]] [[StringToRGBString]]
 
|-
 
|-
 
|}
 
|}

Latest revision as of 00:04, 29 June 2020



SendMessageToPC(object, string)

Sends a message to the PC.

void SendMessageToPC(
    object oPlayer,
    string sMessage
);

Parameters

oPlayer

specific PC to send message to.

sMessage

Message to be sent to the PC.


Description

Send a 'Combat Message' string (sMessage) to the oPlayer. Messages appear as yellow text in any chat windows that display combat messages.



Remarks

Useful tool for debugging scripts; you can use it to display the value of variables, position within a script, etc.

If you attempt to send too many SendMessageToPC() commands at the same time the messages will begin to be dropped, causing some of the messages to not appear at all.

It is possible to have the messages appear in all sorts of colors. It is very easy using the function StringToRGBString.


Version

1.29

Example

// sample debug call, covers many testing bases:
void debug( string sMessage ) {
  SendMessageToPC( GetFirstPC(), sMessage );
  SendMessageToAllDMs( sMessage );
  PrintString( sMessage );
}

See Also

functions: 

SendMessageToPCByStrRef StringToRGBString



 author: Iskander Merriman, editor: Lilac Soul, additional contributor(s): John Platte, Lilac Soul