I'm having some trouble with a script that should fire when a PC talks to an NPC.
I've added the script into the OnConversation event of an NPC, and when a PC talks to them, the script fires fine. However, I've discovered that a) the script fires even when the PC just speaks something near the NPC and
the NPCs seem to speak to each other (possibly the script firing for one NPC making the script fire for another nearby NPC). This can cause an avalanche of scripts firing and conversations happening (often crashes the game).
I've looked up the OnConversation description and it states "The
OnConversation event is fired when a
Player Character attempts to talk to a NPC or other creature. It also fires whenever
the dialogue with another creature ends, or a shout is heard."
So, now I'm a bit stuck. Should I be putting the script into another event instead, but if so, none of them seem relevant for what I want. Or does it need to go in the OnUserDefined event, but not sure how that works - never used it before. Or should the NPC just have the default scripts and use the standard conversation file to get this to work - although I'm not sure if it will do what I want.
Incidentally, the purpose of the script is to call a random piece of gossip from the database and display that as "speech", and a small % chance of calling a conversation file which asks the PC to deliver an item. That bit is all working fine when there's 1 NPC present and the PC initiates the conversation.
Any help would be much appreciated! Thanks
'>