File information

Last updated

Original upload

Created by

PJM

Uploaded by

PJMail

Virus scan

Safe to use

About this mod

My scripts to find Precombine/Previs (Flickering/Occlusion) errors in your game (or individual Mods), and optionally generate a patch Mod to fix those problems. Can also create Lighting/weather etc Load Order patches. Includes tools to help you visualize what a mod effects, and the overlap with other mod's previs changes.

Requirements
Permissions and credits
Changelogs
This is a set of tools for people with experience Creating Patch Mods (using FO4Edit and CreationKit to resolve Mod conflicts in their Game) and want to fix flickering/occlusion conflicts as well, and/or merge Lighting/Weather (etc) changes without breaking Previs (see article). You can also use these scripts to add Previsbines to an existing Mod (see article).

READ everything on the Stickied Posts (and the Articles), before continuing otherwise you will have problems!

New users SHOULD download/extract the full archive PJMScripts (Main files), and then replace the following updated scripts (in Update Files):

Latest versions of xEdit Scripts:
[Jan 2025] Updated V2.2 Batch_FO4MergePreVisandCleanRefr.pas (Minor error reporting update)
[Jan 2025] Updated V4.6o
FO4Check_Previsbines.pas (Minor Bug fixes)
[Dec 2024] Updated V1.1 FO4MergePrevisPatchIntoMaster.pas (Used for merging Previsbine patch back into original Mod. See Article)
[Dec 2024] Updated V1.7b FO4FindNewPCStatics.pas (Better nif error handling - forgot to upload this version back in july...)
[Dec 2024] Updated V1.5
Batch_FO4MergeCombinedObjectsandCheck.pas (Blank XCRI on override mitigation - improved implementation)
[Dec 2024] Updated V2.7 FO4CheckPrevisbineAssets.pas (Minor bug Fixes, better reporting)
[Jul 2024] Updated V1.2 FO4CleanPrevisPatchMasters.pas (Various bug fixes)

Latest Batch Script:
[Dec 2024] Updated V2.3 GeneratePrevisbines.bat (Better error checking. Uses xEdit64/FO4Edit64 in current directory if found, script version check)

Pre-release updates (for testing):
[Jan 2025] Update V4.7 FO4Check_Previsbines.pas (Updated GUI, Seed overwrite check)

This mod consists of FO4Edit script (FO4Check_Previsbines) to analyze your mods (and also generate a 'seed' mod to fix those errors), a CMD script (GeneratePrevisibines.bat) to automate the generation of Precombine/Previs (Previsbine) files from that 'seed' Mod, and a number of other useful scripts I have written to create patch mods and visualize Previsbine conflicts. Full usage details in the attached guide.

FO4Check_Previsbines.pas (V4.6) has "Task Based" menu and also works with FO4Edit64.exe

The FO4Check_Previsbines script can be used on its own to find all Previsbine issues introduced by Mod conflicts - without having to go in the game and look for 'visual issues' - and  builds a 'seed' patch to resolve those issues.

Additionally these scripts can be used to create Previsbines for new Worldspace/Interiors in any mod, create a PRP patch for a mod that did
not support PRP,  add Previsbines to a mod that does not have them (i.e.
to increase FPS for mods that add lots of 'new' content), etc. Full
instructions in the Guide.

It can also be used to create a patch to add missing regions (eg from 'region names on saves') as well as Locations, EditorIDs, Weather and Lighting effects (eg from ELFX), and MHDT info deleted/overwritten by other mods (or PRP). Full details in this new  Guide.

The GeneratePrevisibines.bat CMD script is used for fully automatic generation of Previsbines (for a mod) without manual intervention.
Together they are used in a 2 step process to generate Previsbines (Precombines and Previs) for all your needs.

Example1: To find all the Cells in your game that will have visual issues (flickering):-

Open FO4Edit, click OK to "Module Selection", right click on any mod and select "Run Script" and choose FO4Check_previsbines, then (optionally) in the Display options area  select "Display Errors Only" then "OK" and let it run (May take hours!). EVERY ERROR message is a Broken Cell in your game...

Example2: Create a patch to fix missing Region-names, Lighting (ELFX), Fog, music etc changes removed by PRP:-
Open FO4Edit, click OK to "Module Selection", right click on any mod and select "Run Script" and choose FO4Check_previsbines, then select "Create patch to only fix wrong regions/MHDT/..", change the "Patch name" to something like "Final_Cell_Patch.esp" then "OK" and let it run. Install the resulting "Final_Cell_Patch.esp" at the bottom of your load order (after any Previs patches). See Article for more details.

