Fallout 4-76 protect NPC actors from removal

Article:  Fallout 4-76 protect NPC actors from removal Mod Name: Fallout 4-76 Open World Mod File: SKK476OpenWorld.ESP Source: https://skkmods-www01.azurewebsites.net/mod/fallout-476-open-world/ Platform: Fallout 4 (PC, XBOX) Author: skk.50@outlook.com Date:      June 2018 Version: 008 onwards
[post-views]

This solution looks for actors with keywords ActorTypeNPC (Race: SynthGen2, Human, Ghoul, Child, Valentine) or ActorTypeSynth (Race: SynthGen1, SynthGen2, Valentine) to remove. If you are surprised by an actor being removed, it has one of those keywords.


4-76 NPC protection mods

If you are a mod user wanting to make some human based NPCs persistent in the Fallout 4-76 world, to avoid them being automatically disabled (and replaced) there are mods to protect existing actors BEFORE the 476 conversion is run:

(1) SKK Combat Settlers protects existing settlers from removal.

(2) SKK Unlock all companions enables and protects any/all base game companion(s).


PC Console

For any UNIQUE actor you know the 8 digit reference id (look ’em up in the Fallout wiki), use the PC Console to apply a keyword on them BEFORE the 476 conversion is run:

(1) Open the PC console.

(2)  Type or paste CTRL+V  [ 8DigitReferenceID.AddKeyword SKK_476NoDisable ]

For any other actor you can find on screen, use the PC Console to apply a keyword on them:

(1) Open the PC console.

(2) Click on the actor to protect so the 8 digit reference id is showing in the middle of the screen.

(3) Type or paste CTRL+V [ addkeyword skk_476nodisable ]


Quick and dirty script (a lookup per spawn)

If you are a mod author wanting to make your human based actor NPCs persistent in the Fallout 4-76 world, to avoid them being automatically disabled (and replaced) apply a keyword that can be acquired dependency free;

If (Game.IsPluginInstalled("SKK476OpenWorld.esp") == TRUE)
ThisNPC.AddKeyword(Game.GetFormFromFile(0x00019bcb, "SKK476OpenWorld.esp") as Keyword)
EndIf

Long and elegant script (one lookup per game load)

ObjectReference Property pPlayerREF Auto Const Mandatory
Keyword rSKK_476NoDisable

Event OnInit()
   Self.RegisterForRemoteEvent((pPlayerREF as Actor), "OnPlayerLoadGame")
   GetRemoteForms() ;If the DLC or mod is active now
EndEvent

Event Actor.OnPlayerLoadGame(Actor akSender)
   GetRemoteForms() ;If the DLC or mod is added or removed between saves
EndEvent

Function GetRemoteForms()
   rSKK_476NoDisable = None
   If Game.IsPluginInstalled("SKK476OpenWorld.esp") == TRUE
      rSKK_476NoDisable = Game.GetFormFromFile(0x00019bcb, "SKK476OpenWorld.esp") as Keyword
   EndIf
EndFunction

;In your NPC management code add something like this:

If (rSKK_476NoDisable != None)
   ThisNPC.AddKeyword(rSKK_476NoDisable)
EndIf