NPC Modding Help - inc. AI voice change 1.1 — Baldur's Gate 3

Share things you've made or found for games here.
Post Reply
User avatar
orinEsque
Posts: 251
Joined: Oct 9, '23

NPC Modding Help - inc. AI voice change 1.1 — Baldur's Gate 3

Post by orinEsque »

Table of contents
  1. Excel Table to find your character/dialogue/spell etc
  2. Every single Character Visuals in a single file
  3. How to Change Portraits
  4. Modding Best Practices - Only use the necessary assets & make your mod future proof.
  5. How to Change Voices using AI
1.Excel Table to find your character/dialogue/spell etc
>>BG3 Asset Dictionary<<

Gone are the days of rooting through English.xml, and LSF files. I've compiled them all into a table.
Image

How to use this table
Example Scenario, I want to find all of Mizora's Character Visuals.
1. Open the file in excel
2. Do a text filter for the whole word "Mizora" only.
3. You will now find 4 rows with "Name" and "MapKey" info.
4. Open the master file for [PAK]_CharacterVisuals I have attached below in notepad.
5. Search for one of Mizora's Keys and you will find the Character Visuals for exactly that "Resource". And go about changing her appearance to your liking.

2.Every single Character Visuals in a single file
>>[PAK]_CharacterVisuals.LSF (Patch3Hotfix2) <<

I've combined the [PAK]_CharacterVisuals/merged.lsf from SharedDev, Shared, Gustav and GustavDev into a single xml file. So you can use the table above to directly go and edit your character. You need to convert it to LSX before you can use it obviously.


3. How to Change Portraits
All the portraits are in DDS format within the following locations. All the portraits are in DDS format within these folders. Searching for Characters by name should show you their portrait, though in some rare cases you might have to eyeball it (windows explorer shows you a preview of the portrait):
Gustav_Textures.pak Mods\Gustav\GUI\Assets\Portraits
Gustav_Textures.pak Mods\GustavDev\GUI\Assets\Portraits
Shared.pak Mods\Shared\GUI\Assets\Portraits
Shared.pak Mods\SharedDev\GUI\Assets\Portraits

