Jump to content

Create custom voices for mods not designed for


Recommended Posts

Posted (edited)

I'll post here a walkthrough of my findings if you want to create a voice pack but the base mod has not been made to be voiced.

For example, a lot of mods are referencing all the dialog lines into a single voice type regardless of actor gender or race.

If you are lucky the mod author has implemented conditions to differenciate gender and race but what if you want to add even more shades ?

 

This walkthrough handles the case where the mod author forces a voice type in a quest Alias.

 

tldr; Here is the trick

  1. (Optionnal) Add a custom voice type
  2. (Optionnal) Add the fully voiced actors in a FormList
  3. Remove the forced voice type from the quest alias
  4. For each quest alias add a script to override the ForceRefTo function to set the voice and the Clear function to unset it
  5. (Optionnal) If the alias is not set with ForceRefTo, you can use the OnPlayerDialogueTarget instead but because the OnPlayerDialogueTarget event trigger during the greeting phase, you'll have to copy all your greetings fuz files to every relevant voice types (eg: Male for male, female for female)
  6. ...
  7. Profit !

 

In details

 

With FOEdit, temporarily add the ESM flag to the ESP you want to patch.

image.jpeg.be51729da3ae7149d8965342d2d5c898.jpeg

 

Clipboard_05-23-2024_05.jpg.511a8dee5a683bcc36c80ed36edd20d9.jpg

 

Save, then open the esp with Creation Kit (don't set it as "Active" since you want to create a new esp)

It should have the status "Master File".

image.png.38842e785bf1f0fb12270e2c599fefc4.png

 

If you don't want to use the vanilla voices, create your new voice type by right clicking in "Character" > "VoiceType" in the Object Window.

image.png.0e11c1049cccdb6a7fa42ed5c927d3ca.png

 

If it does not have one already, assign a voice type to the actor you want to make a custom voice for.

image.png.2a9b1a6043bc268b751188a120d48a43.png

 

If you have fully voiced NPC, create a FormList and drag and drop your fully voiced Actors in it.

image.png.a7aadd343b0894ac1d84c05a74d2a35e.png  image.png.a7d1ac1727ed6b90280272e25781b769.png

 

Now, open the quest you want ("Character" > "Quest") and go to the "Quest Aliases" tab.

Edit the aliases used in the scenes and remove that ugly forced voice type :) 

image.png.eb1151300f6004dc2b4bbb1c5b78ddbe.png

 

image.png.b25ff35d6913ef611ca26461d31d8cf9.png

 

Create a papyrus script looking like that :

Spoiler
ScriptName AFV:AFV_VoiceAlias Extends ReferenceAlias

Group VoiceTypeGroup
  VoiceType Property AFV_Voice Auto
  VoiceType Property AFV_VoiceF Auto
EndGroup
Group FullyVoicedNPCGroup
  FormList Property AFV_FLST_Voiced_Actors Auto
EndGroup

Function ForceRefTo(ObjectReference akNewRef) ; Use ForceRefTo override if the alias is set by script
  Self.Clear()
  Parent.ForceRefTo(akNewRef)
  Actor ActorReference = Self.GetActorReference()
  If ActorReference
    If AFV_FLST_Voiced_Actors.HasForm(ActorReference)
      ActorReference.SetOverrideVoiceType(None)
    ElseIf ActorReference.GetLeveledActorBase().GetSex() == 1 ; Use GetLeveledActorBase instead of GetActorBase to get the good gender for generated NPC (eg: settlers)
      ActorReference.SetOverrideVoiceType(AFV_VoiceF)
    Else
      ActorReference.SetOverrideVoiceType(AFV_Voice)
    Endif
  Endif
EndFunction

