A scriptive query ...

Go down

A scriptive query ... Empty A scriptive query ...

Post by Eric of Atrophy on Wed Oct 15, 2008 8:40 am

The Amethyst Dragon, 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. No

And, as we all know that you're a scripting guru/crazy man, you seem the perfect choice to ask! Exclamation
Eric of Atrophy
Eric of Atrophy
Seriously Epic Level
Seriously Epic Level

. : Dungeon Master
Male Number of posts : 3926
Age : 46
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

View user profile http://myanimelist.net/profile/Eric_of_Atrophy

Back to top Go down

A scriptive query ... Empty Re: A scriptive query ...

Post by The Amethyst Dragon on Wed Oct 15, 2008 10:16 am

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...

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.

}

_________________
.
------------------------------------- The Amethyst Dragon -------------------------------------
Creator of Aenea | Custom Content Maker | Dungeon Master | Builder | Scripter | Writer | Player | Sleepless
The Amethyst Dragon
The Amethyst Dragon
Ludicrous Level
Ludicrous Level

. : Creator of Aenea / Dungeon Master
Male Number of posts : 7839
Age : 43
Location : probably on the computer or wrangling his offspring
NWN Username : amethystdragon
DM Name : The Amethyst Dragon
Time Zone : GMT - 6:00 (Wisconsin)
Registration date : 2008-06-02

View user profile http://www.amethyst-dragon.com/nwn

Back to top Go down

A scriptive query ... Empty Re: A scriptive query ...

Post by Eric of Atrophy on Fri Nov 06, 2009 5:20 pm

Hey, The Amethyst Dragon, a thought ... could you move this post to the new scripting subforum? That'd be waaaay cool! Tanks in advance!
Eric of Atrophy
Eric of Atrophy
Seriously Epic Level
Seriously Epic Level

. : Dungeon Master
Male Number of posts : 3926
Age : 46
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

View user profile http://myanimelist.net/profile/Eric_of_Atrophy

Back to top Go down

A scriptive query ... Empty Re: A scriptive query ...

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum