Aller au contenu

Photo

Scripting NPCs with conversations....


  • Veuillez vous connecter pour répondre
1 réponse à ce sujet

#1
datamaster

datamaster
  • Members
  • 48 messages
I know how to spawn in creatures using scripts.  Mostly I do this to spawn in monsters to attack.
But is it possible to spawn in NPCs using scripts, and have them use a specific conversation that you specified beforehand?  This way it saves on the number of creatures on the palette.
I think I have seen people hint at this, but can't seem to find it.

------------------------
"Knowledge knows no bounds!  But hindsight might wish there had been some!"

#2
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
It is possible yes. One way to do it would be to alter the default OnConversation script (such as nw_c2_default4). The trade off is that you will probably end up with a large convoluted script.

You'd have to do quite a bit of checks to make sure the right NPC uses the right conversation.
e.g. you have one npc in one area you could do:
if (GetTag(OBJECT_SELF) == "NPC1" && GetArea(OBJECT_SELF) == GetObjectByTag("Area51"))
{
ClearAllActions(TRUE);
BeginConversation("con res ref here");
}

But you could run into some problems. If you had 2 generic NPCs in the same area with the same tags then you'd have to add further checks like if they were closest to a particular object or something.

So this is just one way off the top of my head. Hope it helps and good luck.