Author Topic: Can an NPC see PC Chat?  (Read 323 times)

Legacy_AmbrosiaPW

  • Jr. Member
  • **
  • Posts: 70
  • Karma: +0/-0
Can an NPC see PC Chat?
« on: April 22, 2011, 07:35:51 pm »


               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.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Can an NPC see PC Chat?
« Reply #1 on: April 22, 2011, 08:09:59 pm »


               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.
               
               

               
            

Legacy_AmbrosiaPW

  • Jr. Member
  • **
  • Posts: 70
  • Karma: +0/-0
Can an NPC see PC Chat?
« Reply #2 on: April 22, 2011, 08:24:50 pm »


               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?
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Can an NPC see PC Chat?
« Reply #3 on: April 22, 2011, 09:26:44 pm »


               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.
               
               

               
            

Legacy_AmbrosiaPW

  • Jr. Member
  • **
  • Posts: 70
  • Karma: +0/-0
Can an NPC see PC Chat?
« Reply #4 on: April 22, 2011, 09:44:01 pm »


               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.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Can an NPC see PC Chat?
« Reply #5 on: April 22, 2011, 09:54:38 pm »


               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 .