Skyrim Special Edition
0 of 0

File information

Last updated

Original upload

Created by

Blackread

Uploaded by

Blackread

Virus scan

Safe to use

About this mod

After using KoKauH97's excellent script to ESMify my quest mods, I was left with a problem: all the named NPCs set to spawn indoors won't spawn and start their schedules before I enter their cell (usually their home). This script aims to correct that, by setting persistent flag on all NPCs flagged as unique.

Requirements
Permissions and credits
Update 8.10.2022:

FelesNoctis & Co. have released a new script that improves upon this concept, flagging some references not processed by my script as persistent, and also using more intelligent filters to not flag unnecessary actors. It's still in beta, but looks very solid, give it a try if you're interested.

Why this mod is needed:

Skyrim SSE incorporates two types of reference handles: temporary and persistent. Temporary handles are loaded into memory, and thus become active, only when the player is at their grid, and unloaded when the player leaves their grid. Persistent handles are loaded in on start up and held in memory at all times.

However, this is true only for plugins flagged as masters. For all ESPs, both temporary and persistent handles are always held in memory. Skyrim SE has an inherent cap of 1048576 concurrent reference handles, hence the need to ESMify large plugins in very heavy load orders. You can read more in this reddit post.

KoKauH97 has made an excellent xEdit script to make the conversion very simple and efficient. You can find his script here. His script sets the ESM flag on the plugin, and flags any NPCs associated with a quest as Persistent. This is needed for the quests to work after the conversion.

With many mods however this process leaves majority of the NPCs still as temporary. This means that they will not spawn before you enter the cell they were set to spawn in. In the case of named NPCs that cell is often their home, and you will have to pick the lock and break in to get them to spawn and start their schedules. They might also despawn when you leave the town. This is especially apparent if you choose to ESMify city expansion mods.

The script I made aims to fix this by adding Persistent flag to all NPCs flagged as Unique. Naturally this will often target a few extras in addition to the named ones, but it's not a big deal. However, at least in the mods that I use, all named NPCs have been set as Unique, so they all will be flagged Persistent.

Installation:
Download, extract and copy the Set_unique_NPCs_persistent.pas file into the Edit Scripts folder in your xEdit/SSEEdit installation folder.

Usage:
Right-click the plugin you wish to run the script on and select Apply Script... from the dropdown menu. In the window that opens select Set_unique_NPCs_persistent from the dropdown menu labeled as Script, and press OK. Give the script a few seconds to run, and you're done!


NOTE: My script does NOT ESMify the plugin, you still need to run KoKauH97's script for that. The order in which you run the scripts does not matter.

UPDATE: Due to requests, I added an optional file that combines KoKauH97's script and this addon into a single script file that does both things in one go. If you use that one, you don't need my separate addon script or KoKauH97's script. Installation and usage the same way, the name of the script is ESMifyer_with_persistent_unique_NPCs.


If you find any bugs with the scripts, please let me know.