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

Links Menu

changing listening patterns

Moderators: Nighthawk4, Dungeon Masters

changing listening patterns

PostAuthor: JollyOrc » Sat Jan 10, 2004 9:01 pm

is it possible to set / change listening patterns during runtime, instead at onspawn ?
User avatar
JollyOrc
QA Resource
 
Posts: 3900
Joined: Fri Jan 17, 2003 11:41 am
Location: Germany
Timezone: GMT+1

PostAuthor: KinX » Fri Jan 16, 2004 3:30 pm

How do you want to change the variables at run-time?
Never argue with an idiot, they'll drag you down to their level and beat you with experience

Image

This statement is false
User avatar
KinX
Elder Sage
 
Posts: 4968
Joined: Tue Sep 10, 2002 2:53 pm
Timezone: GMT +1

PostAuthor: Brannor » Fri Jan 16, 2004 3:32 pm

Don't see why not.
You would just need to keep the string being compared to out of the script.
Save it as a localstring on the char and load it on demand.
All posts are made as a player unless otherwise noted or in the team boards.
-------------------------------------------------------
Roses are 0xFF0000
Violetts are 0x0000FF
all my base
are belong to you

Brannor
Scholar
 
Posts: 1435
Joined: Tue Nov 19, 2002 7:12 am
Location: Bavaria / Germany

PostAuthor: JollyOrc » Fri Jan 16, 2004 3:38 pm

what I would want, for instance:

- Change codewords
- switch listening on or off entirely
- make an NPC listen to something else occasionally

one possible use:

1. activate listening (as with the scribe at the bulletin boards)
2. speak a codeword
3. deactivate listening, save the codeword
4. switch on listening on another NPC
5. this other NPC now waits to hear the codeword to deliver something / open door / etc...
User avatar
JollyOrc
QA Resource
 
Posts: 3900
Joined: Fri Jan 17, 2003 11:41 am
Location: Germany
Timezone: GMT+1

PostAuthor: Mistcaller » Fri Jan 16, 2004 3:45 pm

Yea, I think with a persistent string variable (or local) you can do it...

i.e. (not sure if it works)

OnSpawn: Load Persistent string and store it on a Local string. Set 2 listening patterns: one that activates the password-check procedure, call it A, and one that fires the password-change procedure, call it B.

On Listening to A, the password-check is activated.
Read the Local String Variable and maybe set a new Listening pattern for it, if necessary (in the OnConversation event ).
Test matching with next spoken word (the actual password) and act accordingly.

If that next spoken word is the other pre-defined word (B), then you can speak one more word that is stored locally and in the persistent string as the new password.
User avatar
Mistcaller
Team Member; Retired with Honors
 
Posts: 5481
Joined: Sun Feb 09, 2003 3:42 pm
Location: Athens, Greece (GMT +2)

PostAuthor: KinX » Fri Jan 16, 2004 4:14 pm

Is this how you want a conversation to look like?

PC: Activate

NPC: ok i'm listening

PC: codeword

NPC: you have been verified to be who you are

PC: change

NPC: Speak the new codeword

PC: newcode

NPC: "newcode" is now the password

PC: Get me some ale

NPC: sure thing

PC: deactivate

NPC: i'm now not listening.


I just want to make sure that's how you want things to work, because i want to do something like this too
Never argue with an idiot, they'll drag you down to their level and beat you with experience

Image

This statement is false
User avatar
KinX
Elder Sage
 
Posts: 4968
Joined: Tue Sep 10, 2002 2:53 pm
Timezone: GMT +1

PostAuthor: Mistcaller » Fri Jan 16, 2004 4:18 pm

KinX wrote:Is this how you want a conversation to look like?

PC: Activate

NPC: ok i'm listening

PC: codeword

NPC: you have been verified to be who you are

PC: change

NPC: Speak the new codeword

PC: newcode

NPC: "newcode" is now the password

PC: Get me some ale

NPC: sure thing

PC: deactivate

NPC: i'm now not listening.


I just want to make sure that's how you want things to work, because i want to do something like this too


Yup, that was exactly what I had in mind, though I cannot test it right now to be certain it works (especially the part that you set a listening pattern in the OnConversation event). And no need to de-activate him... he is de-activated already, until he listens to the 'activate' word.
User avatar
Mistcaller
Team Member; Retired with Honors
 
Posts: 5481
Joined: Sun Feb 09, 2003 3:42 pm
Location: Athens, Greece (GMT +2)

PostAuthor: Halvar Yanocen » Fri Jan 16, 2004 4:23 pm

I'm sure that features like this will make player owned inns alot more popular among the guests.
The forest is vast and the council of nine is far away.

Halvar Yanocen
Apprentice Scholar
 
Posts: 854
Joined: Mon Sep 29, 2003 10:11 pm
Location: GMT+2

PostAuthor: JollyOrc » Fri Jan 16, 2004 7:18 pm

heh... sounds good then.

Basically I just wanted to know that SetListeningPattern() works outside the onspawn event...

Seems to be that way, will test it soon :D
User avatar
JollyOrc
QA Resource
 
Posts: 3900
Joined: Fri Jan 17, 2003 11:41 am
Location: Germany
Timezone: GMT+1

PostAuthor: Aloro » Fri Jan 16, 2004 7:55 pm

JollyOrc wrote:heh... sounds good then.

Basically I just wanted to know that SetListeningPattern() works outside the onspawn event...

Seems to be that way, will test it soon :D


Sure, you can set these at any point. I've done so a few times off triggers and other media.

- Aloro
Aleksandr Solzhenitsyn wrote:The meaning of earthly existence lies, not as we have grown used to thinking, in prosperity, but in the development of the soul.
User avatar
Aloro
Team Member; Retired with Honors
 
Posts: 12810
Joined: Sat Dec 28, 2002 5:11 am
Location: Rainbow's End


Return to NWN Scripting

Who is online

Registered users: Bing [Bot], QuizatzHaderach, Yahoo [Bot]