changing listening patterns
Moderator: Event DM
- JollyOrc
- Elder Sage
- Posts: 3984
- Joined: Fri Jan 17, 2003 11:41 am
- Timezone: Europe, CE(S)T
- Location: Germany
- Contact:
changing listening patterns
is it possible to set / change listening patterns during runtime, instead at onspawn ?
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.
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
-------------------------------------------------------
Roses are 0xFF0000
Violetts are 0x0000FF
all my base
are belong to you
- JollyOrc
- Elder Sage
- Posts: 3984
- Joined: Fri Jan 17, 2003 11:41 am
- Timezone: Europe, CE(S)T
- Location: Germany
- Contact:
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...
- 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...
- Mistcaller
- Team Member; Retired with Honors
- Posts: 5477
- Joined: Sun Feb 09, 2003 3:42 pm
- Location: Athens, Greece (GMT +2)
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.
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.
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
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

This statement is false

This statement is false
- Mistcaller
- Team Member; Retired with Honors
- Posts: 5477
- Joined: Sun Feb 09, 2003 3:42 pm
- Location: Athens, Greece (GMT +2)
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.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
-
- Apprentice Scholar
- Posts: 854
- Joined: Mon Sep 29, 2003 10:11 pm
- Location: GMT+2
- Aloro
- Team Member; Retired with Honors
- Posts: 12805
- Joined: Sat Dec 28, 2002 5:11 am
- Location: Rainbow's End
- Contact:
Sure, you can set these at any point. I've done so a few times off triggers and other media.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
- 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.