Repair Faction Database

Announcements, support questions, and discussion for Love/Hate.
Post Reply
cptscrimshaw
Posts: 113
Joined: Sun Sep 20, 2020 8:21 pm

Repair Faction Database

Post by cptscrimshaw »

Is there a way to repair the Faction Database? Somehow the factionIDs aren't matching up with the names. It looks right in the inspector, but when I call something like

Code: Select all

.GetComponent<FactionMember>().faction
it is returning another NPCs faction instead of the one that's shown in the faction manager on that NPC.

I've noticed this happens after saving the game many times... there shouldn't be anything that'd changing the faction ids/names in the saving/loading process, right?
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Repair Faction Database

Post by Tony Li »

Hi,

Are you using a PersistentFactionMember or FactionMemberSaver to save faction member data in saved games?

If you're using PersistentFactionMember, please update to the latest Love/Hate version and import the included Dialogue System Support package. (If you can't update, let me know and I'll post a patch.)

If you're using FactionMemberSaver, make sure the Key is a unique value.
cptscrimshaw
Posts: 113
Joined: Sun Sep 20, 2020 8:21 pm

Re: Repair Faction Database

Post by cptscrimshaw »

Thanks Tony!

I updated to the current version (I am using the PersistentFactionMember class) and will let you know if I run into any weird id/name reassigning.
cptscrimshaw
Posts: 113
Joined: Sun Sep 20, 2020 8:21 pm

Re: Repair Faction Database

Post by cptscrimshaw »

I'm getting this error on a couple of my NPCs that have a FactionMember class. They appear to be set up the same as all the others.

Code: Select all

InvalidOperationException: Queue empty.
System.Collections.Generic.Queue`1[T].Dequeue () (at <e40e5a8f982c4b618a930d29f9bd091c>:0)
PixelCrushers.LoveHate.FactionMember.DeserializeFromString (System.String s) (at Assets/Plugins/Pixel Crushers/LoveHate/Scripts/Core/Faction Members/FactionMember.cs:1208)
PixelCrushers.DialogueSystem.LoveHate.PersistentFactionMember.OnApplyPersistentData () (at Assets/Plugins/Pixel Crushers/Dialogue System/Third Party Support/LoveHate Support/Scripts/PersistentFactionMember.cs:44)
UnityEngine.GameObject:SendMessage(String, SendMessageOptions)
PixelCrushers.DialogueSystem.Tools:SendMessageToEveryone(String) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Utility/Tools.cs:235)
PixelCrushers.DialogueSystem.PersistentDataManager:SendPersistentDataMessage(String) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Save System/PersistentDataManager.cs:207)
PixelCrushers.DialogueSystem.PersistentDataManager:Apply() (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Save System/PersistentDataManager.cs:198)
PixelCrushers.DialogueSystem.PersistentDataManager:ApplySaveData(String, DatabaseResetOptions) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Save System/PersistentDataManager.cs:247)
PixelCrushers.DialogueSystem.DialogueSystemSaver:ApplyData(String) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Save System/DialogueSystemSaver.cs:104)
PixelCrushers.SaveSystem:ApplySavedGameData(SavedGameData) (at Assets/Plugins/Pixel Crushers/Common/Scripts/Save System/SaveSystem.cs:912)
PixelCrushers.<LoadSceneCoroutine>d__135:MoveNext() (at Assets/Plugins/Pixel Crushers/Common/Scripts/Save System/SaveSystem.cs:1042)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
Any thoughts on what to check?
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Repair Faction Database

Post by Tony Li »

Is this from an old save, or from a saved game made after updating and importing the Dialogue System Support package? This will help determine if the problem is with the old saved game or with the new PersistentFactionMember component.
cptscrimshaw
Posts: 113
Joined: Sun Sep 20, 2020 8:21 pm

Re: Repair Faction Database

Post by cptscrimshaw »

I forgot to apply the Dialogue System Support package :? Everything seems to be ok now. Thanks!
Post Reply