Larian Studios
So we have a tutorial on adding custom races races to the game, but does anyone have a handle on how we can remove certain races from character creation in a standalone adventure?

I'm pretty sure that the race presets get packed into shared.pak with the path "..\Mods\Shared\CharacterCreation\RacePresets". Would I need to unpack the whole thing, delete the unwanted races from the RacePresets directory and then re-distribute this shared.pak with my mod? Any suggestions or leads would be appreciated.
Files with the same name in your mod should override the ones in the Shared. So one thing you could try is to add empty files to your mod with the same name as the ones you want to get rid of. Or you could maybe add copies of one for a race you do want to keep with the same name as the ones you want to hide (no idea if that will add this race multiple times though).
Originally Posted by Tinkerer
Files with the same name in your mod should override the ones in the Shared. So one thing you could try is to add empty files to your mod with the same name as the ones you want to get rid of. Or you could maybe add copies of one for a race you do want to keep with the same name as the ones you want to hide (no idea if that will add this race multiple times though).


Yeah, I did try that trick of making copies and renaming the fields but as you theorized, it made additional copies of the race. I have not tried empty files though, so I'll see what that does.

Ironically, the challenge ended up changing how I want to do character creation anyway so I think I have a workaround, but I do want to know if this works so I will give it a shot. Thanks for the feedback!
After further investigation, I think the actual files of interest are the OriginPresets because it's in there that the available races are enumerated. For instance, Generic.lsx:


<?xml version="1.0" encoding="UTF-8" ?>
<save>
<header version="2" time="1387205254" />
<version major="1" minor="3" revision="0" build="0" />
<region id="CharacterCreationManager">
<node id="root">
<children>
<node id="OriginDesc">
<attribute id="OriginDisplayName" value="Custom" handle="he058b2afgcdf2g4c7ag939dga65bcfc0fad6" type="28" />
<attribute id="OriginName" value="Generic1" type="22" />
<attribute id="OriginDescription" value="Your past is history. All that matters is your present in Fort Joy. A Sourcerer in a land ravaged by Source, you await the cure promised by the Divine Order." handle="h5a614f15gea57g42d5gb7b0g29cff46fdf7c" type="28" />
<attribute id="OriginLongDescription" value="Very long descritpion goes here." handle="h032adcc1gd80cg4b81g8658g689437b36e4d" type="28" />
<attribute id="CharacterUUID" value="7b6c1f26-fe4e-40bd-a5d0-e6ff58cef4fe" type="22" />
<attribute id="UserCanAlterTags" value="1" type="19" />
<attribute id="SkillSet" value="Avatar_Generic" type="22" />

<children>
<node id="SupportedGenders">
<children>
<node id="Gender">
<attribute id="Gender" value="Female" type="23" />
</node>
<node id="Gender">
<attribute id="Gender" value="Male" type="23" />
</node>
</children>
</node>

<node id="SupportedRaces">
<children>
<node id="SupportedRaces">
<attribute id="Object" value="Human" type="22" />
</node>
<node id="SupportedRaces">
<attribute id="Object" value="Dwarf" type="22" />
</node>
<node id="SupportedRaces">
<attribute id="Object" value="Lizard" type="22" />
</node>
<node id="SupportedRaces">
<attribute id="Object" value="Elf" type="22" />
</node>
<node id="SupportedRaces">
<attribute id="Object" value="Undead_Human" type="22" />
</node>
<node id="SupportedRaces">
<attribute id="Object" value="Undead_Dwarf" type="22" />
</node>
<node id="SupportedRaces">
<attribute id="Object" value="Undead_Lizard" type="22" />
</node>
<node id="SupportedRaces">
<attribute id="Object" value="Undead_Elf" type="22" />
</node>
</children>
</node>
</children>
</node>
</children>
</node>
</region>
</save>


Unfortunately, I either don't know enough about how XML works or the game merges the shared and local mod versions in such a way that simply deleting the "SupportedRaces" nodes for undesired races does not remove them from character creation.

Originally Posted by Windemere
After further investigation, I think the actual files of interest are the OriginPresets because it's in there that the available races are enumerated. For instance, Generic.lsx:


