Im long user of Dialogue System and now i have to start using also Love/Hate
However i think i don't fully inderstand the concept behind it.
What i'm trying to achieve is that:
- My game can randomly spawn/generate hundreds of units in the game. Each unit of course can be gameobject/i'm tracking state of every unit in the game and im applying that on the spawn.
- Now every single unit in my game can for example trade with the player. So player can buy something from a unit, or sell something.
- My every unit is described with the name like unit_12342345 where numbers are just generated code based on my grid graph.
- Now in Love/Hate i have basic relationship called Affinity and 2 factions: Player, Traders
- Each unity has component FactionMember with Traders selected as Faction
- After each transaction with unit i want to modify relationship between THAT unit and the player. So if you are buying more from the same unity, the better prices You will have, based on the affinity. So imagine that each transaction increases affinity by 0.1 BUT only towards that specific unit.
And now i have problem. I tried to use this code:
Code: Select all
int affinityID = FactionManager.instance.factionDatabase.GetRelationshipTraitID("Affinity");
FactionManager.instance.factionDatabase.ModifyPersonalRelationshipTrait(gameObject.name, "CharacterPlayer", affinityID, 0.1f);
var affinityValue = FactionManager.instance.GetAffinity(gameObject.name, "CharacterPlayer");
Debug.Log($"Affinity from {gameObject.name} to Player is: {affinityValue}");
FindFaction always return -1 in that case.
Does it mean i would have to make hundreds or thousands of faction, for every single unit in my game to support it?
Or can i have just one faction called Traders and have relation towards FactionMember?
Best