Author Topic: NPCs ~ Some questions  (Read 442 times)

Legacy_LostChangeling

  • Newbie
  • *
  • Posts: 49
  • Karma: +0/-0
NPCs ~ Some questions
« on: April 23, 2015, 06:27:46 pm »


               

Hi, fellas, just thought I'd ask a few things about NPCs:


 


1. How do you set up an NPC so he/she/it will be found lying on the floor (as if dead) when first encountered by the player, only to stand up and assume a normal standing stance when the player talks to him/her/it, and then lie down again later when the conversation ends? Is there already a script that will make the NPC do this? I'm trying to simulate someone sleeping, waking up and talking to the player, then going back to sleep later.


 


2. Can an NPC who's neither a shop owner nor a henchman be made to be able to identify your items for you?


 


3. Can you make an NPC remain silent and turn away from you when you try talking to him/her/it? I'm trying to simulate an NPC who's angry with you.


 


I'd be most grateful if my queries could be attended to. Thanks in advance!



               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
NPCs ~ Some questions
« Reply #1 on: April 23, 2015, 11:22:26 pm »


               The sleeping NPC is explained here:

http://nwn.wikia.com...wn_and_kneeling


Here's an example of identifying items:

http://www.nwnlexico...e=SetIdentified


For an NPC who isn't a henchman, you can't use GetMaster to identify the PC, but there are other ways, such as GetPCSpeaker (if in conversation).


For back-turning or other non-verbal response, add a conditional node to the conversation which detects the "angry" state. Leave what the NPC says blank, add an action taken script, but no PC responses. No conversation will occur, but the action will.


The function for facing the PC is

http://www.nwnlexico...=SetFacingPoint


Add 180 degrees to face away.


You could even SetFacing a few degrees at a time, to achieve a class act like this:

https://m.youtube.co...h?v=oRNx_QK34B8