I have a ref-walk script that cycles through every actor within a given distance from the player.
I am trying to detect which of them are hostile and have them flee base on certain conditions.
My problem is that
actor.GetFactionRelation Player
returns Neutral for Talon Mercs, Super Mutants and creatures, even though they are hostile.
For raiders it returns Enemy.
I am using FWE + MMM so maybe one of them is the culprit. Does anyone know of a reliable
way to get if an actor is hostile to the player?
I have tried
actor.GetCombatTarget Player
as well as
if actor.GetThreatRatio < playerThreat (or something like that)
but the first one just doesn't work as expected and the second one affects friendlies as well.
Any ideas???
Edit: Fixed.
if actor.GetCombatTarget == Player
works fine. It was not working for me due to bad syntax <_<