Help, script speed color
#1
Posté 05 novembre 2011 - 10:37
And if anyone can also a script for when a new player enters or if anything has changed in your account for a password. If the password is invalid, you leave the game.
thanks
#2
Posté 08 novembre 2011 - 03:14
#3
Posté 08 novembre 2011 - 06:14
For colored chat text, I personally use an include file to add a ColorText() function in my module's OnPlayerChat script. I have the chat script look for specific characters at the start of the entered text (// double slashes for grey "OOC" text, .. double periods for "emotes"), then colorize the rest of the text string before replacing the output text (SetChatMessage()?).
I'll see about digging into my chat script to try to dig up the specific code for the text coloring. It's embedded somewhere in the middle of about 1000 lines of code.
Not sure on the original source of the include file...probably a generous poster on the old BioWare boards. I've been using it for years.
Edit: Forum seem to be able to properly handle the code for the include file. Link: inc_colortext.nss (right-click and "Save Link As..." to download.
color chat sample
// Colorized Onchat text
// merge into your own onplayerchat script
#include "inc_colortext"
void main()
{
string sInput = GetPCChatMessage();
string sFirst = GetStringLeft(sInput, 1);
string sLast = GetStringRight(sInput, 1);
if (sFirst == "*" && sLast == "*") // Special Text Type 1
{
sInput = ColorText(sInput, 255, 0, 255);
SetPCChatMessage(sInput);
}
else if (sFirst == "(" && sLast == ")") // Special Text Type 2
{
sInput = ColorText(sInput, 200, 200, 200);
SetPCChatMessage(sInput);
}
}
Modifié par The Amethyst Dragon, 08 novembre 2011 - 07:50 .
#4
Posté 12 novembre 2011 - 09:55
string sInput = GetPCChatMessage();
#5
Posté 12 novembre 2011 - 10:15
if you are not. and are not updated to 1.69 I do not think there is any way for you to change the color of the PC's chat.
GetPCChatMessage was added in the 1.69 update. So you will at least need to run the critical rebuild if you are not at verson 1.69
http://www.neverwint...characterbasics
#6
Posté 13 novembre 2011 - 12:38
#7
Posté 13 novembre 2011 - 03:50
voignar wrote...
If I have installed the version 1.69
if you have 1.69 installed, I do not know, it compiled fine for me.
What error message are you getting?
#8
Posté 13 novembre 2011 - 10:09
#9
Posté 13 novembre 2011 - 10:48
If you're still having problems, then I think the problem might be with your game version/patch level. Which version or patch level is yours?
#10
Posté 13 novembre 2011 - 12:06
Edit.:I reinstalled everything and updated to 1.69 and still does not compile, and of course, does not work.
Modifié par voignar, 13 novembre 2011 - 12:46 .
#11
Posté 13 novembre 2011 - 02:51
There are two scripts here to incorporate into you mod. One is the include which is accessed at that link, and the rest is the code pasted in the forum. You need both. Compile the include first. Then compile the other script.
Modifié par henesua, 13 novembre 2011 - 02:53 .
#12
Posté 13 novembre 2011 - 03:29
henesua wrote...
Did you compile the include?
There are two scripts here to incorporate into you mod. One is the include which is accessed at that link, and the rest is the code pasted in the forum. You need both. Compile the include first. Then compile the other script.
umm, You do not compile Include scripts. If a Include script does compile on its own, you have a problem.
#13
Posté 13 novembre 2011 - 03:57
This works even if there is "normal" text in the message.
e.g. You could say: I wonder why... *scratches head*
void main()
{
// Variables
object oPC = GetPCChatSpeaker();
string sText = GetPCChatMessage();
string sFinal = "";
int iAmRockstar = TRUE;
// Find color initiation
int iStart = FindSubString(sText, "*", 0);
if (iStart == -1) {iStart = FindSubString(sText, "(", 0); iAmRockstar = FALSE;}
if (iStart == -1) return; // :C
// Find color termination
int iEnd;
if (iAmRockstar) iEnd = FindSubString(sText, "*", iStart+1);
else iEnd = FindSubString(sText, ")", iStart+1);
// Reconstruct message
sFinal += GetSubString(sText, 0, iStart) + "<cÞ·/>";
if (iEnd>-1) sFinal += GetSubString(sText, iStart, iEnd+1 - iStart) + "</c>";
else iEnd = iStart -1;
sFinal += GetSubString(sText, iEnd+1, GetStringLength(sText) - iEnd+1);
// Send message
SetPCChatMessage(sFinal);
}It only allows one either ** or (), not both or more then one. Also allows one to type like this
I wonder why... (scratches head
Everything is colored after ( or *, until you get to ) or *, respectively.
Should work as it is if you put it to OnChat event of your module.
Modifié par Xardex, 13 novembre 2011 - 04:03 .
#14
Posté 13 novembre 2011 - 05:59
#15
Posté 13 novembre 2011 - 06:33
Your screenshot of your own functions filter for GetPC has the following first three missing:
GetPCChatMessage (1.69 addition)
GetPCChatSpeaker (1.69 addition)
GetPCChatVolume (1.69 addition)
(what your function list has)
GetPCIPAddress
GetPCItemLastEquipped
GetPCItemLastEquippedBy
GetPCItemLastUnequipped
GetPCItemLastUnequippedBy
GetPCLevelingUp
GetPCPlayerName
GetPCPublicCDKey
GetPCSpeaker
From the 1.69 release notes:
Script-specific:
· Added new scripting commands:
object GetPCChatSpeaker();
string GetPCChatMessage();
int GetPCChatVolume();
void SetPCChatMessage(string sNewChatMessage="");
void SetPCChatVolume(int nTalkVolume=TALKVOLUME_TALK);
FP!
Modifié par Fester Pot, 13 novembre 2011 - 06:49 .
#16
Posté 13 novembre 2011 - 06:56
#17
Posté 13 novembre 2011 - 07:02
Lightfoot8 wrote...
Are you running nwn with both expansion packs installed?
if you are not. and are not updated to 1.69 I do not think there is any way for you to change the color of the PC's chat.
GetPCChatMessage was added in the 1.69 update. So you will at least need to run the critical rebuild if you are not at verson 1.69
http://www.neverwint...characterbasics
here it is again.
EDI: The link just come in a little low on the page. scroll up a little.
Modifié par Lightfoot8, 13 novembre 2011 - 07:04 .
#18
Posté 13 novembre 2011 - 08:02
#19
Posté 13 novembre 2011 - 08:07
#20
Posté 13 novembre 2011 - 10:23
To check your toolset.exe version, load up the toolset.
Click the HELP dropdown.
Select ABOUT.
A version window will appear which will give you information on the toolset version as well as the update version.
Bioware Aurora Neverwinter Nights Toolset
Game Version: v1.69
NWToolset Version: vts030
Expansion Packs Installed:
Expansion Pack 1
Expansion Pack 2
It's worth noting that the proper 1.69 critical build file that Lightfoot linked to would need to be downloaded if by chance, you only have one or none of the expansion packs.
Also, pay attention to the patch window when the critical build file is run for any messages - such as errors - which may be preventing your version of Neverwinter Nights from being updated.
Another sure way to check the version of Neverwinter Nights is to cross reference the version number from the toolset, as mentioned above, to the version listed in the top left corner when you launch the game. They should match.
Third, you can open up your nwconfig.ini file, located in your Neverwinter Nights installation directory and the top two lines will give you the version update you're running as well.
[version]
Game=1.69
FP!
Modifié par Fester Pot, 13 novembre 2011 - 10:36 .
#21
Posté 13 novembre 2011 - 11:57
#22
Posté 14 novembre 2011 - 12:17
in the script editor.
select open new file and type nwscript in the "Resource Name" field
if it shows up with either the 'Module Resource Only' or Hak Pack Resource Only' radio buttons checked that that is your problem. The module builder was messing with something he should not have been and blocked the Patch from taking full effect.





Retour en haut






