Jump to content

[Modding] TRAITS class static initializers reference the Db


SGT_Imalas
  • Branch: Preview Branch Version: Windows Fixed

The dlc3 additions the TRAITS class introduce the exact same issue as MinionConfig had here:

Its referencing the db in the static initializer for TRAIT_CREATORS when getting the attribute IDs for the "BionicBaseline" trait

This makes the class impossible for mods to patch, breaking mods that want to add their own traits or modify existing traits.

 

 

Please try to avoid doing meaningful work in static initializers in general.

Static initializers should not throw an exception, nor should they reference strings (which causes localization failures on patching) or the Db.

(these localization failures happen for example with the classes RoomConstraints, TRAITS and CustomGameSettingConfigs)

 


Steps to Reproduce
  1. Make any mod that tries to use TRAITS
  2. Mod will fail to load with
    F37570AC-2776-42D4-BB48-CE33BB5BAA0D.png.10d478a4b1f15cdaa46717b79e621d0e.png

 

(as for the localization failure side note, patching any of the mentioned classes while having any non-english translation active will cause the strings referenced inside these classes to load too early, keeping them untranslated)

  • Health 1



User Feedback


A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...