This is modification for Pathfinder: Kingmaker. Uses Unity Mod Manager and 0Harmony. Audio files along with some configuration are required. For now, only Jaethal voice lines are done (at least by me), but you are free to contact me via GitHub Issues or e-mail if you want to contribute more. The repository also includes notes on voice clonning & scripts I used for generating Jaethal.
You can download the mod from Nexus Mods.
-
Voice over requests from game are detected by
LocalizedString.PlayVoiceOver
patch. We map those strings UUIDs to audio files, with special "recipe" that describes which actual files are to be used, in what order. Some suffixes are expected for sex or kingdom status dependent dialogues. -
Audio files should be placed in
audio
directory inside mod directory. I used AI generated samples with 44100 Hz sample rate single channel (mono), but the mod can also play any other sample rate and stereo (might require tweaking theAudioPlaybackEngine
instance on audio player side for better performance). -
Next to the
audio
folder there should beaudio_metadata.csv
,|
separated file with columns:LocalizedStringUUID
,Companion
(unused actually),Recipe
andRawText
(also unused). -
Modification uses external executable (outside the game) for playing the sound, sources are of course included in the repository, as I failed to found another way.
-
I couldn't get Unity
AudioClip
to workNeither
UnityWebRequestMultimedia.GetAudioClip
norWWW.GetAudioClip
worked for me, maybe because wierd WAV format. They did load the bytes, but did not produce usableAudioClip
(length was 0). I tried manuallyAudioClip.Create
andAudioClip.SetData
, with custom WAV parsing. Sadly I always gotAudioClip.GetData failed; AudioClip contains no data
(onSetData
), because for some fucking reasonCreate
, despite having channels parameter, always creates 0 channles. -
I tried using C#
MediaPlayer
andSoundPlayer
, but had issues with dependencies (WPF disagrees with Unity). Maybe one day someone (or me) will try usingSoundPlayer
tho. -
For now, ended up using separated process with NAudio library to playback the audio files, communicates with game process using named pipes IPC, one receiving requests from game, other sending notifcations when audio/recipe finishes.
-
- Add detecting missing dialogues to the mod; save to file and keep showing "notification" on the mod settings asking user to upload their logs/update the mod.
- Replace dialogues referencing player character name by something more generic (for now it's fixed to use my character Elizabeth).
- Add pitch setting
- Add speed setting
- Add re-focus option, as sometimes game window doesn't get focus, maybe because conosle window (even if hidden) blinks.
- Allow skip part of the voice line using space, if possible using speed up