• Please note that we've updated the Mount & Blade II: Bannerlord save file system which requires you to take certain steps in order for your save files to be compatible with e1.7.1 and any later updates. You can find the instructions here.

In Progress General 1.6.5 Customization of EncyclopediaPage in modding

Users who are viewing this thread

Version number
e1.6.5
Branch
Beta
Modded/unmodded
Unmodded

jffifa

Recruit
The constructor code of TaleWorlds.CampaignSystem.Encyclopedia.EncyclopediaPage says:
C#:
public EncyclopediaPage()
{
    ...
    object[] list = GetType().GetCustomAttributes(typeof(EncyclopediaModel), inherit: true);
    foreach (object returnList in list)
    {
        if (returnList is EncyclopediaModel)
        {
            _identifierTypes = (returnList as EncyclopediaModel).PageTargetTypes;
            break;
        }
    }
    _identifiers = new Dictionary<Type, string>();
    Type[] enumerator = _identifierTypes;
    foreach (Type type in enumerator)
    ...
}

Here the class inheriting EncyclopediaPage is considered attributed by TaleWorlds.CampaignSystem.Encyclopedia.EncyclopediaModel, which is an internal class. But in modding scenario we can only attribute our new EncyclopediaPage class with TaleWorlds.CampaignSystem.Encyclopedia.OverrideEncyclopediaModel. I doubt if there is bug in the code above that EncyclopediaModel shall be replaced by TaleWorlds.CampaignSystem.Encyclopedia.EncyclopediaModelBase, which is base class of both EncyclopediaModel and OverrideEncyclopediaModel.
 

MArdA TaleWorlds

Community Support & Localization
Community Support
M&BWBWF&SNWVC
Forwarded to the QA team for further investigation. We will reach out again if we need more information. Thanks for reporting and sorry for any inconvenience!
 
Top Bottom