Do you have multiple campaignbehaviors with the name UCDialogues, or are you using custom stringid for your behavior?Alright, a bit of necro here ...
I used this methods for a long time in my mod UsefulCompanions to store data about the auto buy food features i implemented in it, and it worked very fine for more than a year until i got people recently complaining the feature was resetting back to default values on each game loading (default is off).
I was using this simple method
and today when i put a break point in there i can see the point is correctly reached on saving but never on loading a game.Code:public override void SyncData(IDataStore dataStore) { //resuply data dataStore.SyncData("UC_resuply_active", ref qd.active); dataStore.SyncData("UC_resuply_day", ref qd.sDays); dataStore.SyncData("UC_resuply_gold", ref qd.goldMax); dataStore.SyncData("UC_resuply_moral", ref qd.improveM); }
I also checked how the campaign was doing it now and spotted a change in the SyncData method used, it was now with a type (<T>) so i changed it all to be like in TW code now, but surprisingly i don't have any better result. All seem to be fine on saving but when loaded it's simply skipped.
Here is a screen when actually saving, the dataStore object seem just like expected but apparently have no effect. I dug a bit in the code and the only method usingcampaignBehavior.SyncData(IDataStore)
is actuallyTaleWorlds.CampaignSystem.CampaignBehaviorDataStore
in the methodsinternal void SaveBehaviorData(CampaignBehaviorBase campaignBehavior)
andinternal void LoadBehaviorData(CampaignBehaviorBase campaignBehavior)
(and the dirty internal keyword here ...).
And i'm a bit clueless from here as to why it's not working anymore.
Additionally, if you send me your mod, we can debug it.