Jump to content

Companion & NPC Hostility


Recommended Posts

Trying to make companion hostile to an NPC for random acts of autonomous violence and the results are ... unpredictable.

 

CompanionHostileToNPC faction which is hostile to NPCHostileToCompanion faction

NPCHostileToCompanion faction which is hostile to CompanionHostileToNPC faction

 

NPC.RemoveFromAllFactions()

NPC.AddToFaction(NPCHostileToCompanion)

Companion.AddToFaction(CompanionHostileToNPC)

 

Run a lookup against all 700 base game factions and the only faction NPC is a member of is NPCHostileToCompanion.

 

Logic would suggest NPC.IsHostileToActor(Companion) is true, but it actually returns false. There are no more factions to remove ...

 

Force NPC.StartCombat(Companion) and they turn hostile, but if they break line of sight and disengage (edit: or companion goes into bleedout) they stop combat and IsHostileToActor turns false again.

 

WTF ?

Edited by SKK50
Link to comment
Share on other sites

Hmm....honestly I am just throwing this out there, but are the aggression/etc. settings for the companion and hostile NPC such that they won't give up combat easily? I'm not really sure what else might cause this unfortunately. =(

Link to comment
Share on other sites

AI aggression is set to (1) Aggressive, engage hostiles.

 

If I add the NPC to PlayerHostileFaction then things work as expected and IsHostileToActor returns true. Its as if a companion is not allowed to be unilaterally hostile without the player regardless of factions. Issue is that the NPC then instantly attacks the player which is exactly not the UX I want. Autonomous companion <> NPC spectator aggro is the thing.

 

Workaround is to have a timer that forces StartCombat() whenever IsInCombat() is false until OnDeath, but that's like the opposite of elegant AI management.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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