For a mod I'm working on, I need to determine in a script if the PC is hostile, friendly, or neutral toward a creature. Unfortunately, I can't find a GetFaction() function or the equivalent. I've tried GetReputation(), but a check with my character as oSource and a hostile character as oTarget is returning values over 10, which doesn't match the documentation. (below) Am I just using GetReputation() incorrectly, or is there some other way to determine this?
// 208: Get an integer between 0 and 100 (inclusive) that represents how oSource
// feels about oTarget.
// -> 0-10 means oSource is hostile to oTarget
// -> 11-89 means oSource is neutral to oTarget
// -> 90-100 means oSource is friendly to oTarget
// * Returns -1 if oSource or oTarget does not identify a valid object
int GetReputation(object oSource, object oTarget);
*Update*
I've figured out that GetReputation() works fine everywhere but the place I'm using it - k_def_death01. I'm trying to detect all deaths and act based on faction. Does anyone have a way around GetReputation()? Apparently it wasn't made to work with death scripts.
you managed also to add new factions?
No, not new factions - I'm just trying to work with the existing ones.