You set a creature to listen, and then have them repeat everything. I'd done a bit with this when I overhauled the henchman scripts for my mod, I'd have to dig through the scripts a bit to remember exactly what I'd done though. I'll do a quick test to see what I get from it, and then edit this post.
Edit: I don't have enough time this morning to go through it all, but here's what I do have:
In an NPCs onspawn, after setting them to listen, set a listen pattern as "**", as in:
SetListenPattern(OBJECT_SELF, "**", 4200);
This will make them report anything heard as chat as a certain listen pattern number you can then match in the OnConversation.
int nMatch = GetListenPatternNumber();
if (nMatch == 4200)
{
int nString = GetMatchedSubstringsCount();
SpeakString (IntToString (nString));
string sString = GetMatchedSubstring (nString - 1);
SpeakString (sString);
}
With this quick test, you'll notice that it'll likely report the matched count as 1, but the heard message itself is on count - 1.
It has to be noted, that if you test this way, you can only have ~1~ npc in listening range set this way, or it creates an infinite loop of shout/return shout between nearby NPCs.
The voice commands didn't seem to report anything using this method, but I only tried a couple. It might be possible to catch some that don't have matches set up this way, but it already looks unlikely.
Modifié par Failed.Bard, 21 janvier 2013 - 06:01 .