Event OnPlayerDialogueTarget() ; Use OnPlayerDialogueTarget event if the alias is set by event (you'll have to copy the greetings)
  Actor ActorReference = Self.GetActorReference()
  If ActorReference
    If AFV_FLST_Voiced_Actors.HasForm(ActorReference)
      ActorReference.SetOverrideVoiceType(None)
    ElseIf ActorReference.GetLeveledActorBase().GetSex() == 1
      ActorReference.SetOverrideVoiceType(AFV_VoiceF)
    Else
      ActorReference.SetOverrideVoiceType(AFV_Voice)
    Endif
  Endif
EndEvent

Function Clear()
  Actor ActorReference = Self.GetActorReference()
  If ActorReference
    ActorReference.SetOverrideVoiceType(None)
  EndIf
  Parent.Clear()
EndFunction

 

 

And assign it to your alias (Don't forget to set the voice types and form list as properties)

image.png.9b3ce49359e1f882f33c7f969f304723.png

 

Save your patch as esp. (You can also compact the ID and make it an ESL)

image.png.2e90014bc0b9289312aacb8d0e8433cd.png

 

If you used the OnPlayerDialogueTarget method, copy every greetings (dialogs in the "start phase") in every NPC.

  • The "copy-greetings.py" script in the modders resources of my AAF Voices mod can help you for that (May need debug)
  • To save space, pack your mod with 7zip "Ultra" compression if you are doing !

 

Revert the base esp to its original state (without the "ESM" flag) and you are good to go!

 

Old (other?) way of doing it :

Spoiler

tldr; Here is the trick

  1. (Optionnal) Add a custom voice type
  2. If it does not have one already, add a voice type to each actor you want custom voice for
  3. Remove the forced voice type from the quest alias
  4. Add a begin script fragment in the scene to override the actor voice type depending on the conditions you want
  5. Add an end script fragment in the scene to remove that override
  6. Because the begin fragment trigger after the greeting phase, copy all your greetings fuz files to every relevant voice types (eg: Male for male, female for female)
  7. ...
  8. Profit !

 

Issues and things I didn't check

  • If the mod author update a scene (eg: Alias conditions) you'll have to update your patch (It's done quickly with FOEdit and copy/pasting)
  • I don't know how it would react if the scene runs a script that remove the actor from the alias... will the actor keep the default voice ?

 

In details

 

With FOEdit, temporarily add the ESM flag to the ESP you want to patch.

image.jpeg.be51729da3ae7149d8965342d2d5c898.jpeg

 

Clipboard_05-23-2024_05.jpg.511a8dee5a683bcc36c80ed36edd20d9.jpg

 

Save, then open the esp with Creation Kit (don't set it as "Active" since you want to create a new esp)

It should have the status "Master File".

image.png.38842e785bf1f0fb12270e2c599fefc4.png

 

If you don't want to use the vanilla voices, create your new voice type by right clicking in "Character" > "VoiceType" in the Object Window.

image.png.0e11c1049cccdb6a7fa42ed5c927d3ca.png

 

If it does not have one already, assign a voice type to the actor you want to make a custom voice for.

image.png.2a9b1a6043bc268b751188a120d48a43.png

 

Now, open the quest you want ("Character" > "Quest") and go to the "Quest Aliases" tab.

Edit the aliases used in the scenes and remove that ugly forced voice type :) 

image.png.eb1151300f6004dc2b4bbb1c5b78ddbe.png

 

image.png.b25ff35d6913ef611ca26461d31d8cf9.png

 

For each scene on the scene tab, click on "Edit Data" to get the scene data.

image.png.861caffcfeed6805a1639472dac06209.png

 

Add a script fragment on begin and on end.

image.png.4713a53d72ea56349a227769ae3a4f1a.png

 

Add following properties :

  • The ReferenceAlias of your Actor in the Scene (NagAlias or QuestAlias in my examples)
  • The VoiceTypes you want (DefaultVoice, FemaleVoice or MaleVoice in my examples)
  • Optionnal Every Actor you want a custom voice for

image.png.874e7dc2adccd803a8b730db5629839e.png

 

Now, you are good to go : Add a begin fragment to apply the default voice for every NPC except for the ones you want custom voices.

if QuestAlias.GetActorReference().GetActorBase().GetSex() == 1
     QuestAlias.GetActorReference().SetOverrideVoiceType(FemaleVoice)
else
     QuestAlias.GetActorReference().SetOverrideVoiceType(MaleVoice)
endif

 

Add an end fragment to remove the override or the Actors will keep the default voice even after they are not targetted with the alias anymore.

QuestAlias.GetActorReference().SetOverrideVoiceType(None)

 

Save your patch as esp.

Revert the base esp to its original state (without the "ESM" flag) and you are ready to go!

 

 

Feel free to give me your feedbacks, I haven't used that trick in my voice mod yet so I don't know if it fully works but it's fine on my test world to investigate a way to add voices to mods...

I'll give update as soon as I'll have used it on a real mod.

 

Edited by nasgektw
Better method
Posted

Here are my feedbacks after using this method to support both female and male NPC in AAF Magno CUM Gaudio :

  • It globally works great especially if the scene has an empty greeting phase (So you don't have to add your own line and move everything in a new dialog)
  • Don't forget to copy/paste the least restrictive conditions from the dialogs you moved into you new greeting line
  • Don't forget to copy/paste the start data into your new line (force greet radius, forced alias, etc.)
  • It appears some line in a topic does not appear in the creation kit GUI... I tried to move only the one appearing hopping the links will be kept... wait and see...
  • You need the fragments of the lines you move in order to remove the "start" infos because CK is recompiling everything even if not needed...
  • Please mod authors don't add useless conditions on voice types in your dialogs if you already force it in your alias... It's a pain to remove all of those...
    • Yes, remove all the conditions on voice type in the lines if you force voice type in the dialog alias, you can do it, they are redundant anyway.
  • You can get around mods that keep un unpackaged wav and lip files by overriding the original voice type name with yours so you can distribute only your fuz files.
Posted

A little update after I came accross difficulties voicing TSEX and TSEX Hardship Alpha :

  • Original tutorial was breaking complexe scenes with different starting phases
    • There is a slightly different process depending on if you have a starting phase defined or not in the topic you move
  • Original tutorial was hard to follow regarding setting the relevant start conditions for scene with a lot of different starting conditions
    • The easiest workaround I found I simply copy the old lines and tick/untick the "Requires Player Activation" box if set.
    • That process also fixes some issues regarding "Say Once" checkbox and timer reset conditions.
    • ... But it introduce a pain in the ass regarding the removal of the script fragments... Creation Kit is not user friendly regarding fragment removal... I had to save, close and reload the ESP...
  • The dummy text value appear sometimes in the subtitles
    • With subtitle priority set to "low" it tends to appear less
Posted

A big update after I understood why Akor duplicated some lines for every voice type in the game for Boston Devious Helper.

The need to shift the greeting phase to phase 1 was because the begin scene fragment triggers after the greeting phase.

 

All we have to do to handle that is to simply add a voice type to every new actor in the mod and duplicate the greeting fuz to all the relevant voice types in the game (I'm currently referencing and sorting them). Since there is not THAT many voice type nor THAT many greetings, the only downside of this method is a few additionnal megabytes.

 

Doing like this is much more simple, fixes the delay induced by the previous method and does not make the original mod unstable.

Posted

After voicing Boston Devious Helper I figured out a new and easier way of doing it by overriding ForceRefTo (or OnPlayerDialogueTarget) and Clear function from ReferenceAlias script.

 

It's really straight forward for simple mods relying exclusively on ForceRefTo but require to understand how the mod work for bigger ones with NPC assigned to multiple aliases at the same time.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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