recording speech

Moderator: Event DM

User avatar
NoneOf Seven
Knight of Useless Drivel
Posts: 50
Joined: Mon May 26, 2003 8:19 am
Location: in your shadow

recording speech

Post by NoneOf Seven » Thu Jun 12, 2003 8:10 am

following scenario:

Person A is in one location, Person B in another (may be the same area, but probably a different room.

A talks into a hole in the wall, wheras B listens to the other side of the hole.

I want this talk "transmitted" to B's location, and be "spoken" there.

so I need a few hints on how to

a) pick up any talk in one location
b) have it output elsewhere (which is probably the easier part)
the dark shadow, created by the light.

I am none, but all
User avatar
maxinion
Team Member; Retired with Honors
Posts: 2778
Joined: Mon Mar 17, 2003 7:44 pm
DM Avatar: Andrinor
Location: Bay Area, CA
Contact:

Post by maxinion » Fri Jun 13, 2003 12:57 am

hmmm... not sure exactly how to do this. picking up the speech is the hard part, as I dont' know how to do it... I know Shadowlords 3, the module, had a feature like this, in the beginning of the dungeon (its one big dungeon). You could probably just jack that part of the script for parsing the text. To get the peephole effect, make clicking on the hole set a variable, and when they leave the area or soemthing, change it back to normal. Have the above script run if and only if the variable is set to true. Then have the peephole object SpeakString() the text which you got through the previous script.
Yen-lo Wang
Squire of Babble
Posts: 26
Joined: Sat Apr 05, 2003 8:35 pm

Post by Yen-lo Wang » Fri Jun 13, 2003 1:08 am

You need to set listening patterns, I believe. As far as I know you could either do it with a NPC (easier) or a placeable (harder). You probably want a placeable in this case, since I'm assuming what you're after is anonymity. The only way I know to do it involves a hb script, though.
User avatar
NoneOf Seven
Knight of Useless Drivel
Posts: 50
Joined: Mon May 26, 2003 8:19 am
Location: in your shadow

Post by NoneOf Seven » Fri Jun 13, 2003 7:17 am

hmm... heartbeat scripts are probably either disallowed or extremely frowned upon...

*sighs*

Perhaps an invisible NPC that's rooted to the spot and serves as a relay... Or would a NPC also need a heartbeat script ?
the dark shadow, created by the light.

I am none, but all
User avatar
Jordicus
Team Member; Retired with Honors
Posts: 8042
Joined: Tue Jan 21, 2003 3:46 pm
Location: Whitehall, PA (GMT -4)
Contact:

Post by Jordicus » Fri Jun 13, 2003 11:18 am

don't think so...

you could use an invisible NPC and a trigger on the ground, so that when the triggers OnEnter activates whatever routine you need the NPC to do and the OnExit deactivates it.
User avatar
NoneOf Seven
Knight of Useless Drivel
Posts: 50
Joined: Mon May 26, 2003 8:19 am
Location: in your shadow

Post by NoneOf Seven » Fri Jun 13, 2003 11:24 am

That does actually sounds feasible.

So I have to combine the following ingredients:

An invisible NPC that has a listenening pattern and thus is able to record the spoken words.

A trigger that activates said NPC

A means of outputting the recorded words, for instance by another invisible NPC, or by FloatingTextOnCreature or similar.

Now I Just need to find a tutorial on listening patterns...

Thank you !
User avatar
j5hale3
Apprentice Scholar
Posts: 964
Joined: Tue Jan 14, 2003 3:23 am
Location: Central NJ {EST (GMT -5) and EDT (GMT -4)}

Post by j5hale3 » Fri Jun 13, 2003 11:43 am

Random psysic answer warning: (means I don't know jack shit about it but here's a thought)

Could the scribe function help in this case?? It seems similar to what you are trying to do. as speak to scribe---> becomes note on board.

Just a thought.

Best regards,
Dhalmoh
Prince of Bloated Discourse
Posts: 193
Joined: Sat Jun 07, 2003 4:12 pm

Post by Dhalmoh » Fri Jun 13, 2003 11:48 am

That does actually sounds feasible.