Example3: Fix all flickering, conflicting Lighting changes, PRP compatibility, etc for your full Load order:-
Open FO4Edit, click OK to "Module Selection", right click on any mod and select "Run Script" and choose FO4Check_previsbines, then select "Create Seed patch to fix all problems" then "OK" and let it run (A LONG TIME!). Examine the log in xEdit and review/resolve any "Issues" highlighted. Rerun if required.
Once you have created an xPrevisPatch.esp you can use The 
GeneratePrevisibines.bat CMD script to build the actual Previs Fix patch. Read the FAQ Post for full details.

Example4: Create new Previsbines for a mod that doesn't have them (to improve its performance):-
Open FO4Edit, on "Module Selection" screen right click and choose "select none", now click (to tick) ONLY the Mod(s) you want in your new previsbines for (i.e. if this is a PRP patch then make sure PRP.esp is also ticked), Click OK to start xEdit. Now Ctrl-Click to highlight all your mods (i.e. NOT PRP, Base game, etc)  then right click and select "Run Script" and choose FO4Check_previsbines, then select "Create patch to Rebuild ALL Previs... ", [optionally select "Process all user plugins"] then "OK" and let it run (time depends on size of mod). Examine the log in xEdit and review/resolve any "Issues" highlighted. Rerun if required.
Once you have created an xPrevisPatch.esp you can use The 
GeneratePrevisibines.bat CMD script to build the actual Previs patch. Read the FAQ post for full details.

More information on Previsbines is available in my Previsbines Deep Dive article, as well as the xEdit Discord topic "PreCombines and Previs"
 (and if you have a spare couple of days - this Nexusmods forum).

Notes:
  • These scripts are for use with FO4Edit, CreationKit, and CKFixes - so are intended for people with a reasonable amount of experience using these tools, and have the computing resources to generate Previsbines (which can require A LOT of memory and time).
  • If you use someone else's guide to building Previsbines then you are on your own (My scripts are more recent, and don't require any extra steps).
  • You can modify the resulting 'seed' (my script generates) for your own purposes, and you can also use any another author's command script to build previsbines from it (such as the powershell version by Feedanoob). Ymmv.

To use these scripts you must first put the files from this mod in the correct directories:
Spoiler:  
Show
  • Manually download this archive (DO NOT use a Mod manager).
  • Extract it into your directory containing FO4Edit.exe (so all the scripts go into the "Edit Scripts" subdirectory).
  • (Optionally) move the "bat" and "txt" files to somewhere else. These are help files, and the Previsbine generation CMD script.
  • I would recommend creating a shortcut to the "GeneratePrevisibines.bat" CMD script to make it easier to use.
  • If you use MO2 then you must register this command script as an external program otherwise it will not see your mods.
  • If using the steam version of CK you must register the steamID as well, especially for Generateprevisbines.bat.
  • (Optionally) you can also create a shortcut to FO4Edit.exe, with the parameter "-Script:FO4Check_Previsbines.pas", which will invoke the Previsbine Checker script to run against all the mods you selected in the FO4Edit selection window (batch mode).
These scripts MUST be able to see your plugins in the Data directory, so if you use MO2 they must be run from within MO2.

