Recent changes Random page
GAMING
Gaming
 
WoWWiki
Halopedia
FFXIclopedia
Age of Conan
Warhammer Online
Grand Theft Wiki
See more...

Sit on spawn and sit on conversation

From NWNWiki

Jump to: navigation, search

Contents

[edit] SitOnSpawn & SitOnConvers

This script will have an NPC sit OnSpawn and keep him sitting during a conversation *without* having him rotate around and follow you with his or her body after the conversation is over.


[edit] Notes

This first one goes in the NPC's OnSpawn script (I just named the script sitonspawn cause it was obvious). Also, if you have any conversation files for said NPC and you don't want them hopping up at the end of the conversation, in your conversation editor, put this script in both the Normal & Aborted scripts under the Current File tab all the way over to the right. Also, when you make an NPC and want him to sit somewhere, make a chair or invisible object or whatever with the tag of CHAIR_NPCTAG (aka if the NPC tag is Ralph, the chair tag should be CHAIR_Ralph).

[edit] SitOnSpawn Script

void main()
{
     SetListeningPatterns();
     WalkWayPoints();
     GenerateNPCTreasure();
          {
           string sMyTagName = GetTag(OBJECT_SELF);
           string sSittableTagName = "CHAIR_" + sMyTagName;
           int nChair = 1;
           object oChair;
           oChair = GetNearestObjectByTag(sSittableTagName, OBJECT_SELF, nChair);
           ActionSit(oChair);
           }
}


[edit] SitOnConvers Notes

This script goes in the OnConversation area of the NPC's scripts. I named it sitonconvers cause it's easy to remember.

[edit] SitOnConvers Scripts

void main()
{
     if(GetCommandable(OBJECT_SELF))
          {
               {
               BeginConversation();
               }
          ClearAllActions();
          int nChair = 1;
          string sMyTagName = GetTag(OBJECT_SELF);
          string sSittableTagName = "CHAIR_" + sMyTagName;
          object oChair = GetNearestObjectByTag(sSittableTagName, OBJECT_SELF, nChair);
          ActionSit(oChair);
          }
}
Rate this article:
Share this article: