Class Descriptions - BG3-Community-Library-Team/BG3-Community-Library GitHub Wiki
Class Descriptions are not text descriptions for the class -- those are Localization strings. These nodes are where we define our class. If you're using Community Library, you can find the file for this in Public/ModName/ClassDescriptions/ClassDescriptions.lsx
. If you aren't, in your folder structure for your mod, this will be located in ModName/Public/ModName/ClassDescriptions/ClassDescriptions.lsx
.
Although this guide covers making an entire class, the steps are similar for subclasses, with only a few minor differences.
Here's an example of a class node, provided by MailMe's Death Knight that was graciously donated to the Community Library:
<node id="ClassDescription">
<attribute id="BaseHp" type="int32" value="12"/>
<attribute id="CanLearnSpells" type="bool" value="false"/>
<attribute id="CharacterCreationPose" type="guid" value="0f07ec6e-4ef0-434e-9a51-1353260ccff8"/>
<attribute id="ClassEquipment" type="FixedString" value="EQP_CC_DeathKnight"/>
<attribute id="Description" type="TranslatedString" handle="h8f688ae8g8104g4542g94cfge4d0b1d5318c" version="1"/>
<attribute id="DisplayName" type="TranslatedString" handle="h0ac042b8g9c9eg40f3g88dag83496ad4b8a8" version="1"/>
<attribute id="HpPerLevel" type="int32" value="7"/>
<attribute id="LearningStrategy" type="uint8" value="1"/>
<attribute id="MustPrepareSpells" type="bool" value="false"/>
<attribute id="Name" type="FixedString" value="DeathKnight"/>
<attribute id="PrimaryAbility" type="uint8" value="3"/>
<attribute id="ProgressionTableUUID" type="guid" value="29b323b1-d1fa-4882-a8f3-d4cb0ad6c158"/>
<attribute id="SoundClassType" type="FixedString" value="Fighter"/>
<attribute id="SpellCastingAbility" type="uint8" value="5"/>
<attribute id="UUID" type="guid" value="52296c38-fbb5-4e3a-a728-0420884ed152"/>
<children>
<node id="Tags">
<attribute id="Object" type="guid" value="c7bdcdf2-15e7-456e-adf1-21dda3172e18"/>
</node>
<node id="Tags">
<attribute id="Object" type="guid" value="1ae7017c-4884-4a43-bc4a-742fa0d201c0"/>
</node>
</children>
</node>
###BaseHp This is the Base HP value of the class. When a player selects your class, their character will have this HP at Lvl. 1.
###CanLearnSpells
If set to true
, characters with this class can learn spells from scrolls, similar to Wizard.
###CharacterCreationPose This references the pose that the class should have during Character Creation. This is typically the same value for all playable classes, so just copy this from an existing vanilla node in your file.
###ClassEquipment This string matches the name of an equipment entry. Equipment entries contain the starting equipment your class receives.
###Description This is the localization handle UUID for your class's description.
###DisplayName This is the localization handle UUID for your class's display name.
###HpPerLevel The base amount of HP gained per level. This is further increased by a character's Constitution modifier. That process is done automatically, so you don't need to worry about it.
###LearningStrategy Not much is known about this command, but the value for most classes is 1. For Archfey Warlock, it's 2.
###MustPrepareSpells A boolean value that determines whether the class must prepare spells, similar to Cleric and Wizard.
###Name The internal name for this Class, used to reference in other locations. Keep in mind that this may not necessarily be the same as your class's display name.
###PrimaryAbility The primary attribute used for the class. Each number corresponds to an ability score:
- Strength
- Dexterity
- Constitution
- Intelligence
- Wisdom
- Charisma
###ProgressionTableUUID The TableUUID value of the class's progressions. This is used in each progression node so the game knows that each level is associated with a specific class.
###SoundClassType The sounds this class makes. If you're making a class, copy the name of a class whose sounds are most fitting for your class. If you're making a subclass, pick the same name as the main class it's associated with.
###SpellCastingAbility
Similar to PrimaryAbility
, except this identifies the class's spellcasting ability. If your class is not a spellcasting class, use 4 for Intelligence. This is standard for D&D's martial classes.
###UUID The UUID identifier for this specific node. Every single node in every .lsx file has a UUID. This is used to reference the node in other nodes and in various locations in the code.
It is extremely important, when updating your mod after publication, to avoid changing this field. Doing will make your mod malfunction in saves that use it, and that could corrupt those saves.
###Tags These are located at the bottom of the node. Tags determine whether characters can access various dialogue options in the game, and they are sometimes checked in the code of spells, passives, statuses, etc. For now, only plan to pull from existing tags if necessary.
In your ClassDescriptions.lsx
file, paste the following boilerplate code:
<node id="ClassDescription">
<attribute id="BaseHp" type="int32" value="NUMERAL"/>
<attribute id="CanLearnSpells" type="bool" value="TRUE_OR_FALSE"/>
<attribute id="CharacterCreationPose" type="guid" value="0f07ec6e-4ef0-434e-9a51-1353260ccff8"/>
<attribute id="ClassEquipment" type="FixedString" value="EQUIPMENT_ENTRY_NAME"/>
<attribute id="Description" type="TranslatedString" handle="HANDLE_UUID" version="1"/>
<attribute id="DisplayName" type="TranslatedString" handle="HANDLE_UUID" version="1"/>
<attribute id="HpPerLevel" type="int32" value="NUMERAL"/>
<attribute id="LearningStrategy" type="uint8" value="1"/>
<attribute id="MustPrepareSpells" type="bool" value="TRUE_OR_FALSE"/>
<attribute id="Name" type="FixedString" value="NAME"/>
<attribute id="PrimaryAbility" type="uint8" value="NUMERAL"/>
<attribute id="ProgressionTableUUID" type="guid" value="UUID"/>
<attribute id="SoundClassType" type="FixedString" value="EXISTING_CLASS_NAME"/>
<attribute id="SpellCastingAbility" type="uint8" value="NUMERAL"/>
<attribute id="UUID" type="guid" value="UUID"/>
</node>
After doing so, make the following replacements using the explanations in the previous section as a guide:
- NUMERAL = a number that corresponds to the relevant attribute
- TRUE_OR_FALSE =
true
orfalse
- EQUIPMENT_ENTRY_NAME = the name of your equipment entry. For a new class, you can slot in an existing equipment entry until you make your own (or you can just leave it if you want). For a subclass, make sure this matches the equipment entry name of the main class.
- Using Modder's Multitool, tick "Handle", and generate a new UUID.
- Copy the UUID(click on it's display), and paste it into Description's handle value.
- Do the same for DisplayName.
- Write an internal name, prefixed with CL_ to help ensure there aren't any collisions with other mods
- Set the ClassSoundSwitch based on another similar class.
- Untick "Handle" in Modder's Multitool, and generate a new UUID, pasting it into the UUID attribute's handle field.
- Set your Class' base HP value.
- Set your Class' Primary Attribute and Spellcasting Modifier Attribute.
- Decide if you want your class to learn spells from scrolls, or if you class must prepare spells to use them.
Leave the Progression UUID field blank for now. We'll come back to that in the Progressions section. Same goes for Class Equipment. Once you've finished making your class' ClassDescription node, we'll move on to Ability Distribution.