Would you like to react to this message? Create an account in a few clicks or log in to continue.

A scriptive query ...

2 posters

Go down

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

Post by Eric of Atrophy Wed Oct 15, 2008 9: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
Ludicrous Level
Ludicrous Level

. : Dungeon Master
Male 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

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 Wed Oct 15, 2008 11: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
The Amethyst Dragon
Ludicrous Level
Ludicrous Level

. : Creator of Aenea / Dungeon Master
Male Number of posts : 7841
Age : 49
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

https://www.amethyst-dragon.com

Back to top Go down

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

Post by Eric of Atrophy 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
Ludicrous Level
Ludicrous Level

. : Dungeon Master
Male 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

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


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