Detecting Hostile Actors Reliably

Post » Tue May 17, 2011 4:02 pm

Hello everyone,

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 <_<
User avatar
Matt Gammond
 
Posts: 3410
Joined: Mon Jul 02, 2007 2:38 pm

Return to Fallout 3