GetShouldAttack

Syntax:

GetShouldAttack TargetActor 

Example:

EvilBanditBoss.GetShouldAttack player 

Return value indicates the desire of the calling actor to attack the TargetActor. If the return value is greater than 0, the actor will attack the target under normal circumstances (i.e. the actor is aggressive, can detect the target, is not restrained or unconscious, etc.).

NotesEdit

  • This function takes several factors into consideration, so the value returned does not always reflect the calling actor's hostility toward the target. For instance, the return value decreases as the distance between the two actors increases, and is zero if the actors are in different cells.
  • A more reliable way to determine if one actor is hostile toward another:
if ( callingActor.getAV aggression > 5 )
  if ( callingActor.getDisposition target < callingActor.getAV aggression )
    ; actor is hostile toward target
  endif
endif