Aller au contenu

Photo

Can an NPC see PC Chat?


  • Veuillez vous connecter pour répondre
5 réponses à ce sujet

#1
AmbrosiaPW

AmbrosiaPW
  • Members
  • 35 messages
I apologize again for blowing up the forum.

Can an NPC see PC Chat? I've done the research on this and the closest I get is putting a script in my module's OnPlayerChat event. But how can I use it to trigger an NPC to do something? Do I have to write code for every NPC scenario that wants to see PC chat in that  OnPlayerChat
 script?

I can store the data by player name. (PCNAME - PCMessage) Then the NPC can check for PCNAME to access the last thing they said, but how do I trigger the NPC to do this?

Lets say I have an NPC and I want it to repeat what the PC says, just for starters to test. How would you go about doing this?

Thanks for your time and your expertise.

#2
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
I guess you could use the OnPlayerChat Event to do this.  It is a little bit of on over kill however, Since the event will fire even if the PC in not in the same Area as the player.   To make one NPC listen you would be better off useing:

Function - SetListeningPatterns

and

Function - SetListening


You will then be able to catch what the NPC hears in the:

Event - OnConversation

for the NPC.

#3
AmbrosiaPW

AmbrosiaPW
  • Members
  • 35 messages
Awesome thank you. I read about listen but couldn't find it in the lexicon.

So does this mean an NPC can only "hear" a shout? Not just regular chat?

#4
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
No a NPC can hear normal chat if they can see the Object that is chating. They will hear a shout even if the object shouting in in another area or they can not see it. Pretty much the same rules that your PC follows.

#5
AmbrosiaPW

AmbrosiaPW
  • Members
  • 35 messages
Ok thanks, I found the recent topic about "Listening Patterns help". I just wish it wasn;t such a pain in the butt to test. Save module, move file to server, start server, wait to log in.

#6
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
When you are in the toolset just hit F9 It will start a module with the first player in your vault.

I would also sugggest that you not do your testing in your full module, rather create a smaller module just for testing.

Modifié par Lightfoot8, 22 avril 2011 - 08:55 .