Fallout 4
0 of 0

File information

Last updated

Original upload

Created by

Paucey

Uploaded by

Paucey

Virus scan

Safe to use

About this mod

Adjustable chance that Human NPCs will have Synth Components on their corpse. In effect, NPCs have a chance of being Gen 3 synths (either infiltrators or escaped).

Permissions and credits
 More Synths 

I thought there'd be more escaped Gen-3 Synths / Synth Infiltrators running around the Commonwealth. So where are they? Well, this mod adds a 1% (default) chance that when a human NPC is killed there will be a Synth Component on their corpse. Simple and immersive.

★ Features ★

The Mod's default settings give a 1% chance that non-unique Human NPCs will have a Synth Component on them when they die.
Settings can by adjusted by the Mod Configuration Menu or through an optional Holotape (downloaded separately).

Adjustable settings include:

- Option to turn the functionality of the Mod's scripts on or off
- Option to limit the effect to only non-unique Human NPCs or to affect all Human NPCs
- Ability to change the effect chance on a scale from 0.1% (1 in 1,000 NPCs) to 100% (everyone is a Synth <:O)


★ Installing ★

Note
: It's good practice to create a clean, backed-up save before installing any Mods or Mod Updates - especially ones that use scripts. While this Mod's premise is simple and straightforward it may still cause unforeseen results during play.

- How to Install Automatically -


1) Download / install "More Synths (Race Modifier)" with the NMM direct link found above.

2) (Optional Settings Holotape) Download / install "More Synths Settings Holotape" with the Mod Manager Download link found in the Optional section of the Files tab above.


- How to Install Manually -


1) Download and open "MoreSynthsRaceModifier.rar"

2) Extract all files/folders to your "Fallout 4\Data\" folder.

3) Add "MoreSynthsRaceModifier.esl" to your mod load order.

4) (Optional Settings Holotape) Download and open "MoreSynthsSettingsHolotape.rar" found in the Optional section of the Files tab above. Extract all files/folders to your "Fallout 4\Data\" folder. Add "MoreSynthsSettingsHolotape.esl" to your mod load order.

 Known Issues & Compatibility ★

For your safety ensure that you create a clean backed-up save before installing any Mod or any Mod Updates.

The Mod's script relies on the "Synth Component" item so any changes to that item/form will be reflected with this mod. The Mod modifies (adds an Ability) to the vanilla "Human Race" Form, so there are potential conflicts with mods which also affect the Human Race Form.

If you're unsure if this Mod is conflicting with another Mod, try changing the Chance setting to "100" in the MCM menu (or "Always" with the Settings Holotape) and kill a generic NPC (Raider, Gunner, etc.). If their body doesn't have a Synth Component on it, then it's likely there's a conflict with another mod.

If this mod conflicts with any other mod you are using, please let me know and I will whip-up a patch for you!

Patches are currently available for:

The PimpCrew's Pip-Boy 2000 v0.3

★ How it Works ★

Adds 5 Forms: 3 Global Variables, a Magic Effect, and a Spell. Modifies a single vanilla Form (the "Human Race" form) by attaching the aforementioned Spell which runs a short script attached to its Magic Effect. The script runs first when a Human NPC is spawned to declare variables, and again when the NPC dies. A randomizer determines if a synth component will appear on their corpse. After the NPC has died the Magic Effect dispels from the NPC, clearing it of all used variables and scripts.

The optional Holotape ESL adds 4 additional Forms: the Holotape object, the Terminal file for the Holotape menus, the Recipe to craft the Holotape at a Chemistry station, and a Quest that adds the Holotape to the Player's inventory. With both the main file and the Holotape installed the Mod adds a total of 9 Forms.

I've included the full text of the main script in the spoiler below for anyone interested.

Spoiler:  
Show
Scriptname Paucey_SC3 extends ActiveMagicEffect
;Tooltip helper for the Creation Kit
{If to add a Synth Component when NPC dies}

