CharGen Fixes

Summary

This mod is a builder resource and will just contain bug fixes to the Dragon Age: Origins character generation UI, CharGen. Currently it only contains one fix for a crashing issue, but there are some issues remaining to be addressed at a later date once the scope of the change is understood fully.

Currently the UI is for v1.04, and should work with v1.03 no problem as well. It's not compatible with older game versions because of differing texture atlases, but the scripting change is the same, so perhaps available by special request for older versions if it's needed.

Download Location

Currently available on the BSN here.

Using It in Your Own Mod

It should suffice to put the file under AddIns\[UID]\module.

Bugs Fixes

Crashing because of the background string ID

As noted in the toolset wiki's backgrounds tutorial, using string IDs in the unreserved range will cause the game to crash.

Originally the UI was using an array like this to check whether a certain string ID had already been seen:

var aStringCheck = [];
// ...
// ... nested for-loops
       var bBackgroundAllowedByRace = Number(ExternalCommands.Get2DAValueByRowIndexColumnName(_2DA.TABLE_BACKGROUND, nBackgroundRow, RaceGenderScene.m_aRaces[nRaceIndex].sLabel));
       var nDescStringID = Number(ExternalCommands.Get2DAValueByRowIndexColumnName(_2DA.TABLE_BACKGROUND_DESC, nBackgroundRow, RaceGenderScene.m_aRaces[nRaceIndex].sLabel));
       if (bBackgroundAllowedByRace == 1 && aStringCheck[nDescStringID] == null)
       {
                    aStringCheck[nDescStringID] = nDescStringID;

       }
// ... end nested for-loops

The mod has altered it to instead use dictionary lookup instead.

var aStringCheck = {};
// ...
// ... nested for-loops
       var bBackgroundAllowedByRace = Number(ExternalCommands.Get2DAValueByRowIndexColumnName(_2DA.TABLE_BACKGROUND, nBackgroundRow, RaceGenderScene.m_aRaces[nRaceIndex].sLabel));
       var nDescStringID = Number(ExternalCommands.Get2DAValueByRowIndexColumnName(_2DA.TABLE_BACKGROUND_DESC, nBackgroundRow, RaceGenderScene.m_aRaces[nRaceIndex].sLabel));
       if (bBackgroundAllowedByRace == 1 && aStringCheck["" + nDescStringID] == null)
       {
                    aStringCheck["" + nDescStringID] = nDescStringID;

       }
// ... end nested for-loops