A scriptive query ...
2 posters
Page 1 of 1
A scriptive query ...
, this question goes along with my suggestion post about the PnP item behavior,
Do you use any sort of script template for the OnPlayerChat function? I'm not sure exactly how it works, and the HoD package I downloaded suggested that the Dragon-supplied code be spliced into the existing script. But I don't have one.
And, as we all know that you're a scripting guru/crazy man, you seem the perfect choice to ask!
Do you use any sort of script template for the OnPlayerChat function? I'm not sure exactly how it works, and the HoD package I downloaded suggested that the Dragon-supplied code be spliced into the existing script. But I don't have one.
And, as we all know that you're a scripting guru/crazy man, you seem the perfect choice to ask!
Eric of Atrophy- Ludicrous Level
- . :
Number of posts : 4113
Age : 51
Location : Kea'au, HI, USA
Main Character : The Vault of Atrophy
NWN Username : atrophied_eric
DM Name : Dungeon Mistress Anaurra Lide
Time Zone : GMT - 10:00 EST (We have our own time zone!)
Registration date : 2008-06-06
Re: A scriptive query ...
I don't have a template script. The module really gets just one OnPlayerChat script (that actually captures the text strings from the chat bar)...I just tie a crapload of stuff into it via string comparisons and multiple ExecuteScript commands for different functionality.
There are only a few chat commands...look in the script editor for script functions that include "chat". With those, and other text string variables/functions, you can do a lot. You can start with something really basic and mess with it from there.
Here, I just took a minute to whip something up...
There are only a few chat commands...look in the script editor for script functions that include "chat". With those, and other text string variables/functions, you can do a lot. You can start with something really basic and mess with it from there.
Here, I just took a minute to whip something up...
- Code:
// Bare bones OnPlayerChat script
void main()
{
object oSpeaker = GetPCChatSpeaker(); // This is the one that did the typing
string sInput = GetPCChatMessage(); // This is what was typed into the chat bar
int nVolume = GetPCChatVolume(); // This is the "channel" that was used
// Now, you can do whatever you want from here onward.
}
Re: A scriptive query ...
Hey, , a thought ... could you move this post to the new scripting subforum? That'd be waaaay cool! Tanks in advance!
Eric of Atrophy- Ludicrous Level
- . :
Number of posts : 4113
Age : 51
Location : Kea'au, HI, USA
Main Character : The Vault of Atrophy
NWN Username : atrophied_eric
DM Name : Dungeon Mistress Anaurra Lide
Time Zone : GMT - 10:00 EST (We have our own time zone!)
Registration date : 2008-06-06
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum