I revised the previous posted scripts to insure npc fires talking script and then fires heart beat, the key is making sure when you either make a npc or place a npc you leave the script for heart beat blank.
place this script in trigger
// talk_trig_ent
// Greyfort Feb,05.2011
//////////////////////////////////////////////////////////////////////////////////////////////////////////
void main()
{
object oPC=GetEnteringObject();
object oNPC1=GetObjectByTag("boy1");
object oNPC2=GetObjectByTag("boy2");
if ( GetIsPC(oPC)==TRUE )
{
AssignCommand(oNPC1,ClearAllActions(TRUE));
AssignCommand(oNPC2,ClearAllActions(TRUE));
//chk1
if (GetLocalInt(oNPC1,"Talking") ==0 && GetLocalInt(oNPC1,"Talking_started")==0 )
{
SetLocalInt(oNPC1,"Talking",1);
}
//chk2
if (GetLocalInt(oNPC1,"Talking") ==1 && GetLocalInt(oNPC1,"Talking_started")==0 )
{
ExecuteScript ("NPC_TALK",oNPC1);
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////
//END OF SCRIPT
}
this script stands alone...
// NPC_TALK
// Greyfort Feb,05.2011
//////////////////////////////////////////////////////////////////////////////////////////////////////////
void main()
{
object oNPC1=GetObjectByTag("boy1");
object oNPC2=GetObjectByTag("boy2");
if(GetLocalInt(oNPC1,"Talking_started")==0)
{
SetLocalInt(oNPC1,"Talking_started",1);
}
//--------------------------------------------------
// Talk script
DelayCommand(2.0,AssignCommand(oNPC1,ActionSpeakString("You see that fish..") ) );
DelayCommand(4.0,AssignCommand(oNPC2,ActionSpeakString("No ware is it..") ) );
DelayCommand(6.0,AssignCommand(oNPC1,ActionSpeakString("In the pond there..") ) );
DelayCommand(8.0,AssignCommand(oNPC2,ActionSpeakString("OOH I see it..") ) );
// End of Talk script
//--------------------------------------------------
// Reset Variabes excute heartbeat...
if(GetLocalInt(oNPC1,"Talking_started")==1)
{
SetLocalInt(oNPC1,"Talking_started",0);
SetLocalInt(oNPC1,"Talking",0);
// fire default heart "NW_C2_DEFAULT1"
DelayCommand(11.0, AssignCommand(oNPC1, ExecuteScript( "NW_C2_DEFAULT1",oNPC1)));
DelayCommand(11.0, AssignCommand(oNPC2, ExecuteScript( "NW_C2_DEFAULT1",oNPC2)));
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////
//END OF SCRIPT
}
If you already copied these scripts just simply copy and paste over your old ones, be sure to change oNPC1, and oNPC2 to the tag of your npc.
If ya need any more Help We are here
Modifié par Greyfort, 06 février 2011 - 12:43 .