<?xml version="1.0" encoding="UTF-8" ?>
<save>
<header version="2" time="1387205254" />
<version major="1" minor="3" revision="0" build="0" />
<region id="CharacterCreationManager">
<node id="root">
<children>
<node id="OriginDesc">
<attribute id="OriginDisplayName" value="Custom" handle="he058b2afgcdf2g4c7ag939dga65bcfc0fad6" type="28" />
<attribute id="OriginName" value="Generic1" type="22" />
<attribute id="OriginDescription" value="Your past is history. All that matters is your present in Fort Joy. A Sourcerer in a land ravaged by Source, you await the cure promised by the Divine Order." handle="h5a614f15gea57g42d5gb7b0g29cff46fdf7c" type="28" />
<attribute id="OriginLongDescription" value="Very long descritpion goes here." handle="h032adcc1gd80cg4b81g8658g689437b36e4d" type="28" />
<attribute id="CharacterUUID" value="7b6c1f26-fe4e-40bd-a5d0-e6ff58cef4fe" type="22" />
<attribute id="UserCanAlterTags" value="1" type="19" />
<attribute id="SkillSet" value="Avatar_Generic" type="22" />

<children>
<node id="SupportedGenders">
<children>
<node id="Gender">
<attribute id="Gender" value="Female" type="23" />
</node>
<node id="Gender">
<attribute id="Gender" value="Male" type="23" />
</node>
</children>
</node>

<node id="SupportedRaces">
<children>
<node id="SupportedRaces">
<attribute id="Object" value="Human" type="22" />
</node>
<node id="SupportedRaces">
<attribute id="Object" value="Dwarf" type="22" />
</node>
<node id="SupportedRaces">
<attribute id="Object" value="Lizard" type="22" />
</node>
<node id="SupportedRaces">
<attribute id="Object" value="Elf" type="22" />
</node>
<node id="SupportedRaces">
<attribute id="Object" value="Undead_Human" type="22" />
</node>
<node id="SupportedRaces">
<attribute id="Object" value="Undead_Dwarf" type="22" />
</node>
<node id="SupportedRaces">
<attribute id="Object" value="Undead_Lizard" type="22" />
</node>
<node id="SupportedRaces">
<attribute id="Object" value="Undead_Elf" type="22" />
</node>
</children>
</node>
</children>
</node>
</children>
</node>
</region>
</save>


Unfortunately, I either don't know enough about how XML works or the game merges the shared and local mod versions in such a way that simply deleting the "SupportedRaces" nodes for undesired races does not remove them from character creation.


I am curious to know if you found out how? As I am attempting it myself and haven't the feintest idea yet.
I try to delete some races for the Game Master Mode (probably not at the same place that the Main Campaign of DOS2), did you succeed ?
It seems it's exactly at the same place, because when I modify something, like the SkillSet of races, it modifies for every modes (Campaign & GM), but I cant disallow a race, I tried by putting "//" symbols before some lines, and it just loads the file from the Shared.pak file......... WTF Larian !? Are you facking serious ?

Same thing for Origins : I'm at 75% sure that Generic.lsx files are the ones used for creating Custom character(s), if I delete :

<node id="SupportedRaces">
<attribute id="Object" value="Human" type="22" />
</node>

=> Then the game just reload this part from the Shared.pak...............................

I want to scream at the face of the devs "WHYYYYYYYYYYYYYYYYY !!!???"... (I could, I live not far from you Larian :p )

I also tried to rename "SupportedRaces" by "UnSupportedRaces", because... Well... Why not, I'm desperate...
And, of course, didnt work...
Just for fun, I tried to add :

<node id="SupportedRaces">
<children>
<node id="SupportedRaces">
<attribute id="Object" value="Human" type="22" />
</node>
</children>

Just after :

<region id="CharacterCreationClass">
<node id="root">

of a base class, of course it didnt work...

Okay, I still have 2 possibilities :
- Create my own Character Creation module (I think I saw something like that on the Larian's Wiki ; EDIT : https://docs.larian.game/Tutorial_-_Implementing_a_Basic_Quest#Character_Creation ).
- Create my own Shared.pak file...

I took a look to the load order ( https://docs.larian.game/Modding_internals ) and nothing about "reloading the previous file if... We want..."...
Hmmmm no, it's for Story mode only, since GM Mode already have a CC...

Weeeellllll...
© Larian Studios forums