Jump to content

What is considered 'Friendly Fire'? How is the shooter considered a 'friend'?


PJMail

Recommended Posts

If an NPC (Victim) has 'ignore Friendly Fire' set () what does the 'shooting' actor have to have to be considered 'friendly' and thus ignored?

Is it just the shooter being part of a faction cosidered 'a friend' to the Victim (somehow)?

 

I am trying to work out why occasionally my Companions suddenly take a dislike to a mod-added 'follower' (that is helping them kill hostiles) and get into a firefight.

Sounds like friendly fire that is not considered friendly...

The follower is not a 'current companion' faction member, but just has the appropriate 'follow me' AI and is in the 'player faction' (so friendly to me).

 

Very hard to debug as there are no events etc I can add logging to see when they are 'un-friended' - or why...

 

Edit: And if it is just faction based, then does the victim's faction have to be a friend of the shooter's faction - or visa-versa - or both?

Edited by PJMail
Link to comment
Share on other sites

The CompanionCrimeFactionHostilityScript is triggered by attaching actors in the Companions' Crimefaction(s) - I have fallen foul of this myself (shooting a turret I built in a Settlement tends to cause all my robot companions to attack me, for instance). This is not the issue in this case.

 

My question about ignorefriendlyhits is how is a 'friendly hit' determined? I am assuming a companion got shot accidently by my follower, but doesn't consider it 'friendly fire' so starts treating the follower as an enemy.

I know the follower and companion are 'allies', and both are set to 'helps allies'.

I can 'accidently' shoot the companion without issue (and I am also only considered 'an ally') so there must be something else.

 

Edit: I should say "CompanionCrimeFactionHostilityScript" deals with who they are in combat with and their crime factions (I was thinking of the 'crime faction' field of Companions in the above statement - sorry).

Anyway - the script is concerned with what happens once the companions are in combat. I want to know what triggers the combat in the first place.

Edited by PJMail
Link to comment
Share on other sites

I have decided what I am seeing is totally inexplicable.

All factions involved are happy, the actors are still 'allies' (as well as their factions) - just "MyFollower.ishostiletoActor(Ada)" returns true suddenly.

The 2 actors are >3000 units apart and have no factions in common (apart from Player_faction). MyFollower is attacking Gunners, Ada is doing nothing but standing around with my other companions.

No other Companions are effected, only Ada, who does not even register that it is now an 'enemy' of Myfollower until it attacks.

 

These results are the same before and after "MyFollower.ishostiletoActor(Ada)" changes from false to true:

 

MyFollower.GetFactionReaction(Ada) (and Visa versa) returns 2 (Ally)

MyFollower.GetRelationshipRank(Ada) (and Visa versa) returns 0 (Acquaintance)

 

From my event logging during the 'change':

 

Event OnCombatStateChanged - Combat state=1 (Combat)
- Combat Targets: [Actor < (001D5854)>]
- Combat Targets: [Actor < (001D7898)>]
Event OnCombatStateChanged - Combat state=2 (Searching)
- Combat Targets: [Actor < (001D7898)>]
Event OnCombatStateChanged - Combat state=1 (Combat)
- Combat Targets: [Actor < (001D7898)>]
- Combat Targets: [Actor < (001D5854)>]
- Combat Targets: [companionactorscript < (0100FF12)>] <--- !!!
Event OnHit - Target [companionactorscript < (0100FF12)>] - Weapon [Weapon < (FE04F875)>] - Projectile [PROJECTILE < (00125C9D)>]

For now I just detect Myfollower targeting one of my companions via OnCombatStateChange and cancel it's combat status. Not ideal...

 

If anyone has a clue what is going on I would love to know...

 

I have decided it isn't a 'friendly fire' issue as it is always Ada - reguardless off it's location - but I would still like to know what is required to be 'friendly' in that context...

Edited by PJMail
Link to comment
Share on other sites

I can empathise as I had a similar issue with friendly actors going hostile to the player ~5% of the time after recovering from NoBleedoutRecovery. Took many many hours of logging to rule out common causes. Clearly another corner case in the game code like yours.

Link to comment
Share on other sites

Yeh, I happened apon your posts while searching for a cause to this - something about needing more time between enabling and disabling bleedout recovery?

Something inexplicable anyway.

 

The whole 'faction being hostile to you', even though you have done nothing/ are not an enemy faction is just annoyingly buggy.

Occasionally when I visit the Galleria all the robots there are hostile to my Vertibird (only). Othertimes not. No rhyme or reason..And it's only faction is "PlayerFaction"

Perhaps the same 'corner case' as Ada going hostile... But Codsworth & Curie don't...

 

Fun...

Edited by PJMail
Link to comment
Share on other sites

  • Recently Browsing   0 members

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