You also require:
  • FO4Edit.exe (or FO4Edit64.exe) V4.1.5 or later.
  • FO4 CreationKit. If using the Steam version read the stickied post for extra steps.
  • CKPE ( Creation Kit Platform Extended) verson appropraite for your CK version.
  • Add lines bBSPointerHandleExtremly=true and sOutputFile=CK.log to CreationKitPlatformExtended.ini.
  • If you have more than 5 cores/threads then try setting iMaxUmbraBakeThreads=n (n=#cores-1) in CreationKit.ini under [General].

Only supported CK/CKPE version combinations are:
  • FO4 OG, CK OG  (Bethnet V1.10.162) and CK Fixes V2.0.1 (2.0 + 2.0.1 hotfix)
  • FO4 OG, CK OG (Steam V1.10.162) and CKPE V0.2 build 941 (requires bOwnArchiveLoader=false set in CreationKitPlatformExtended.ini)
  • FO4 OG + NG archives + Bass, CK OG (Steam V1.10.162) and CKPE V0.3 build 241 or later (ie. you downgraded FO4 and CK NG)
  • FO4 NG, CK NG (Steam V1.10.982.3) and CKPE V0.4 build 625 (or later)
Update: Old CKPE versions no longer available. If you use CK V1.10.162 (OG), CKPE V0.4 b968, and still have Previs issues then try Github CKPE V0.3
Note:
If you are running Downgraded CK with NG archives you can use CK Next Gen (V1.10.982.3) and latest CKPE but must also use the latest steam_api64.dll (note then the game then WILL NOT work unless you swap back to the older Steam dll).

There are a number of authors with guides on installing FO4Edit and the Creation Kit if you have problems.
Also help is available on the xEdit discord I mentioned above, as well as the Collective Modding Discord.

Brief List of primary scripts included in download:
Spoiler:  
Show

- GeneratePrevisibines.bat:  CMD script to use FO4Edit and CreationKit to generate Previsbines (can be placed anywhere on your system).
- FO4Check_PreVisbines.pas: Main script to find previsbine conflicts and optionally build a seed mod that can be used to build previsbines.
- FO4FindNewPCStatics.pas: Locates STATic references in a CELL(s) that may cause the CK to crash, and optionally allows you to exclude them.
- FO4CleanPrevisPatchMasters.pas: Smart "cleanmasters" script designed for Previsbine patch mods (ONLY!).
- FO4MergePrevisPatchIntoMaster.pas: Smart Merge of Previsbine Patch back into Original Master Mod.
- (Batch_)FO4MergeCombinedObjectsAndCheck.pas: Improved version of the original MergeCombinedObjects script (Batch_ * is cmd line version)
- (Batch_)FO4MergePreVisandCleanRefr.pas: Improved version of the original MergePreVis script (Batch_* version is commandline version)
- FO4CheckPrevisbineAssets.pas: Validate a Previsbine mod's Archive to make sure it contains all the expected Previsbine files.
- Worldspace browser with PrevisCheck.pas: Modified version of the Default script with options to visually display a Mod's Previsbines impact.
- Merge overrides into master with VCI1.pas, Copy_version_control_info_from_another_plugin_Redux.pas: Enhanced versions of default scripts.
- FO4SetTimeStampToToday.pas, FO4SetTimeStampToTodayIfNone.pas,FO4SetRefrTimestampToParentIfNone.pas: VCI1 manipulation scripts.
- FO4CheckRVIS.pas, FO4AddFixRVIS.pas,FO4SetRVISifMissing.pas: Scripts to Validate/Add/Fix RVIS on Exteriors Cells.
- FO4CopyMHDTtoWinningOverride.pas, FO4CreateMHDTPatchFromOverride.pas: Scripts to Extract/Merge MHDT Information between Plugins.
- count_loaded_refs_in_load_order_CK.pas: Script to Count the Total References in loaded Plugins. The CK (without CK Fixes) fails if above 2097152
Other files/scripts found in this mod are used internally by the GeneratePrevisibines.bat Script.


FO4FindNewPCStatics.pas (V1.7)  FO4Edit script to locate/exclude problem Precombineable Meshes that may/do crash the CK:
Can be run against multiple mods (only updates last in LO). Note that FO4CheckPrevisbines should automatically exclude these anyway.

Above shows it run on my DCE PRP seed, and the meshes it found that crashes Precombine building in the CK.
Use "Exclude Bad?" to exclude them so they don't crash the CK. If you still get crashes run it again  against the Cell that crashed, and exclude all.

AutoCellDisplay (Optional download) - shows you the cell boundaries:
When wearing the craftable Display Cells Ring you can see the Cell borders in game, and their Cell details (to easier find it in FO4Edit).

Blue walls are Cell borders, Purple walls are Cluster Borders. Crouch (sneak) to display your current location.

The enhanced "Worldspace browser with PrevisCheck.pas" FO4Edit script has extra options to allow you to visually see precombines:
The extent a mod effects the cells (and thus previsbines) in your game can be clearly seen. More than one mod can be displayed also.

The above image show 2 mods and you can see their overlap (conflict) area where you will probably have visual issues.
Right-click on any cell to get it's details. You can overlay as many mods as you want, but use the "Select colour" option to change it each time. It helps...
Dotted Cell outline - Cell override found in Mod.
Solid Cell outline - Cell override also includes new/updated precombineable References.
Dotted slant - Cell has new Previs supplied by Mod.
Solid slant - Cell has new Precombines supplied by Mod.