I have an odd one for you. The faction member for a specific NPC (Bartholomew) changes when I change scenes - specifically from "Bartholomew" to "Sairyn." This does not happen with any other character from what I can tell. I think this has been a bug for a while, and I just didn't notice it because it doesn't really affect gameplay that much.
YT video:
I tried the following:
Deleting the FactionMember component on Bartholomew's prefab and in each scene and recreating them
Restoring the faction database from an old version from 4 months ago
Pounding my head against the desk after 3 hours (j/k)
The fact that it changes to Sairyn, who is faction member #0, suggests to me that maybe the Bartholomew FactionMember component's internal faction ID isn't set or isn't transferring over properly, and so the ID is defaulting to a non-initialized value of 0.
When you change scenes, are the other NPCs' factions correct?
Are there any errors or warnings in the Console window?
Are you using the save system to change scenes? If so, are you using a FactionMemberSaver component and/or FactionManagerSaver, or something else?
I was thinking something similar regarding the internal faction numbers, but couldn't figure it out.
To answer your questions:
When you change scenes, are the other NPCs' factions correct? Yes
Are there any errors or warnings in the Console window? No
Are you using the save system to change scenes? If so, are you using a FactionMemberSaver component and/or FactionManagerSaver, or something else? Yes, yes, yes.
Happy to look at additional things if you have more ideas; I imagine it's some weird nonsense that I've created. That said, there is no where in my code that changes someone's faction.
At any time, please feel free to send another repro project to reproduction project to tony (at) pixelcrushers.com.
Does Bartholomew's faction go wrong when you save and load a game?
If you tick the SaveSystem and SavedGameDataStorer component's Debug checkboxes and then play and save in the Unity editor's play mode, it will log the save data to the Console window. Here's an example of the save data from Love/Hate's example scene:
Save System: Storing in PlayerPrefs key Save1: {"m_version":0,"m_sceneName":"LH Example with Save System","m_list":[
{"key":"factionManager","sceneIndex":-1,"data":"7,0,Player,0,0,0,0,0,1,Citizens,50,0,20,0,2,2,1,-50,1,1,100,2,Bandits,-50,20,-10,0,2,1,1,-50,2,1,100,3,Princess,80,-30,20,1,1,3,2,1,-70,5,1,-80,6,1,20,4,Cat Girl,10,20,30,1,1,0,5,Horn Girl,-80,50,0,1,2,1,3,1,-80,6,Pink Girl,-40,0,40,1,2,2,5,1,80,3,1,50,"},
{"key":"pink","sceneIndex":-1,"data":"6,0,0,0,0,0,"},
{"key":"princess","sceneIndex":-1,"data":"3,0,0,0,0,0,"},
{"key":"player","sceneIndex":-1,"data":"0,0,0,0,0,0,"},
{"key":"cat","sceneIndex":-1,"data":"4,0,0,0,0,0,"},
{"key":"horn","sceneIndex":-1,"data":"5,0,0,0,0,0,"}]}
I bolded the faction IDs in the save data above.
In the Faction Manager data, each character's faction ID appears before the faction name. For example, the Princess's faction ID is 3.
In the Faction Member data for each character, the ID is the first number in the "data" string. Above again the Princess's faction ID is 3.
I see "...,15,Bartholomew,0,0,...", so it should be setting Bartholomew's faction to 15, which I presume is his faction. At the least, it's not faction 0 (Sairyn). Strange that it's only Bartholomew. Is there anything unique about his GameObject? Any unique scripts?