//Example - It is recomended that EmeraldComponent is cached somewhereEmeraldSystem EmeraldComponent =GetComponent<EmeraldSystem>();EmeraldAPI.Faction.SetFactionLevel(EmeraldComponent,"Undead",RelationTypes.Enemy);
Add Faction Relation
Adds the Faction and Faction Relation to the AI's Faction Relations List. Note: The faction must exist within the Emerald Faction Manager's Faction List.
//Example - It is recomended that EmeraldComponent is cached somewhereEmeraldSystem EmeraldComponent =GetComponent<EmeraldSystem>();EmeraldAPI.Faction.AddFactionRelation(EmeraldComponent,"Undead",RelationTypes.Enemy);
Get Target Faction Relation
Gets the relation of the passed target and this AI in the form of a string (Enemy, Neutral, or Friendly). If a faction cannot be found, or if it is not a valid target, you will receive a value of Invalid Target.
//Example - It is recomended that EmeraldComponent is cached somewhereEmeraldSystem EmeraldComponent =GetComponent<EmeraldSystem>();EmeraldAPI.Faction.GetTargetFactionRelation(EmeraldComponent, YourTargetTransform);
Get Target Faction Name
Gets the faction name of the passed AI target. The AI's own transform can also be passed to get its own faction name.
//Example - It is recomended that EmeraldComponent is cached somewhereEmeraldSystem EmeraldComponent =GetComponent<EmeraldSystem>();EmeraldAPI.Faction.ChangeFaction(EmeraldComponent,"Undead");
Copy Faction Data
Copies all faction data from the FactionDataToCopy and applies it to the EmeraldComponent. This is the AI Faction Relations List (within the Faction Settings foldout of the Detection Component).
Note: The AI's EmeraldComponent is the one who will receive the FactionDataToCopy AI's faction data.
//Example - It is recomended that EmeraldComponent is cached somewhereEmeraldSystem EmeraldComponent =GetComponent<EmeraldSystem>();EmeraldAPI.Faction.CopyFactionData(EmeraldComponent, TheEmeraldComponentToCopy);