;Declare a property to hold the Synth Component item
MiscObject property synthDeathItem Auto
;Tooltip helper for the Creation Kit
{What will potentially appear on the NPC when they die}
;Declare a property for the Chance Global Variable
GlobalVariable Property gv_Chance Auto
;Tooltip helper for the Creation Kit
{Variable that holds the chance out of 100 that an NPC will be a Synth (default 1)}
;Declare a property for the CanUnique Global Variable
GlobalVariable Property gv_CanUnique Auto
;Tooltip helper for the Creation Kit
{Variable that holds whether Unique NPCs can be Synths (default 0)}
;Declare a property for the ModToggle Global Variable
GlobalVariable Property gv_ModToggle Auto
;Tooltip helper for the Creation Kit
{Variable that holds whether the Mod's scripts run or not (default 1)}

;Declare local variable to hold the NPC information
actor poorDeadFella
;Declare local variable to hold the Chance Global Variable
float chance
;Declare local variable to hold the CanUnique Global Variable
int canUnique
;Declare local variable for the Maximum Number for the randomizaer
float maxNumber
;Declare local variable to hold the ModToggle Global Variable
int modToggle
;Declare local variable for the randomizer
int random

;A function for cleaning-up the local variables once they're no longer needed
function CleanUp()
chance = 0
canUnique = 0
maxNumber = 0
modToggle = 0
random = 0
poorDeadFella = None
endFunction

;A function to generate the Synth Component so that the main Event functions are easier to read
function AddSynthComp()
;Place the Synth Component on the corpse of the NPC
poorDeadFella.AddItem(synthDeathItem, 1, true)
endFunction

;A function to retrieve the Global Variable properties
function GetModSettings()
;Check if the properties contain anything before trying to retrieve them
if gv_ModToggle && gv_Chance && gv_CanUnique
;Assigns the ModToggle Global Variable to the ModToggle local variable
modToggle = gv_ModToggle.GetValue() as Int
;Assigns the Chance Global Variable to the Chance local variable
chance = gv_Chance.GetValue()
;Assigns the CanUnique Global Variable to the CanUnique local variable
canUnique = gv_CanUnique.GetValue() as Int
;Determines the maximum number that will be given to the randomizer based on the Chance variable
maxNumber = (100/Chance)
endif
endFunction

;An event that triggers when the Magic Effect activates - used to capture the NPC's value
Event OnEffectStart(Actor akTarget, Actor akCaster)
;Checks if the Actor contains information before assigning the poorDeadFella variable
if akTarget
;Assigns the NPC's information to the PoorDeadFella variable to be used upon their death
poorDeadFella = akTarget
else
;Runs the clean-up function
Cleanup()
endif
endEvent

;An event that triggers when the NPC dies
Event OnDying(Actor akKiller)
;Retrieves the current settings of the mod
GetModSettings()
;Checks if the NPC is still, in fact, in the game and that the modToggle boolean is enabled
if poorDeadFella && modToggle
;A random number between 1 and the MaxNumber value, stored as an integer
random = Utility.RandomInt(1, maxNumber as Int)
;If the random number generated matches 1, and Unique NPCs can be synths
if random == 1 && canUnique
;Adds the Synth Component to the NPC's corpse
AddSynthComp()
;Runs the clean-up function
Cleanup()
;If the random number generated matches 1, and the NPC wasn't Unique
elseif random == 1 && !(poorDeadFella.GetActorBase().IsUnique())
;Adds the Synth Component to the NPC's corpse
AddSynthComp()
;Runs the clean-up function
Cleanup()
endif
;Runs the clean-up function
Cleanup()
endif
;Runs the clean-up function
CleanUp()
endEvent

And, to those interested, the Script that adds the Holotape to the Player's inventory:

Spoiler:  
Show
Scriptname Paucey_SC4 extends ReferenceAlias

;Property that holds the PipBoy item
Armor property PipBoy auto
;Property that holds the Holotape item
Holotape property SettingsHolotape auto
;Property that holds the player reference
Actor PlayerREF

;Event that runs on initialization. Adds a Holotape to the Player's inventory if they have a Pipboy - for example, if one were to install the Holotape mod and load a saved game where they already have a Pipboy.
Event OnInit()
;Gets the player reference once (so that the function doesn't have to be called over and over again)
PlayerREF = GetActorReference()
;The Event that triggers when a menu opens (found at the end of the script) requires a registration declaration. It's included here as this is the OnInit() and is guaranteed to run.
RegisterForMenuOpenCloseEvent("PipboyMenu")
;If the Player has a PipBoy
if PlayerREF.GetItemCount(PipBoy)
;Add a copy of the Holotape to the player's inventory
PlayerREF.AddItem(SettingsHolotape, abSilent=False)
;Clears the PlayerRef variable
PlayerREF = None
;Ends the Quest and prevents the script from running in the future
GetOwningQuest().Stop()
endIf
endEvent

;Event that runs when the player moves to a new Location - this is here for the rare instance of a player starting a new game and not going through the Vault 111 sequence of acquiring a Pipboy. This Event assumes someone starts the game, gets a Pipboy some other way, and then moves to a new location.
Event OnLocationChange(Location akOldLoc, Location akNewLoc)
;If the Player has a PipBoy
if PlayerREF.GetItemCount(PipBoy)
;Adds a copy of the Holotape to the player's inventory
PlayerREF.AddItem(SettingsHolotape, abSilent=False)
;Clears the PlayerRef variable
PlayerREF = None
;Ends the Quest and prevents the script from running in the future
GetOwningQuest().Stop()
endIf
endEvent

;Event that triggers when the Player accesses the PipBoy menu. This event adds a copy of the Holotape when the player receives their Pipboy for the first time during the Vault 111 sequence. Or, if the OnInit and OnLocationChange don't meet the criteria for adding a Holotape (for whatever reason), this will add a Holotape to the player's inventory when they open their PipBoy.
Event OnMenuOpenCloseEvent(string asMenuName, bool abOpening)
;If the menu was the PipBoy Menu and the menu was Opening
if (asMenuName == "PipboyMenu") && (abOpening)
;Adds a copy of the Holotape to the Player's inventory - but does so silently so as to not interrupt the Tutorial messages played when the Pipboy is used for the first time

PlayerREF.AddItem(SettingsHolotape, abSilent=True)
;Clears the PlayerRef variable
PlayerREF = None
;Ends the Quest and prevents the script from running in the future

GetOwningQuest().Stop()
endif
endEvent

★ Future Plans 

- Possible variants (including Unique NPCs, and different probabilities of the component appearing)
- Option to assign "Synth status" on NPC spawning rather than their death
- A variant which divides selected NPCs into "Infiltrators" or "Escaped", with the Infiltrators aiding you in battle if you are allied to the Institute.
- Add a holotape to allow non-MCM users to adjust mod options
- Optimize / clean-up script
- Rework process to inject script rather than modifying the vanilla Human Race Form
- Further clean-up / optimize script

★ Change Log 

(Settings Holotape) v1.2 - Rewrote the script that initially adds the Holotape to the Player's inventory. Changed the Menu description to show "20" as the default chance (though 100 is still the default chance in the actual Mod - I'm planning on changing the default chance to 20 for the Mod in the near future). Added a menu option in the Holotape menu that allows you to remove all copies of the Holotape from your inventory.

v2.23 - Just some minor script optimization.

Spoiler:  
Show
(Settings Holotape) v1.1b - Some minor aesthetic changes to the Holotape menu.

(Settings Holotape) v1.1a - Added an option to the holotape for 1 in 20 Human NPCs to be Synths.

v2.22 - Optimized script to remove redundant "If" statements. Created a function to retrieve the Global Variables and relocated the calling of them to the "OnDying" event so that changes to the Mod configuration will take effect on NPCs that have already spawned in-game.

(Settings Holotape) v1.1 - Added a silent quest that inserts the Holotape into the Player's inventory if/once they have a Pipboy equipped (the effect only happens once). Fixed cosmetic issues with the Holotape's menus and they now indicate which options are defaults.

(Settings Holotape) v1.0 - Added optional Settings Holotape to allow non-MCM users to adjust mod settings in-game.

v2.21 - Refined script to validate properties before attempting to assign values to them. Also added a clean-up function to the script which nullifies the local variables once the script has finished with them. Adjusted the slider for the Synth chance to increase by 0.1 steps instead of 0.01, with a new minimum value of 0.1 (1 in 1000 NPCs).

v2.20 - Extended possible range of Synth Component chance to 0.01% - 100%, or 1 in 10,000 to 1 in 1. Fixed issue that had prevented MCM settings from persisting on save load.

v2.11 - Modified script to prevent variables from being assigned or processed to/on non-existent NPCs.

v2.1 - Added support for MCM (Mod Configuration Menu) allowing users to adjust the probability of Synth Components appearing and whether Unique NPCs are affected. Changed name of ESL file to MoreSynthsRaceModifier instead of the previous MoreSynthRaceModifier.

v2.0 - Changed mod to affect the "Human Race" via script rather than changing Leveled Item lists.

v1.0 - Added "SynthDeathItem" to "LLD_Raider" and "LLD_BoSSoldier".