Unfortunately, you need to manually take a screenshot and overwrite the .DDS files in the Portraits folder. Unlike LSF files, you cannot prevent an override by renaming SharedDev/GustavDev etc to your mod name like you can with LSF files. But this does not matter since you are only changing specific portraits with specific names.
1. I installed DDS file plugin for Photoshop (https://fnordware.blogspot.com/2014/09/ ... s-and.html)
2. Opened the .DDS file in Photoshop
3. Pasted in a screenshot of new Wyll
4. Saved with no changes to DDS file format.
5. WARNING: Photoshop saves your file as .dds (small letter). BG3 expects the file to be .DDS (capitals). You will need to manually check that the file extension is upper case. Otherwise the override won't work.

Turn based-combat, Character Creation, and portraits of transformed version of your Companions/Origins rely on these DDS files
Portraits in game of untransformed Companions/Origins is actually obtained from your live in game 3D model and is unaffected by the Portraits folder. So you need to rely on a level up to refresh the portrait.


4. Modding Best Practices
Only use the necessary assets & make your mod future proof.
  1. LSF files in the same file path after SharedDev, Shared, GustavDev, Gustav all merge together into one before the game is loaded. E.g.
    • Public / SharedDev /Content/[PAK]Character_visual/merged.lsf
    • Public / Shared /Content/[PAK]Character_visual merged.lsf
    • Public / GustavDev /Content/ [PAK]Character_visual /merged.lsf
    • Public / Gustav /Content/[PAK]Character_visual /merged.lsf
    • Public / yourmodname /Content/[PAK]Character_visual /merged.lsf.
    All the LSF files from above get merged into one big xml file. With yourmodname/merged.lsf getting priority.
  2. Renaming your merged.lsf to random.lsf still works.
  3. Multiple .lsf files can be dropped in the same Public/yourmodname/ folder and have the same effect as dropping Gustav/../merged.lsf and GustavDev /../merged.lsf separately. E.g.
    Image
  4. Your mod’s LSF file does NOT need to contain everything from the original file if you use this file convention:
    • Public/Yourmodname/Content/[PAK]Character_visual /renamed.lsf
    This way you can avoid issues like headless cats! being changed in a new patch. And your mod size will be tiny because your .LSF file will only contain the code for the character you changed only. E.g. I have only included Wyll’s variables so instead of a 100000+ lines, I have 2500.
    Image
  5. Note: EVERYTHING between a <node=”Resource”> and </node> has to be included otherwise if you change eye colour in the Resource and leave out the rest. You’ll just have floating eyes.
  6. It's best to use the LSV from the latest PatchXHotfixY.pak file instead of the one from Gustav.pak or Shared.pak when you first build your mod.
  7. Finally, you can pack your mod into a handy little zip file using bg3-modders-multitool, and we can easily import stuff into BG3 manager. This way we can decide which mod gets priority if two mods have some clashing character Resources.
5. How to Change Voices using AI
Found a video tutorial on Youtube. I'm trying it out. Looking at his python script. It seems legit.
You need to pick a voice models for this. There's a huge list in this link:
Voice Models: https://huggingface.co/QuickWick/Music- ... /tree/main


How to add more characters to the character selector
  1. Open bg3-ai-voicetoolkit-main\lib\voice_selector.py in notepad++
  2. You'll see a numbered list with character names and an id
  3. Simply maintain the same format to add another character.
  4. "Name" can be of your choosing.
  5. But id must match the voice of the NPC you are interested in.
  6. Use the dictionary I've attached to find a voice line belonging to the NPC you are interested in
  7. In the same row as the matching text you will find a handle.
  8. Assuming you have installed and unpacked at least "Gustav" and ALL the patches using bg3-modders-multitool, search for this"handle"
  9. Now look for an .lsf file with the path: Mods\***\Localization\English\Soundbanks\***.lsf
  10. Extract and open the file in notepad++
  11. Search for your handle, the vcXXXX or vXXXXX code will be attached to it with an underscore e.g. handle_vcXXXXXX
  12. Now add the vcXXXX / vXXXX as an "id" to the voice_selector.py
  13. Go back and open 1.Select Character.bat and boom his/her voice lines are selectable. And audio should be loaded to
    bg3-ai-voicetoolkit-main\Mangio-RVC-v23.7.0\audios
Last edited by orinEsque on November 7th, 2023, 22:30, edited 42 times in total.
BG3 No Alphabets - remove modern day identity politics and irrationalities from Faerun.
BG3 Alternate Wyll Revamped - A revamped and complete version of the infamous white Wyll mod.
User avatar
orinEsque
Posts: 251
Joined: Oct 9, '23

Post by orinEsque »

Added a link I found on to how you can change voices with AI.
BG3 No Alphabets - remove modern day identity politics and irrationalities from Faerun.
BG3 Alternate Wyll Revamped - A revamped and complete version of the infamous white Wyll mod.
User avatar
Slavic Sorcerer
Posts: 355
Joined: Sep 9, '23
Location: Poland

Post by Slavic Sorcerer »

Editing spell list for beginners

The guide is aimed at those who never created a mod in their entire life, and lists obvious knowledge more experienced people may already have.

The guide covers how to edit Spell List of a specific class, by either adding or removing spells.
This guide is not about how to create custom spells, nor how to edit spells (damage etc).

It's written by an amateur who discovered last week how to do it, so feel free to leave suggestions and corrections - especially on formatting here.

Preparations

Before we start, make sure you uninstall every mod from your game; including copy-paste-override ones. Just to be on the safe side.
Or you can browse for the files needed on the web, but it's better to take it from your installation folder

Those preparations will make out life easier while creating the mod. It's better to keep the things tidy.
If you can find yourself in chaos, you can skip this part

We're gonna create a lot of folders, and I will reference those folders later on.
We will also get our SpellList files.
  1. Create separate folder that will hold everything you work on; I named my folder "BG3 Modding",
  2. Inside the BG3 Modding folder create ExportTool folder,
  3. Download ExportTool by Norbyte,
  4. Unpack the package inside the ExportTool folder,
  5. Inside the ExportTool folder, create folder called Mod,
  6. Inside the Mod folder, create a new folder called Shared,
  7. Inside the BG3 Modding folder (we are circling back to the main folder) create BG3 Mod Manager folder,
  8. Download BG3 Mod Manager,
  9. Upack BG3 Mod manager in BG3 Mod Manager folder,
  10. Open ExportTool's application (called ConverterApp.exe as of writing),
  11. In the Game tab at the top of the window, make sure the game selected is Baldur's Gate 3 and the version at the bottom says [current version] (Baldur's Gate 3 release).
  12. Proceed to PAK / LSV Tools tab,
  13. In the Extract Package section, Package Path line, click on the thre dots ...,
  14. Find Shared.pak in your BG3 folder. By default it should be in: Baldurs Gate 3/Data folder. Click on it, then click Open,
  15. In the Extract Package section, Destination Path line, click on the thre dots ...,
  16. Pick the Shared folder we created earlier.

    Notes
    • You can, of course, skip the BG3 Mod manager, but it's gonna make installing and uninstalling mods a hassle, so it's not recommended.
    • Apply relative fixes to BG3 Mod Manager, should you need them.
    • Directory listed to Shared.pak is the default one.
    Creating functioning mod

    Now the tedious part
    Strap yourself and tell momma you're gonna be late for dinner.

    For this example, we will be giving the Cleric class Bone Chill cantrip, and Misty Step spell
    To make this work with BG3 Manager, we need to create the mod itself, and then the meta file.
    This way we can use BG3 Manager to install and uninstall the mod whenever we see fit, and it reduces the risks of breaking your game.

    We will be working on SpellList.lsx files.
    There are two files like this; both in Shared and SharedDev folder. If the node with spells is not present in one, it should be present in another.
    It's possible that's just my case and you won't see such separation in yours, but I doubt it

    Folder preparation
    1. Go to the BG3 Modding folder,
    2. Create new folder, name it "Cleric spells expanded",
    3. In it, create two folders: Mods and Public,
    4. Inside the Mods folder, create folder "Cleric spells expanded". Final result should look like this: Cleric spells expanded/Mods/Cleric spells expanded
    5. Inside the Public folder, create "Cleric spells expanded" folder, then . Inside it, create Lists folder. Final result should look like this: Cleric spells expanded/Public/Cleric spells expaned/Lists
    Writing the mod - SpellList part
    1. Go to Shared/Public/SharedDev/Lists,
    2. Find SpellList.lsx file, and copy it to Cleric spells expanded/Public/Cleric spells expaned/Lists,
    3. Open the copied SpellList.lsx file in notepad,
    4. Remove every node, leaving something like this (values my vary but it's fine since we copied it from the original):
      ► Show Spoiler
    5. Save the file,
    6. Open SpellList.lsx files, both from Shared/Public/SharedDev/Lists and Shared/Public/Shared/Lists,
    7. Find nodes for Cleric spells, by ctrl+F or scrolling,
    8. Copy node with cantrips, and paste it into your SpellList mod. Do the same with circle 2 spells. It should look like this now:
      ► Show Spoiler
    9. In the "Cleric cantrips (Wisdom)" node, look at <attribute id="Spells" type="LSString" value=. That's where the spell list is. Carefully add Target_ChillTouch; to it
    10. Repeat the step above, but at "Cleric SLevel 2" type Target_MistyStep;
    11. The result will look like this:
      ► Show Spoiler
    12. Save the file
    Now your edited spell list sits in your Cleric spells expanded/Public/Cleric spells expanded/Lists folder.

    We will be creating the aftermentioned meta file. I admit, I just copied it from other existing mods, like a template, and I have no idea how to write one from scratch

    Writing the mod - meta part
    1. Open notepad,
    2. Paste this content:
      ► Show Spoiler
    3. Make sure <version major="4" minor="0" revision="9" build="329"/> line is the same as your spell list's
    4. In <attribute id="Author" type="LSWString" value=" "/> type your nickname (e.g. "Slavic Sorcerer"),
    5. In <attribute id="Description" type="LSWString" value=" "/> type short description (e.g. "Expands cleric spells"),
    6. In <attribute id="Folder" type="LSWString" value=" " type the name of the folder where the mod is located (in this case, "Cleric spells expanded"),
    7. In <attribute id="Name" type="FixedString" value=" "/> type the name of the mod (in this case, also "Cleric spells expanded"),
    8. In <attribute id="UUID" type="FixedString" value=" "/> paste a unique, generated UUID. You can find a generator here,
    9. Save the file as meta.lsx in Cleric spells expanded/Mods/Cleric spells expanded
    Now we have the meta file in Cleric spells expanded/Mods/Cleric spells expanded, and our edited spell list in Cleric spells expanded/Public/Cleric spells expanded/Lists

    Making .pak file

    Now with everything prepared, let's go to the finish line.
    1. Copy Shared.pak directly from the game's file to the BG3 Modding folder,
    2. Proceed to the ExportTool,
    3. Proceed to PAK/LSV Tools tab,
    4. In the Create Package section, in the line Source Path, click on the three dots ...,
    5. Pick the main folder of "Cleric spells expanded",
    6. In the Create Package section, in the line Package Path, click on the three dots ...,
    7. Pick the Shared.pak copied in step 1,
    8. Click "Create package",
    9. Rename the file to ClericSpellsExpanded
    Now install it as any mod using BG3 Mod Manager.

    You can check if everything was done correctly by extracting your mod the same way we did with Shared.pak
    If it looks like what's in the folders we created during this process, then it should be fine

    Possible issues and how to deal with them

    Extracting package failed, pop up while extracting Shared.pak
    Read the popup. Most likely the version of the game has been changed. An update of the ExportTool is needed in this case. For other popups...well...google is your friend

    I created two spell list mods, and only one works
    Either one of them is done incorrectly, or one overwrites the other. I didn't investigate further how to solve this, I just dumped all spell edits into one mod.
    Should anyone know how to fix it another way, please chime in

    It's the only mod installed, and it doesn't work still
    Double check your writing for sure. Worst case scenario, start from the beginning. Most likely there is a typo in the code.

    Where do I get spells to add them to the list?
    You can look on the web. I use the list from CheatEngine forum. If unsure, like for example with Shield spell, you can double check in the SpellList in either SharedDev or Shared.
    I do not recommend adding spells that are created for other units (like for Mind Flayers). I never did this, I don't know what would happen. Do it at your own if you wish, but don't blame me :V

    I added spell-like ability (e.g. Archfey's Fey Presence), and it doesn't show up
    Spell-like ability =/= spell. Once I figure out how to do it, I will post a follow up
Last edited by Slavic Sorcerer on November 1st, 2023, 21:17, edited 3 times in total.
It's just my opinion, not the absolute truth
___________________________________

"Why don't you put that in your signature instead of having to type it every week?"
~Dead about me being gay

"Read his signature, he's gay"
~Dead
User avatar
Slavic Sorcerer
Posts: 355
Joined: Sep 9, '23
Location: Poland

Post by Slavic Sorcerer »

Editing spell list for beginners - class specific followup

I decided to leave it as a separate thing. The guide is already a walltext.

There is a difference in how you mod spell lists between classes that prepare spells, and classes that memorize them
This also plays a role when you're making your own custom class

Classes preparing spells know every spell, but they have limited slots to prepare them based on their class, and they can change it on a whim

Classes memorizing spells pick one (or otherwise) spell every level up, and they can exchange spells during level up too

Classes that prepare spells are: Cleric, Druid, Paladin

Classes that memorize spells: Bard, Sorcerer, Warlock, Eldritch Knight, Arcane Trickster, Ranger, Wizard*

*Wizard is a special case. From gameplay point of view, does both, but in terms of modding, we would mod Wizard as a class that memorizes spells. Also, I never made a mod for Wizard, I just looked at the lists and found pararells

(if I missed a spellcasting class, please tell me, I'm writing it from the top of my head)

Prepare spells classes
The case is pretty simple. The lists just look like this
I'll use Druid as an example
► Show Spoiler
Take look at the list of spells. Level 1 spells are placed in "Druid spells level 1", Level 2 spells in "Druid spells level 2"
Cure Wounds spell appears only in the Level 1 spell list, but it doesnt in Level 2
Darkvision appears only in the Level 2 spell list, but it doesnt in Level 1

Make sure to place in their respective spell level. Placing them in different spell level nodes will render the mod not working at best, and crashing your game at worst.
The placing of the spell makes no difference gameplay wise. You can make sure it's alphabetical, but it's not necessary. Simply placing them in the correct node is enough

Memorizing spells classes

It gets a little more messy with those kinds of classes.
Sorcerer will be the example here
► Show Spoiler
Notice how looooong the spell list is at Level 2. This is because every spell from Level 1 is repeated here
It is done to allow Sorcerers (and in turn, other memorizing spells classes) to pick spells at any time; like picking Sleep spell at level 7

When editing the spell lists for those classes, it is important to make sure the new spell appears on every appropriate list, or you won't be able to pick it later on.
E.g. Cure Wounds is a Level 1 spell, and we have to add it in Level 1 node, Level 2, Level 3, Level 4, Level 5, and Level 6

The placement on the list also matters
If you put Cure Wounds at the beginning of every list, it will appear next to Level 2, Level 3, Level 4 etc. spells. While functionality is not affected, it looks off

You can't also place Spirit Guardiansin Level 1 list, because it won't work. It requires to edit the Spirit Guardians spell itself to do so
You would place Spirit Guardians on the lists from Level 3 and up

What about cantrips?

Editing it is the simplest out of the bunch.
► Show Spoiler
Every time the class picks a cantrip, their respective Cantrip list will be called
Placing Sacred Flame on the Wizard's cantrip list will make the cantrip one of the options when that happens

As always, I appreciate feedbacks and corrections, so don't hesitate
It's just my opinion, not the absolute truth
___________________________________

"Why don't you put that in your signature instead of having to type it every week?"
~Dead about me being gay

"Read his signature, he's gay"
~Dead
User avatar
Slavic Sorcerer
Posts: 355
Joined: Sep 9, '23
Location: Poland

Post by Slavic Sorcerer »

I added spell-like ability (e.g. Archfey's Fey Presence), and it doesn't show up
Spell-like ability =/= spell. Once I figure out how to do it, I will post a follow up
I have a follow up on this.

Yes, you can add spell-like abilities to the spell list.

It works the same way as spells do, but there is a caveat:

Memorizing spells classes - you can prepare this spell. It won't be shown on the list of the spells prepared, but it will take a slot (even though visually it won't fill out the slot), and it will not consume spell slots unles stated otherwise or unless you edit the ability to do so. Same goes for short/long rest cooldowns.

Prepare spells classes
- the spell-like ability will be one of the options to be picked like any spell would. All other properties, unless edited, will be the same as if you gained this as an ability.

Using it as a cantrip option - I'm 99.9% sure it will work, since it worked by just slapping it on the spell list.

Should I do it?
It's really up to you.
The upside is that you don't have to bother yourself with progression list edition (something I'm working on but a day is only 24h, so apologies), and if you - like me - are not satisfied with the e.g. Druid spell list, it might be an option

The downside is that it takes a precious slot that a spell could take. A spell that would not be limited by casting once per short/long rest

Does it work with Channel Divinity/Oath spell-like abilities?
It does, but unless those abilities are edited, they will require their respective resources (e.g. channel divinity charges) that naturally only a Cleric can obtain, unless edited + it will take up a slot from prepared spells
There are pieces of gear that grant the character wearing them those resources. Clerics can get an amulet from the temple in Act 3 while Paladins can obtain a piece of chest armor in Act 2 from one of the Moonrise Towers vendors

Does it work for every spell like ability?
I assume that yes. However I didn't test every single ability in that way, so I cannot be certain + editing progression will save you memory/preparation spell slots
It's just my opinion, not the absolute truth
___________________________________

"Why don't you put that in your signature instead of having to type it every week?"
~Dead about me being gay

"Read his signature, he's gay"
~Dead
User avatar
orinEsque
Posts: 251
Joined: Oct 9, '23

Post by orinEsque »

Found this great bg3 modding resource
If confused looking up this place first is a good idea:
https://github.com/BG3-Community-Librar ... brary/wiki
Last edited by orinEsque on November 7th, 2023, 22:55, edited 1 time in total.
BG3 No Alphabets - remove modern day identity politics and irrationalities from Faerun.
BG3 Alternate Wyll Revamped - A revamped and complete version of the infamous white Wyll mod.
User avatar
dantrag28
Posts: 12
Joined: Nov 18, '23

Post by dantrag28 »

Heya, do you do AI voice Tav requests? If so, what could we do to help? I have about 12 minutes of IWD dialogue that I generated with 11Labs AI. Thanks.
User avatar
orinEsque
Posts: 251
Joined: Oct 9, '23

Post by orinEsque »

dantrag28 wrote: November 18th, 2023, 09:40
Heya, do you do AI voice Tav requests? If so, what could we do to help? I have about 12 minutes of IWD dialogue that I generated with 11Labs AI. Thanks.
Not me unfortunately. There's thousands of lines. And after doing the no alphabets mod I'll be doing my own personal projects.

However if you want to learn to make your own i can give you pointers.
BG3 No Alphabets - remove modern day identity politics and irrationalities from Faerun.
BG3 Alternate Wyll Revamped - A revamped and complete version of the infamous white Wyll mod.
User avatar
dantrag28
Posts: 12
Joined: Nov 18, '23

Post by dantrag28 »

orinEsque wrote: November 18th, 2023, 16:40
dantrag28 wrote: November 18th, 2023, 09:40
Heya, do you do AI voice Tav requests? If so, what could we do to help? I have about 12 minutes of IWD dialogue that I generated with 11Labs AI. Thanks.
Not me unfortunately. There's thousands of lines. And after doing the no alphabets mod I'll be doing my own personal projects.

However if you want to learn to make your own i can give you pointers.
I've seen a tutorial video on YouTube, it moves fast, and might as well be in Klingon. If you have a link to a simplified walkthrough, that'd be great! When I say "simplified", I mean for people with severe computer skill issues. Thanksi
User avatar
orinEsque
Posts: 251
Joined: Oct 9, '23

Post by orinEsque »

dantrag28 wrote: November 18th, 2023, 17:40
orinEsque wrote: November 18th, 2023, 16:40
dantrag28 wrote: November 18th, 2023, 09:40
Heya, do you do AI voice Tav requests? If so, what could we do to help? I have about 12 minutes of IWD dialogue that I generated with 11Labs AI. Thanks.
Not me unfortunately. There's thousands of lines. And after doing the no alphabets mod I'll be doing my own personal projects.

However if you want to learn to make your own i can give you pointers.
I've seen a tutorial video on YouTube, it moves fast, and might as well be in Klingon. If you have a link to a simplified walkthrough, that'd be great! When I say "simplified", I mean for people with severe computer skill issues. Thanksi
Hmm I can type the steps out for you? Would that help?
BG3 No Alphabets - remove modern day identity politics and irrationalities from Faerun.
BG3 Alternate Wyll Revamped - A revamped and complete version of the infamous white Wyll mod.
User avatar
dantrag28
Posts: 12
Joined: Nov 18, '23

Post by dantrag28 »

orinEsque wrote: November 18th, 2023, 17:51
dantrag28 wrote: November 18th, 2023, 17:40
orinEsque wrote: November 18th, 2023, 16:40

Not me unfortunately. There's thousands of lines. And after doing the no alphabets mod I'll be doing my own personal projects.

However if you want to learn to make your own i can give you pointers.
I've seen a tutorial video on YouTube, it moves fast, and might as well be in Klingon. If you have a link to a simplified walkthrough, that'd be great! When I say "simplified", I mean for people with severe computer skill issues. Thanksi
Hmm I can type the steps out for you? Would that help?
That be great, Thanks! Whenever you get time.
Post Reply