Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Walkup to pc and start conversation

Page: 1 of 1
 Seamhainn
08-29-2008, 9:43 AM
#1
Hello!

A couple of weeks ago there was a thread about how a npc can walkup to the pc and initiate a conversation. I searched with various keywords, but with no success. Can someone point me in the right direction, please?

Thanks
 Istorian
08-29-2008, 10:08 AM
#2
Well, if you want a script on how to make an NPC WALK to the PC and start a conversation, use this:

void main() {
object oPC = GetFirstPC();
object oNPC = GetObjectByTag("Your_NPCs_Tag_Here", 1);

AssignCommand(oPC, ClearAllActions());
AssignCommand(oNPC, ActionMoveToObject(oPC, FALSE));
AssignCommand(oNPC, ActionStartConversation(oPC, "Your_dialogues_name_here"));
}

If you want the NPC to RUN to the PC, use this:

void main() {
object oPC = GetFirstPC();
object oNPC = GetObjectByTag("Your_NPCs_Tag_Here", 1);

AssignCommand(oPC, ClearAllActions());
AssignCommand(oNPC, ActionMoveToObject(oPC, TRUE));
AssignCommand(oNPC, ActionStartConversation(oPC, "Your_dialogues_name_here"));
}

Couldn't find the thread, though. Hope this helps!;)

|I|
 Robespierre
08-29-2008, 10:55 PM
#3
I'm not sure if it was something else I did, but whenever I tried this, the NPC in question would talk to me, but from a distance; he'd never walk up to me. So I learned that to make this work properly, you have to add several empty nodes at the beginning of the dialog, so that the NPC will actually walk up to you before talking.
Page: 1 of 1