I made a sort of inverse script similar to
yours.
1. Anti-Musical Chair Script
2. You click on the chair, your PC sits down and the conversation
launches. The NPC will NOT get up at all. In fact, if for whatever
reason he DOES get up (you speak directly to him rather than clicking on
the chair) he'll sit down again once you click on the chair to converse
with the PC.
3. oChairPC = Chair assigned to PC
oChairNPC = Chair assigned to NPC
oPlayer = Self-explanatory
oNPC = Self-explanatory
NPC-Conversation = Conversation file
*NOTE* use the OnSpawn sit script for the NPC. Remember to modify the
variables so that it assigns the NPC to the unique chair tag.
I had a problem having a PC sit down to talk to an NPC without the dumb-dumbs
playing musical chairs.
FYI, I know exactly nothing about C so this script is kind of cobbled
together and possibly has a bazillion redundancies. If anyone would like
to streamline it, that would be great.
Anyway, here's how it works. You have an NPC sitting at a table. You
want to sit down and talk to him.
You make a unique tag for the NPC's chair and the PC's chair. You use
the OnSpawn sit script for the NPC (make sure you edit the script so
that it refers to the unique chair assigned to the NPC).
Next, you assign the following script to the chair in the "OnUsed"
section.
NWScript:
#include "NW_I0_GENERIC"
void main()
{
int nChair = 1;
object oPlayer = GetLastUsedBy ();
object oChairPC;
object oChairNPC;
object oNPC = GetObjectByTag("npc01", 0);
oChairNPC = GetNearestObjectByTag ("ChairNPC01", oPlayer, nChair);
AssignCommand (oNPC, ActionSit (oChairNPC));
AssignCommand (oPlayer, ActionStartConversation (oChairNPC, "NPC-Conversation", FALSE));
oChairPC = GetNearestObjectByTag ("ChairPC01", oPlayer, 0);
AssignCommand (oPlayer, ActionSit (oChairPC));
}
Here's what will happen. You click on the chair, your PC sits down and
the conversation launches. The NPC will NOT get up at all. In fact, if
for whatever reason he DOES get up (you speak directly to him rather
than clicking on the chair) he'll sit down again once you click on the
chair to converse with the PC.
And yes, the chair is initiating the conversation.
|