Jump to content

Papyrus function for forcing an NPC to speak a specific line of audio dialogue?


RawRawRaul

Recommended Posts

Bunch of different methods, way I have standardised across a number of mods is:

(1) In the quest [Misc] setup a new Topic with a unique name, here it is ModNameSay

(2) Add a bunch of infos with conditions for the right actor GetIsID or Alias to drive the voice and a GetGlobalValue ModNameSayValue unique number.

(3) Then in script you can call each info by its unique number:

Topic          Property pModNameSay      Auto Const mandatory
GlobalVariable Property pModNameSayValue Auto Const Mandatory
Function SayDialogue(Actor SpeakerActor, Actor TargetActor, Float fInfoNumber)
  pModNameSayValue.SetValue(fInfoNumber)
  SpeakerActor.Say(pModNameSay, akActorToSpeakAs = None, abSpeakInPlayersHead = false, akTarget = TargetActor)
  pModNameSayValue.SetValue(-1)
EndFunction

To see this in action have a look at t

where 40 Q&A questions are managed with this mechanism.

Edit: to save time faffing around, using sound descriptors and .Play() may look easier but is always becomes arse.
Link to comment
Share on other sites

Try plan B set your wavs up as sound descriptors and then play them like this:

Sound  Property pFirstThingToSay Auto Const Mandatory
...
Sound.SetInstanceVolume(pFirstThingToSay.Play(SpeakerActor), 1.0)

ps They wont actually play until you make a BA2 archive so they convert to XWM.

 

 

Link to comment
Share on other sites

Nope because they are being played from an object not sayed by an actor.

Remember I suggested that plan A is better ... there are no good + fast + cheap lunches when dealing with dialogue.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...