So I have to combine the following ingredients:

An invisible NPC that has a listenening pattern and thus is able to record the spoken words.

A trigger that activates said NPC

A means of outputting the recorded words, for instance by another invisible NPC, or by FloatingTextOnCreature or similar.

Now I Just need to find a tutorial on listening patterns...

Thank you !
Okay, when you come up with the answer to this. Post it here so i can use it in my own house. Sounds dope
User avatar
Jordicus
Team Member; Retired with Honors
Posts: 8042
Joined: Tue Jan 21, 2003 3:46 pm
Location: Whitehall, PA (GMT -4)
Contact:

Post by Jordicus » Fri Jun 13, 2003 12:03 pm

User avatar
NoneOf Seven
Knight of Useless Drivel
Posts: 50
Joined: Mon May 26, 2003 8:19 am
Location: in your shadow

Post by NoneOf Seven » Fri Jun 13, 2003 12:31 pm

Thank you for the pointers.

I think I have an idea for the script so that it listens to every sentence.

the combination of

Code: Select all

SetListeningPattern
SetListening
GetMatchedSubstring
should do the trick.

Pity that there doesn't seems to be any function that returns the whole line that was said, but only the substring that fits the search pattern. If someone knows one, please direct me to it...

(the scribe from the bulletin board seems to be an ideal object to dissect. Does anybody have his script at hand ?)
the dark shadow, created by the light.

I am none, but all
User avatar
Praetor
Apprentice Scholar
Posts: 542
Joined: Sun Jan 05, 2003 5:07 am
Contact:

Post by Praetor » Fri Jun 13, 2003 1:53 pm

