Page 1 of 1

NPC speech on entering trigger?

Posted: Fri Aug 26, 2005 8:06 pm
by Final Shinryuu
Yay, I need more help again. :)
I'm making a series of waypoints that walk some NPC's around an area. I want to put a trigger somewhere in there, and make it so that when one of the NPC's enters it, he says something. How would I do that?

Posted: Fri Aug 26, 2005 10:14 pm
by fremen

Code: Select all

void main(){

object oEntering = GetEnteringObject();
   
if (GetIsPC(oEntering)) //If you only want this for NPC's
     return;

AssignCommand(oEntering, ActionDoCommand(SpeakString("He's one bad moth'r... Shut your mouth")));

}
Put this in the triggers onEnter script. This should do it, but I'm not really sure if it'll go before all the other actions in the npc's action queue.

Posted: Fri Aug 26, 2005 10:28 pm
by Final Shinryuu
Thanks, Fremen, I'll give it a try.