01-07-2004, 09:54 PM | #1 |
Ironworks Moderator
Join Date: March 1, 2001
Location: Midlands, South Carolina
Age: 48
Posts: 14,759
|
Can somebody teach me how to get NPCs and also PCs to sit in chairs that are in a tavern?
[ 01-07-2004, 09:55 PM: Message edited by: Larry_OHF ] |
01-07-2004, 10:09 PM | #2 | |
Jack Burton
Join Date: May 31, 2002
Location: Ireland
Posts: 5,854
|
Throw this in the Onused field of your chair. This is for PC's. Make sure you make the object usable!
Quote:
Create a chair and give it the tag "CHAIRNPC" or whatever you want (keep it simple). Place the NPC next to the chair. Copy and save their OnSpawn script under another name, and add this line at the bottom: ActionSit (GetNearestObjectByTag ("CHAIRNPC", OBJECT_SELF)); If your gonna call it something else make sure the tag "CHAIRNPC" of the actual chair matches that in the script like I have done above. Note that when a PC speaks to the NPC, they will stand up. To get them to sit back down, you will need to go to the 'Other Files' tab in their dialogue. You will see spots for two scripts there, which activate when dialogue is either ended or aborted. Make a script that calls the above line and they will sit back down once dialogue is over. [ 01-07-2004, 10:14 PM: Message edited by: SpiritWarrior ]
__________________
Still I feel like a child when I look at the moon, maybe I grew up a little too soon... |
|
01-07-2004, 10:13 PM | #3 |
Avatar
Join Date: July 11, 2001
Location: Austin, Texas
Age: 42
Posts: 525
|
You can put this script in the On Used spot of a bench/chair to have your players sit in it. Make sure the bench/chair is marked as Useable.
void main() { object oPlayer=GetLastUsedBy(); if(GetIsPC(oPlayer)) { object oChair = OBJECT_SELF; if (GetIsObjectValid(oChair) && !GetIsObjectValid(GetSittingCreature(oChair))) { AssignCommand(oPlayer, ActionSit(oChair)); } } } This code was taken from the Halls of Advanced Training module. ----------------------------- As for NPC's, here are scripts I used in one of my modules that makes the NPC sit down upon being spawned and remain seated when talked to. Put this one in the On Spawned spot of the NPC: void main() { //Sits the NPC down int nChair = 1; object oChair; //"DROW_THRONE" is the tag name of the chair to be used oChair = GetNearestObjectByTag("DROW_THRONE", OBJECT_SELF, nChair); ActionSit(oChair); } And this one in the On Conversation: void main() { //Set the NPC as the speaker if(GetCommandable(OBJECT_SELF)) { //Start the conversation script BeginConversation(); ClearAllActions(); // Clear the actions so the NPC will not follow you with his/her eyes int nChair = 1; object oChair; oChair = GetNearestObjectByTag("DROW_THRONE", OBJECT_SELF, nChair); //Sit the NPC down ActionSit(oChair); } } Let me know if you have any questions.
__________________
There more of it there is,<br />The less you see. |
01-08-2004, 02:54 AM | #4 |
Ironworks Moderator
Join Date: March 1, 2001
Location: Midlands, South Carolina
Age: 48
Posts: 14,759
|
wow!
Thanks guys! |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Everything I learned, I learned from Rocky | Sir Degrader | General Conversation Archives (11/2000 - 01/2005) | 1 | 01-11-2005 09:04 PM |
Sitting on the other end.... | Ziroc | NWN Mod: Escape from Undermountain | 2 | 03-04-2004 06:20 PM |
Sitting down | Alisttair | Neverwinter Nights 1 & 2 Also SoU & HotU Forum | 4 | 09-29-2002 06:29 PM |
Sitting on the dock of the bay... | DraconisRex | Miscellaneous Games (RPG or not) | 4 | 05-30-2002 02:53 PM |
So here am I, sitting in the dark... | Epona | General Conversation Archives (11/2000 - 01/2005) | 18 | 04-09-2001 08:33 PM |