File information

Last updated

Original upload

Created by

Lee3310

Uploaded by

lee3310

Virus scan

Safe to use

Tags for this mod

About this mod

F4SE plugin that extends the use of headparts to all NPCs and not just the player character.

Requirements
Permissions and credits
Changelogs
About this mod:
After making SFT, i was quickly disenchanted when i realized that headparts are only meant to be used on the player. I say this because of two major limitations when it comes to NPCs:
  • If an NPC is using facegen data (which is the case for all vanilla NPCs) headparts won't even show up on its face.
  • Even if you manage to add headparts to an unique NPC, they will be discarded as soon as you exit the game. Bethesda didn't make headparts persistent for anyone except the player character. 

This plugin will address both those limitations and more:

Facegen:
When you add a headpart to an NPC, the mod will temporarily force the game to generate its face on the fly. When the last headpart is removed, the NPC will resume using facegen data if present. Compatible with X-Cell.

Save/Load:
When you save your game, this mod will take care of saving all the headparts applied to NPCs in script and load them back when you load the save again. Thus, making headparts persistent for NPCs just like the player. Data are saved in the F4SE co-save file.  

Experimental:
This mod also let you add unique headparts to generic NPCs that use templates like settlers, raiders, scavengers... This is by far the hardest part to make since the game was not designed to add unique stuff to literally clones (see image below). The way it does this, is by leveraging the time between adding a headpart and rendering the actor face.
I didn't test this feature extensively, (mostly edge cases) so there might be some scenarios where it can malfunction. Report if any.




This plugin was meant to complement SFT at first, but since any mod that adds headparts in script can benefit from it, i decided to upload it separately.

Important Note:
I recently discovered a bug related to vanilla NPCs located in fallout4.esm (DLCs too most likely). When you temporary disable facegen in script for a given NPC (see facegen section above), the game will generate a new face that doesn't look like the original. Even with mismatched skin color for some NPCs. This only concerns vanilla NPCs that aren't edited by any other mod (see picture below).



Simply editing the NPC in a dummy plugin (without changing anything) will fix the problem, and that's what i did. I included an optional .esp (light plugin) that contains all vanilla face template NPCs. Install it and put it at the beginning of your load order. Just above or under Unofficial Fallout 4 Patch - UFO4P (NPCs edited by UFO4P are not included). Let everything else load after it. And if you are using X-Cell, don't forget to generate new facegen Data for it (select all NPCs in Ck then ctrl+F4).
This is a workaround, you may not need it if you are already using NPC replacer mods. I will remove it if perchik71, me or someone else, find the source of the problem in the game code and patches it. 

Good news: perchik71 did it and fixed the bug in x-cell thanks to new information provided by VessperiaS.  


You can ask him for technical details but from what i understand, the game doesn't fill the tints array for vanilla NPCs located in Fallout4.esm, and solely rely on facegen data for them. Don't forget the to enable the patch in x-cell.toml.
The optional facegenFix.esp is not needed anymore if you have x-cell.


Source:
Will be available asap.

Credits:
ianpatt and F4SE team, none of this would have been possible without F4SE.
Fudgyduff, commonlib pioneer and all the modders who contributed to it by sharing their work (alandtseshad0wshayd3Qudix,...)
Snapdragon2, I simply couldn't have done it without his help. He showed me the ropes and answered all my questions.
perchik71, for making X-Cell and confirming the facegen bug. Also his input on making this mod compatible with X-Cell.
spicydoritos
, Pretty much my only tester for more than a month now, and the one behind the idea of adding support for generic NPCs
Qudix for commonlibf4-ng-template