-
Notifications
You must be signed in to change notification settings - Fork 210
Building a Race Mod
One of the easiest ways to get into modding is create a custom race. Whether you have a cool homebrew concept, or there's an official race that Larian didn't add, there's a lot of room to play around in. This guide will walk you through the process of building a custom race.
- Getting Started
- File Layout
- Race Entry
- Character Creation
- Localization
- Root Templates
- Racial Feats
- Racial Progressions
- Custom Icons
There's a lot that goes into creating a custom race, but overall it's one of the easier things to do. This guide will go with the assumption that you're building this with the Community Library in mind. If you want to create a race, but don't want to include any parts of it in the community library, this guide will still be applicable, but you may need to make some modifications. You'll also want to skip the rest of this step and head straight to File Layout.
Building a mod for Community Library involves adding the base components into the Community Library, and building a separate Implementation Mod. To get started, make sure you've followed the steps outlined in our How to Contribute page, and have pulled down your own copy of the Community Library.
Now, before we start, let's just make sure we have the latest code.
- Open Gitbash in your Community Library folder.
- Input
get checkout main
to navigate to the main branch. - Input
git fetch && git pull
to make sure you have the latest version of the project - Finally, Input
git checkout -b BRANCHNAME
, substituting BRANCHNAME with a descriptive name of your branch.
For our Implementation Mod, we'll need to set up a file structure, outside of our Community Library folder. Let's assume something like this, and add and remove as we go:
ModName/ModName/
/Localization/English/ModName.xml
/Mod/meta.lsx
/Public/ModName/...
Of course, sub English with whichever language you want to release your mod in. For the sake of this tutorial, we'll assume English.
//TODO
First thing's first, we need to work on our races.lsx
entry.
//TODO
// TODO
// TODO
// TODO
// TODO
// TODO
Now that you've got everything set up, there's one thing that might be bothering you.
It exists, that's for sure. It might even be fine as is. But if you want something unique, something that draws the player's attention and really says "This is my custom race, right here," this section is for you.
I'm here to tell you that it's quite possible, with a bit of legwork. If you don't have an icon in mind yet, that's fine. Come back to this step when you've got something you want. This guide won't walk you through the artistic creation of the icon, although you'll want to make sure of a few things:
- Make sure your desired icon is 196x196.\
- Use the naming scheme
Race_Subrace.fileextension
(for example,Elf_ShadarKai.png
) - Save a copy of your icon in
.png
format - Save another copy in
.DDS
format (all caps).
Now you're ready to plug it in. To do this, you'll need to create a fork of BG3 ImprovedUI.
- Fork the Repository
- Clone your forked repository to your PC and make a new branch: `git checkout -b "MyRaceName-icons" 3.open it up in VSCode.
- Navigate to or create the directory
ImprovedUI/Public/Game/GUI/Assets/CC/icons_races
- Drop your race icons into the
icons_races
folder.
It's time to edit the .xaml files.
- Navigate to ImprovedUI/Public/Game/GUI/Assets/Library folder
- Open the file
DataTemplates.xaml
3 Look for theDataTrigger
elements referencing Racial icons. It will look something like this:
<DataTrigger Binding="{Binding Guid}" Value="a459ba68-a9ec-4c8e-b127-602615f5b4c0">
<Setter Property="OpacityMask">
<Setter.Value>
<ImageBrush ImageSource="pack://application:,,,/GustavNoesisGUI;component/Assets/CC/icons_races/Elf_WoodElf.png"/>
</Setter.Value>
</Setter>
</DataTrigger>
- If making a subrace, find the
DataTrigger
that is nearest to your subraces main race, otherwise go to the last of the Race-relatedDataTriggers
. - Copy and Paste the
DataTrigger
and its child elements beneath the one you found. - Edit the
component/Assets/CC/icons_races/filename.png
to match your race icon's filename. - Save the file
So we're ready to make a Pull Request and make this official, right? Not quite. First, let's test the icon - make sure it looks like how you want it.
- Open LSLib's ConverterApp
- Navigate to PAK/LSV Tools
- Under "Create Package," set the Priority field to 21
- Also make sure the version is V18 (Baldur's Gate 3 Release)
- Enter your Source Path and expected Package Path for your local version of ImprovedUI and hit "Create Package."
- Import your new
ImprovedUI.pak
into your load order, save it, and then load the game. - See if it looks good, and make any adjustments if you think it needs changing.
Now it's time to submit this to ImprovedUI. Don't worry, most of this will just involve waiting for it to be accepted.
- Using Gitbash, add the changed and added files to your commit:
git add ImprovedUI/Public/Game/GUI
- use
git commit
to make your commit. -
use
git push --set-upstream origin BRANCHNAME`, subbing BRANCHNAME for the branch name we set up earlier in this section. - Open your forked repo on github. There'll be a little notification that looks something like this:
- Select "Contribute" and proceed through the steps to make a Pull Request.
We're technically done, but this last step will be good to have, just in case. At the start of the section, we dropped our icons into ImprovedUI's icons_races
folder. We're going to want to do that for our mod, as well.
Now, because Community Library doesn't cover Character Creation bits and pieces, there's no need to submit a Pull Request for the icons - you'll want to keep them with your implemented mod.
- In your ModName/Public, folder, create the following folder structure:
Game\GUI\Assets\CC\icons_races
- Drop your racial icons into
icons_races
.
Now you're good to go. I recommend doing one last test, and when you're sure it works, submit it to Nexus!
- Overview
- Sample Projects
- Action Resources
- Spells
- Passives
- Statuses
- Items
- Races
- Classes
- Scripts
- Visual Resources
Setting up a Development Environment (BEING REWRITTEN)
- A Modder's Guide to Git
- Recommended/Required Tools
- Creating Your Folder Structure
- Working with the Repo
- How to Use the Multitool
- Class Descriptions
- Ability Distribution Presets
- Progressions
- Localization
- Abilities, Passives, and Spells
- Passive and Spell Lists
- Custom Equipment
- Class Icons
- Skill Icons (TODO)
- Handling Subclasses (TODO)
- Race Entry
- Root Templates
- Character Visuals
- Character Creation
- Localization
- Racial Feats
- Racial Progressions
- Tags
- Custom Icons