Aller au contenu

Photo

Getting NPC's to sit (on a bench)


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

#1
AeitZean

AeitZean
  • Members
  • 7 messages
I have read so many tutorials, and none of them seem to be up to date enough to work.

i've tried NW_CHAIR with a nw_c2_sitting heartbeat and it wont work

ive tried this: http://nwn2.forumup....ut281-nwn2.html
which mostly works but only if the bench is an environmental object and therefore the PCs can walk through it

and I cant find a tutorial that explains what objects can or cant be sat on by what creatures using ActionSit, or how to actually work it.

Help?

thanks

#2
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
ActionSit, and NW_CHAIR, are vestigial bits from NWN1 that no longer work in NWN2. In NWN2, you have to use PlayCustomAnimation to command the NPC to play the sitting animation. The method I use is to lay down a waypoint with a unique tag right where you want the NPC to sit. On the NPC's heartbeat script, you write something like:



location lLoc = GetLocation(GetObjectByTag(sWPTag));

JumpToLocation(lLoc);

PlayCustomAnimation(OBJECT_SELF, "sitidle", TRUE);



The chair itself doesn't matter, they can be sitting in mid-air as far as the scripting is concerned. The only issue is that you need to make sure the waypoint is in a walkable area. For a bench, you could turn the bench into an environmental object, and then lay down a walkmesh cutter along the back of the bench, to keep NPCs from walking through it, while keeping the front edge free for NPCs to approach and sit.

#3
AeitZean

AeitZean
  • Members
  • 7 messages
@Lugaid of the Red Stripes



there are no words to explain how grateful I am.



Thank You.