Jump to content

Hostility check


enroger

Recommended Posts

Hi guys, a script I'm working on needs to determine the hostility of any actor (NPC/creature) towards the player. I've read the getshouldattack isn't very accurate as if the actors are in different cell then it would return zero. Also I've tried the recommended code there

 

if ( callingActor.getAV aggression > 5 )

if ( callingActor.getDisposition target < callingActor.getAV aggression )

; actor is hostile toward target

endif

endif

 

it also didn't work because I think in FO3 max aggression is 3. But I don't know what disposition does, at what value would it cause a creature/NPC to attack the player on sight?

Link to comment
Share on other sites

I haven't seen disposition used much. On the Overseer during 'Escape' is all I can think of.

This is what I use to detect enemies in general:

 

 

short iRelation
short iIsEnemy

set iRelation to ActorRef.GetFactionRelation Player
if ((iRelation <= 1); Neutral or enemy
    if (iRelation == 0)  ;Neutral
         if (ActorRef.GetAv Aggression > 1) ;Attacks neutrals on sight
              set iIsEnemy to 1
         endif
    elseif (iRelation == 1) ;Enemy
         set iIsEnemy to 1
    endif
else
    set iIsEnemy to 0
endif

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...