FANDOM


// Send a server message (szMessage) to the oPlayer.
void SendMessageToPC(object oPlayer, string szMessage);

It is possible to change both the color and style of szMessage.

Omitting the spaces between < and >, so that it will appear properly on this page.

"< b >Some Text< /b >" would read as Some Text. "< i >Some Text< /i >" would read as Some Text.

Colors are a little different than usual because this function does not use NWN2's color constants. It derives its naming convention from this list. A full list of the colors used in NWN2 can be found in the NWN2_Colors.2da file.

The good news is that whereas NWN1 required you to enter a hexadecimal value NWN2 will take a name. For example if I wanted text that was brick colored I would write my string as:

"<color=firebrick>Some Text</color>"

Also, remember that you cannot use these around functions. <color=blue>GetName(oPC)</color> will not compile. The correct way to change the color of a string called by a function would be: "<color=blue>" + GetName(oPC) + "</color>", or when linking multiple strings together, "<color=blue>" + GetName(oPC) + " colors the string.</color>". The idea is to treat the style coding as you would any normal string

These style conventions are not limited to this function. NWN2 uses them all over the place. You can use them in strrefs or in item names for example.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.