Jump to content

Random NPC actor hostility


SKKmods

Recommended Posts

I am doing unusual acts to WorkshopNPC actors, setting them to Essential + Bleedout so they take damage and need to use Stimpaks for recovery.

 

On some random occasions when they recover by switching them SetNoBleedOutRecovery(False) wait 15 seconds to recover then back to SetNoBleedOutRecovery(True), they turn hostile to the player and start combat.

 

(ThisActor.IsHostileToActor(pPlayerREF as Actor)) returns TRUE

 

But iterating through all 698 available factions the settler could be a member of, not one of the factions is hostile to the player.

 

If not a faction, what could be causing the hostility that I can disable or switch back to chummy ?

 

EDIT its not a holdover from a friendly fire tap as IgnoreFriendlyHits(True)

Edited by SKK50
Link to comment
Share on other sites

I had to deal with this same problem, forcing the actor to be an ally to the player and viceversa did the trick.

Game.GetPlayer().SetRelationshipRank(theActor, 3)
theActor.SetRelationshipRank(Game.GetPlayer(), 3)
I hope it helps.
Edit: You may need to run StopCombat() and StopCombatAlarm() before SetRelationshipRank to make it work properly.
Edited by DieFeM
Link to comment
Share on other sites

Appreciated, unfortunately they didn't work.

 

Reviewing my last "ooohh that's an excellent idea I'll just make a quick change and publish it" did find the idiot logic error causing random hostility.

 

Top Tip: if your going to self manage bleedout recovery, you have to wait for bleedout recovery to finish which is purely time based 15 to 20 seconds from SetNoBleedOutRecovery(False) and cant be measured using Health GetValue == GetBaseValue which is a leading indicator.

Link to comment
Share on other sites

Actually, in my mod, the reason that caused the actor to be hostile was not the same, it was happening after using SetScale on the actors, that for some reason made them hostile, I guess because they took damage somehow by changing the scale... I don't know why actually.

Btw, thanks for the tip.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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