Server Totals
M'Chek - (4)
Wilderness - (2)
Ferrell - (0)
Elysia - (0)
Le'Or - (0)
Deglos - (0)
Visimontium - (0)
Underdark - (0)
Mikona - (0)
Total players: 6
Gallery

Links Menu

detecting what a pc says

Moderators: Nighthawk4, Dungeon Masters

detecting what a pc says

PostAuthor: girlysprite » Thu Apr 20, 2006 10:14 am

another scripting issue

Can I detect when a pc says 'I disbelieve'. Not in a conversation, but when the player types it.
Gaming doesn't make people voilent, lag does

<Dimotane> I think deep down, when we're honest with ourselves... we're all a pregnant male elf.
User avatar
girlysprite
Silver Contributor
 
Posts: 3661
Joined: Mon Apr 12, 2004 2:38 pm
Location: In my little pony ranch

PostAuthor: scratch » Thu Apr 20, 2006 12:17 pm

So you are asking if a PC says a specific phrase, activate a script or such?
User avatar
scratch
Lord of Blithering Idiots
 
Posts: 127
Joined: Sun Nov 14, 2004 2:39 pm

PostAuthor: PsiOmega » Thu Apr 20, 2006 12:39 pm

You'll need a NPC in the area who'll pick up the line in the OnPercieve event. The NPC may or may not be invinsible depending on your needs.

Don't know how to script it though as I've never tried.
User avatar
PsiOmega
CCC
CCC
 
Posts: 4901
Joined: Tue Jun 08, 2004 4:55 pm
Location: Sweden
Timezone: GMT+1/+2 (DST)

PostAuthor: girlysprite » Thu Apr 20, 2006 1:05 pm

I already finished it: let me share

I got an cutscene invisible pixie (which means undetectable by any means)

On the onSpawn script is the listening code

Code: Select all
   SetListening(OBJECT_SELF,TRUE);
    SetListenPattern(OBJECT_SELF,"I disbelieve",2001);


I listens for the sentence 'I disbelieve'

Now, for things to happen, I made another sciprt in onConversation, which also fires if the PC types something.

Code: Select all

void main()
{
         int nUser = GetUserDefinedEventNumber();
   int nMatch = GetListenPatternNumber();

    if(nMatch == 2001)
    {

    object oTarget;
object oSpawn;
location lTarget;
oTarget = GetWaypointByTag("fog_02");

lTarget = GetLocation(oTarget);

oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "zep_fog001", lTarget);

oTarget = GetWaypointByTag("fog_01");
}}


a fog item appears at a certain waypoint when I say this. Of course, now i realize I have to make set a variable, also have it checked...otherwise too many fogs can spawn if the player repeats the sentence.
Gaming doesn't make people voilent, lag does

<Dimotane> I think deep down, when we're honest with ourselves... we're all a pregnant male elf.
User avatar
girlysprite
Silver Contributor
 
Posts: 3661
Joined: Mon Apr 12, 2004 2:38 pm
Location: In my little pony ranch

PostAuthor: Tigg » Thu Apr 20, 2006 4:36 pm

sounds neat... when are you going to start making stuff for Avlis, hmm? :)

if the PC has true seeing or, in this case, see invis, does the cutscene stuff still show up when they hit tab, as "name/uninjured"? if it does another option might be to make a 'statue' NPC.

anyways, good luck!
Ua mau ke ea o ka ina i ka pono.
User avatar
Tigg
Elder Sage
 
Posts: 3491
Joined: Wed Feb 09, 2005 11:18 pm
Location: Into the sunset/Hyboria

PostAuthor: girlysprite » Thu Apr 20, 2006 4:41 pm

Cut scene invisible can not be detected in any way. Name also doesnt show up. Sounds that an npc emits, like twinkeling from a pixie, can be heard. Also, if the npc is hostile, it will attack, and the invi wont wear off.

Hm, maybe I should indeed apply as builder for avlis.
Gaming doesn't make people voilent, lag does

<Dimotane> I think deep down, when we're honest with ourselves... we're all a pregnant male elf.
User avatar
girlysprite
Silver Contributor
 
Posts: 3661
Joined: Mon Apr 12, 2004 2:38 pm
Location: In my little pony ranch

PostAuthor: Papainhell » Thu Apr 20, 2006 4:53 pm

You could use an invisable object as well, no need to mess with a creature.
Image
Playing as:
Master Odel Helmsplitter
Odel Helmsplitter- Hammer Fist Stylist, monk of The Order of The Dragon.
User avatar
Papainhell
Sage
 
Posts: 2141
Joined: Wed Oct 01, 2003 1:09 am
Location: Kodiak, Alaska (for now)
Timezone: Time?

PostAuthor: PsiOmega » Thu Apr 20, 2006 4:58 pm

But placeables lack the OnPercieve and OnConversation events.
Using OnUserDefined somehow?
User avatar
PsiOmega
CCC
CCC
 
Posts: 4901
Joined: Tue Jun 08, 2004 4:55 pm
Location: Sweden
Timezone: GMT+1/+2 (DST)

PostAuthor: girlysprite » Thu Apr 20, 2006 8:26 pm

It is possible, but this way was easier for me.
Gaming doesn't make people voilent, lag does

<Dimotane> I think deep down, when we're honest with ourselves... we're all a pregnant male elf.
User avatar
girlysprite
Silver Contributor
 
Posts: 3661
Joined: Mon Apr 12, 2004 2:38 pm
Location: In my little pony ranch

PostAuthor: Krator » Thu Apr 20, 2006 9:20 pm

Papainhell wrote:You could use an invisable object as well, no need to mess with a creature.


If it was anyone else who said this I'd say "No, you can't."

But now I'm curious. Could you give an example code?
User avatar
Krator
Elder Sage
 
Posts: 4947
Joined: Thu Jun 10, 2004 6:44 pm
Location: Amsterdam
Timezone: GMT

PostAuthor: Sindol » Fri Apr 21, 2006 7:14 am

The library is your friend: http://www.avlis.org/viewtopic.php?t=18686.
(Apologies to those folks that don't have access. The Avlis library is only available for team members and subcontractors, apply if you are interested.)
So much fun,
yet so little time to enjoy it.
- Sindol
User avatar
Sindol
Team Member; Retired with Honors
 
Posts: 6487
Joined: Mon Jan 06, 2003 4:23 pm
Location: Nijmegen - Netherlands (GMT+1)


Return to NWN Scripting

Who is online

Registered users: Bing [Bot], Cartmen, Google [Bot], Lucidic, Moredo