BioWare Forums: View Post For Code Display


You are viewing a single post. Please do not take this post out of context.
Read the full topic: Post Working Scripts Here

Author Sticky: Post Working Scripts Here
Weeping Ashes Posted: Monday, 01 July 05:01PM
Well my friends.. Your NPC sitting and talking problems are OVER... I FINALLY figured out how to make an NPC is in a char and talk to you and not follow you with his eyes. So here it is..

1. NPC - Sit and Chat

2. Causes NPC to sit in a chair while talking to you. NPC does NOT follow you with his/her eyes and spin around on the chair.

3. Place this script in the OnConversation part of your scripts tag for the NPC remembering to change your tags correctly for the chair/bench/cheast/ect. Be sure to have a scripting of a sit command in your OnSpawn script so that the NPC will be sitting BEFORE you start talking to it. (Putting a sit script in your OnHeartbeat or OnPerception works just as well.)

NWScript:
////////////////////////////////////////////
////////////////////////////////////////////
//////  NPC - Sit and Talk
//////  Causes NPC to sit and face in the
//////  Direction of the chair while talking
//////  to the PC.
////////////////////////////////////////////
////////////////////////////////////////////
//////  Scripted by: Weeping Ashes
//////  Date:  July 1, 2002
//////  Scripting Time:  33hrs 14 mins
//////  Is aware he is a newbie...
////////////////////////////////////////////
////////////////////////////////////////////
/////  Make sure you have a sit command in
/////  OnSpawn part of your NPC.  Otherwise
/////  This will make the NPC sit AFTER the
/////  conversation.
////////////////////////////////////////////
////////////////////////////////////////////
void main()
{
    if(GetCommandable(OBJECT_SELF)){
     //This sets the NPC as the speaker
    {
        BeginConversation();
         //This starts the conversation script.
        }
    ClearAllActions();
     // Clears the actions so the NPC will not follow you with his/her eyes
    int nChair = 1;
    object oChair;
    oChair = GetNearestObjectByTag("chair01", OBJECT_SELF, nChair);
    ActionSit(oChair);
     //Sits the NPC down
    }
}


So there you go. I hope you enjoy it as much as I am.

Weeping Ashes

p.s. There is talk of a petition going around to get me a BIOWARE sweatshirt and Coffee Mug for figuring out this simple streamlined script for a problem that has gone on forever. If it shows up sign it and MAYBE it will actually happen.

[ Edited By Weeping Ashes: Monday, 01 July 03:03PM (GMT) ]

This post taken from the BioWare Forums
Powered by BioBoards Version 2.05.006
Please read our Copyright and Trademark Information