This is a relatively interesting idea, so I scripted this up. Unfortunately, it does have one drawback. In order to get an object to call an on conversation event, that object needs to be a creature (i.e. placeables can't hear stuff). This isn't a huge deal, as you can still give it a null body and give it no name. Unfounately, if the player hits tab or mouses over it, mouse tip feedback will hover Uninjured over the creature's head. Like I say, not a huge deal, but players will realize something is up ooc. anyways, if you want to use the script, I put it into erf format and uploaded it to my homepage at:

http://homepage.usask.ca/~mtm685/NWN/peephole.erf

Follow the instillation instructions to use it.
Yen-lo Wang
Squire of Babble
Posts: 26
Joined: Sat Apr 05, 2003 8:35 pm

Post by Yen-lo Wang » Fri Jun 13, 2003 3:03 pm

Sorry, I meant if you used placeables you needed a hb...for NPCs its just the listening events, no need for triggers. Like Praetors done, I think
User avatar
NoneOf Seven
Knight of Useless Drivel
Posts: 50
Joined: Mon May 26, 2003 8:19 am
Location: in your shadow

Post by NoneOf Seven » Fri Jun 13, 2003 9:52 pm

Praetor,

many thanks for this .erf, you spared me a lot of work.

Is it possible to attach improved invisibility to the listening NPC ? This should take care of the visible Uninjured tag, right ?
the dark shadow, created by the light.

I am none, but all
User avatar
maxinion
Team Member; Retired with Honors
Posts: 2778
Joined: Mon Mar 17, 2003 7:44 pm
DM Avatar: Andrinor
Location: Bay Area, CA
Contact:

Post by maxinion » Fri Jun 13, 2003 11:44 pm

Heh... I'm pretty sure everyone in your home will have floaty eyes anyway, so improved invis won't help much. You can make a trigger for on enter to apply effect invis on it, though.
Yen-lo Wang
Squire of Babble
Posts: 26
Joined: Sat Apr 05, 2003 8:35 pm

Post by Yen-lo Wang » Fri Jun 13, 2003 11:54 pm

Or just spawn it invis. Or make it sneak on spawn, which would cut out the lower level floaty eyes (see invis). I really need to type more clearly
Last edited by Yen-lo Wang on Sat Jun 14, 2003 12:57 am, edited 1 time in total.
Dhalmoh
Prince of Bloated Discourse
Posts: 193
Joined: Sat Jun 07, 2003 4:12 pm

Post by Dhalmoh » Sat Jun 14, 2003 12:38 am

Just wondering, i didnt test it yet. But when i implemented the .erf file, it said i needed to change the taggs. Im not sure i understand, did you script it so that if only the tags match then they will be connected ?
So all i acctually have to do is come up with tags like your description and they will be connected, then i am free to change the names so perhaps 1 of the speakers is named "Livingquarters" so i know what im hearing from where?

Also about onspawn hide/movesilently, how do i make that work?

And this last part, do i need a genetric trigger in order to spawn/make the speaker and listener work ?

Im no scripter, just wanted to clarify this.
And great work btw, fancy scripts own bad
Dhalmoh
Prince of Bloated Discourse
Posts: 193
Joined: Sat Jun 07, 2003 4:12 pm

Post by Dhalmoh » Sat Jun 14, 2003 2:08 am

I've come up with some questions.

1. I will make the listeners visible, and have them standing about and have a conversation to initiate. So they say something like "This is the guestquarters".
So now i don't have to conceal them. But i had some problems with the conversation, i could'nt make them as usuall. He didnt initiate the conversation even though i clicked on him..

2. Is it possible to have the speakers say what is beeing said in the other room without having to talk to them to initiate it?

3. Can my speakers be scripted so they give a message when something enters their line of sight. So they say something like : "We have guests in the livingquarters"?

edit:
4. How do i change the way the speakers present what is beeing said?
My rooms are not adjecant, so it's not suiting that it says: "you hear <blablabla> in the next room"
User avatar
Praetor
Apprentice Scholar
Posts: 542
Joined: Sun Jan 05, 2003 5:07 am
Contact:

Post by Praetor » Sat Jun 14, 2003 3:36 am

I'll answer a few of these questions, though this is probally going to be about as much support as I give this thing. There is also a new version of the file up which includes the improved invis on spawn and moves some code in the on user defined event to make it more modular. It works exactly the same though.
______________________

NoneOfSeven: You were definately on the right track, this is just a little boost to give you an example of how to hurry it along. As for your question.

In the onspawn script (mm_9_peephole), attach the following line to make the listener have improved invis, then recompile... or download the new version in which I already did that.

Code: Select all

// Insert this at the bottom of the file right after the SetListening line
    ApplyEffectToObject(DURATION_TYPE_PERMANENT,SupernaturalEffect(EffectInvisibility(INVISIBILITY_TYPE_IMPROVED)),OBJECT_SELF);
As for sneak on spawn, I did select that setting, and maxed out its hide and sneak skills, but it doesn't sneak for some reason. Not a big deal though.

For Dhalmoh:

I'll answer a few of your questions, but I'd recommend getting a bit mroe familiarity with the toolset and the scripting language (C-based). There are a lot of examples at NWVault, and the NWNLexicon has a great function reference. By examining Vault scripts, you can probally get ideas how to do a lot of what you're looking at. Now for the answers.

To link the two, the tags after the first _ must match (i.e. PHD_anythingunique and PHS_anythingunique). I figured that your name would be a good suggestion because each tag pair must have a unique ending. As for the Name field, the name can be absolutely anything that you want. Keep in mind that vanor will probally charge a fair bit for these peep holes.

You currently don't have to either npc to initiate the transfer. Just give the game engine a few seconds after the module starts to load all the tiles, placeables, and creatures. After that it will start handling events.

To change how the voices are reported, simply open the script file "mm_od_peephole". Near the bottom, you'll see text that says "You hear muted voices from the next room" - simply change that to whatever you want it to read.

To get changes to take effect, such as attching a conversation, be sure to Update Instances if you made the changes to the blueprints.

Finally, to make them work, just place an instance of each in your module and link the tags as described above. No triggers or anything like that.
Dhalmoh
Prince of Bloated Discourse
Posts: 193
Joined: Sat Jun 07, 2003 4:12 pm

Post by Dhalmoh » Sat Jun 14, 2003 1:12 pm

edited:
ok, these are the remaining questions.
I got all the things you said to work :)

I'd like to make a teleportation script.
Let me explain..

In my stronghold, i have one room that has a quest-door and only 1 tile circle.
In there i can hear what is beeing said around the house. Also i have a NPC helmethorror there, that i want to be able to transport me to various locations. (4 in all)

But also, inside my stronghold, i want to have two pressureplates or something else that i can step on and get transported to the room with the helmethorror.
It's very important that these plates check for the key, that should be fairly easy? Onuse check for the key and then autolock after ?

Can i be given some pointers. Or just make the .erf and send me, after this im going to be done...
Dhalmoh
Prince of Bloated Discourse
Posts: 193
Joined: Sat Jun 07, 2003 4:12 pm

Post by Dhalmoh » Sat Jun 14, 2003 8:31 pm

Important.
I have made the pressureplates that teleport me, i used a generic trigger with a waypoint where i wanted to go. And got a friend to make me that script. Now all i would like is for that trigger only to trigger when i carry a spesific key....

here is what i got so far:
void main()
{

object oPC = GetEnteringObject();

if (!GetIsPC(oPC)) return;

AssignCommand(oPC, ClearAllActions());

object oTarget;
oTarget = GetWaypointByTag("Destination");

DelayCommand(3.0, AssignCommand(oPC, ActionJumpToObject(oTarget)));

oTarget = oPC;

ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget));

}
So where do i put the part that only triggers if it the "last used by" returns true when it comes to carrying a key?
User avatar
JollyOrc
Elder Sage
Posts: 3984
Joined: Fri Jan 17, 2003 11:41 am
Timezone: Europe, CE(S)T
Location: Germany
Contact:

Post by JollyOrc » Sat Jun 14, 2003 9:43 pm

you do need to insert a check if the oPC object has the specified key in his inventory. Don't know the exact function for it, but it should look something like:

Code: Select all

if HasItemInInventory("tag_of_key_as_string", oPC)
{
//insert script to teleport here
}
else
{
//nothing happens
}
Dhalmoh
Prince of Bloated Discourse
Posts: 193
Joined: Sat Jun 07, 2003 4:12 pm

Post by Dhalmoh » Sat Jun 14, 2003 10:10 pm

void main()
{

object oPC = GetLastUsedBy();

if (!GetIsPC(oPC)) return;

if (GetItemPossessedBy(oPC, "MasterKey")== OBJECT_INVALID)
return;

AssignCommand(oPC, ClearAllActions());

object oTarget;
oTarget = GetWaypointByTag("Destination");

DelayCommand(1.0, AssignCommand(oPC, ActionJumpToObject(oTarget)));

oTarget = oPC;

ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget));

}
This is what i got sofar, with help. It works great, i put it on use on a Pressure plate instead of the generic trigger.
But i have one problem, as you see it's delayed 1 sec. I would like to put an effect on my waypoint after 1 sec. So when i step on the pressureplate i get unsummon effect. And then i get summon monster on the destination, shouldnt that work ?
User avatar
Mistcaller
Team Member; Retired with Honors
Posts: 5477
Joined: Sun Feb 09, 2003 3:42 pm
Location: Athens, Greece (GMT +2)

Post by Mistcaller » Thu Sep 11, 2003 12:29 pm

I would like my NPC to record in 2 LocalStrings the first two words a PC says.... Is this possible? Any ideas?
Morbid Ridicule
Apprentice Scholar
Posts: 530
Joined: Fri Feb 28, 2003 2:38 pm
Location: Madison, WI, USA (GMT -5 or -6)
Contact:

Post by Morbid Ridicule » Fri Sep 12, 2003 12:12 am

Well... those waitresses know when you call 'em somehow.
Can't sleep - Clowns will eat me.
User avatar
Mistcaller
Team Member; Retired with Honors
Posts: 5477
Joined: Sun Feb 09, 2003 3:42 pm
Location: Athens, Greece (GMT +2)

Post by Mistcaller » Fri Sep 12, 2003 11:55 am

The problem is how the NPC will sort out which are the first two words, either from a sentence or from a series of 4-5 different one-word sayings.

I mean I know by SetListening ,the NPC is able to listen to what you say. But how can he store just a pre-defined part of your words?
Post Reply