| Author |
Sticky:
Post Working Scripts Here |
|
DragonTayl
|
Posted:
06 July 03:43PM
|
1) Name: Multi NPC conversation (no PC)
2) What it does: This is set of two scripts, one to trigger a conversation between two NPCs, the other to control and run through the conversation.
3) Notes: Adding more NPCs is simply a matter of increasing the NPC objects (don't forget to give them unique tags or all the script will come out of one NPC).
Here's my method:
Create a trigger area the PC enters to "cause" the conversation (basically, what's the eavesdropping distance?) This script goes in that trigger's OnEnter event.:
NWScript:
void main()
{
object oChick1=GetObjectByTag("fc_CultChick1");
object oPC=GetEnteringObject();
if (GetIsPC(oPC))
{
AssignCommand(oChick1, SpeakString("He's such a lug."));
SetLocalInt(oChick1, "iShowLine", 1);
}
}
Then in the NPC you wish to "start" the conversation (this NPC will also basically control the conversation) make a copy of the default OnSpawn script, un-comment the following line:
SetSpawnInCondition (NW_FLAG_HEARTBEAT_EVENT);
Save the OnSpawn script you just created and assign it to the "start" NPC's OnSpawn event.
Finally, add the following script (changing the text to suit your needs, this is again part of my cliche cult) to the NPC's OnUserDefined event.
NWScript:
void main()
{
int nEvent = GetUserDefinedEventNumber();
if (nEvent == 1001)
{
object oChick1=GetObjectByTag("fc_CultChick1");
object oChick2=GetObjectByTag("fc_CultChick2");
int iLine=GetLocalInt(oChick1, "iShowLine");
if (iLine > 0
&& IsInConversation(oChick1) == FALSE
&& IsInConversation(oChick2) == FALSE)
{
switch(iLine)
{
case 1:
AssignCommand(oChick2, SpeakString("Tell me about it. Always running into things."));
SetLocalInt(oChick1, "iShowLine", 2);
break;
case 2:
AssignCommand(oChick1, SpeakString("And his appetite is impossible"));
SetLocalInt(oChick1, "iShowLine", 3);
break;
case 3:
AssignCommand(oChick2, SpeakString("I don't know what to do with mine, either."));
SetLocalInt(oChick1, "iShowLine", 4);
break;
case 4:
AssignCommand(oChick1, SpeakString("I have thought about sacrificing him. There's always fresh meat around to replace him."));
SetLocalInt(oChick1, "iShowLine", 5);
break;
case 5:
AssignCommand(oChick2, SpeakString("Really? How would you get that done?"));
SetLocalInt(oChick1, "iShowLine", 6);
break;
case 6:
AssignCommand(oChick1, SpeakString("Easy. Most of the Superiors are all too eager to make an example of someone."));
SetLocalInt(oChick1, "iShowLine", 7);
break;
case 7:
AssignCommand(oChick2, SpeakString("But they don't always listen and might sacrifice YOU!"));
SetLocalInt(oChick1, "iShowLine", 8) ;
break;
case 8:
AssignCommand(oChick1, SpeakString("They do what you want if you get intimate with them."));
SetLocalInt(oChick1, "iShowLine", 9);
break;
case 9:
AssignCommand(oChick2, SpeakString("Not a bad idea. I know just who I'd use..."));
SetLocalInt(oChick1, "iShowLine", 10);
AssignCommand(oChick1, ActionPlayAnimation(ANIMATION_LOOPING_TALK_LAUGHING, 1.0, 5.0));
AssignCommand(oChick2, ActionPlayAnimation(ANIMATION_LOOPING_TALK_LAUGHING, 1.0, 5.0));
break;
}
}
};
return;
}
Members, feel free to message me in the My Messages feature of the website.
DragonTayl. |
|