Fallout 4

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. Also tools to help you visualize what a mod effects, and the overlap with other mods 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.

[Apr 2024] Updated FO4Check_Previsbines.pas (Fixes to "Replace Existing" option, minor change to Tasks screen, less irrelivant warnings/errors)
[Apr 2024] Updated FO4FindNewPCStatics.pas (Feature: If you exclude everything in a cell, next run does a deeper scan)
[Mar 2024] Updated AutoCellDisplay (Fix: Display on crouch was not working)
[Feb 2024] Updated
Batch_FO4MergePreVisandCleanRefr.pas (Fix: Wasn't cleaning out all "PleaseRemove" REFRs)
[Jan 2024] Updated GeneratePrevisibines.bat (Feature: Support for new version of CK fixes - CKPE)
[Jan 2024] V4.0: Re-release of all scripts in single download (update of old V3.5 version + updates)

It 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 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.

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

The GeneratePrevisibines.bat CMD script can be used on it's own to fully automate generation of Previsbines 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 the Mod list, 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. 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 the Mod list, 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.

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.

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).

NOTE: 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).

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.
  • (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)
  • FO4 CreationKit (ver. 1.10.162.0). If using the Steam version read the stickied post for extra steps.
  • A Last Version of FO4 CK Fixes (2023 CKFixes V2.0.1)  OR
    Git Release 734 (or later) of  Creation Kit Platform Extended with bOwnArchiveLoader=false set in CreationKitPlatformExtended.ini
  • The fallout4_test.ini included in optional files (for CKfixes only), OR CreationKitPlatformExtended.ini (for CKPE) OR
  • In your fallout4_test.ini set BSHandleRefObjectPatch=true, PreVis_SkipDuplicatePatch=false and OutputFile=ck.log ( CKfixes V2.0.1)
    or in your CreationKitPlatformExtended.ini set bBSPointerHandleExtremly=true and sOutputFile=CK.log (CKPE V0.2)

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.

Things you must do to build a working Previsbine Patch for your game when using PRP:
Spoiler:  
Show

  • Follow the instructions for installing FO4Edit, CreationKit, CreationKit Fixes, and these scripts. Test that FO4dit and CK actually work.
  • If using Steam CK and/or MO2 then make sure FO4Edit and CK work under MO2 and can see all your mods when invoked.
  • Have NO loose precombine (data\meshes\Precombine) or Previs (Data\vis) files. Tricky under MO2 to see this, but my script will tell you anyway.
  • NEVER use a Patch for a different version of PRP. No patch is better than a patch for the wrong version.
  • NEVER place a mod containing Precombines after (lower than) PRP, unless is was built for your version of PRP.
  • Have ALL other mods placed before PRP (and it's patches). If a mod says it must be last, it still must go before PRP.
  • Try and find compatible PRP patches for ALL your mods that add/modify objects in the world. These go after PRP.
  • If you have a mod that enables scrapping everything in a settlement, but does not provide new, compatible Precombines, it may stop working.
    Some of them work by just disabling Precombines - the opposite of what you are trying to do here - so perhaps look for a better version...
  • Run the FO4Check_previsbines script in FO4Edit, selecting "Create Seed Patch to fix all reported issues", and note the last "Info" line.
    If the reports has a large number for "(yy for new Precomb)" - say above 50, you have not followed this guide or have many mods unsuitable for PRP.
  • Use my GeneratePrevisbines.cmd script (under MO2 if using that) to now build prevsibines (see below) for the seed patch file created previously.
  • If this completes successfuly then place the resulting patch AT THE END of your Load order and activate it in your Mod manager.
    If it fails (CK crashes) then one of your mods has unprecombineable objects (usually broken collision) so now your hard work begins!
    I provide some assistance on this in my Deep Dive article in the "Common CreationKit Failures" section.

Using the GeneratePrevisibines CMD script to build Precombines/Previs
Spoiler:  
Show
  • FIRST Read the 2 articles with this mod which explains the general concepts and "seed" building.
  • Create your 'seed' mod (what you want to generate Previsbines from) via my FO4Check_Previsbines script.
  • Make sure your have no Data/vis or Data/meshes/Precombined directories/files. This is where you will build previsbines too.
  • Launch GeneratePrevisibines.bat via a CMD prompt, directly via a shortcut (recommended), or from within MO2 (if using MO2).
  • If you get errors then your environment is not set up, or you may need to edit the script to hard-code your CK and/or FO4edit locations.
  • If you have moved your Game and NOT run your game though steam (i.e. only used the F4SE loader) then the registry will point to the WRONG directory.
  • When prompted for your Previsbine Patch name, type the name you want it called (if using the seed from my script), or the name of your seed mod.
  • DO NOT put spaces in your Mod name! The CK does not like to create CDX/CSG files with spaces in their name.
  • Note: My script looks for xPrevisPatch.esp if it can't find the patch name you specified, and will rename it to the name you selected.
  • The process will begin. DO NOT touch your computer until it ends, otherwise the FO4Edit scripts may hang (as I send keystrokes to them).
  • Once complete you will have 4 files in your Data directory. You need to (7)zip them up so you can install them properly via you ModManager.
  • Remember to then delete those 4 files, as well as Previs.esp, CombinedObjects.esp, xPrevisPatch.esp.

If for some reason a phase of the process has failed and you want to re-run it -
  • Re-run GeneratePrevisibines.bat
  • Use the same Patch mod name as you used in the first run.
  • When asked "Plugin already exists, Use It? [Y], Exit [N], Continue from failed step [C]" press C
  • At the next prompt select the Phase that you want to re-run
  • If you have old previs files from the failed phase, you will be prompted to delete them.

If the GeneratePrevisbines.bat script fails before prompting you for a Patch Mod name then your Game/CK setup is faulty:
  • Failure to find Fallout4.exe is usually because you have not run the game setup (Fallout4Launcher.exe) since you installed/moved FO4.
  • Failure to find FO4Edit.exe is usually because you have not run it at least once.
  • Failure to find CreationKit.exe is because I expect it to be in the same directory as Fallout4.exe.


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.
Note - 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.

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!).
- FO4MergeCombinedObjectsAndCheck.pas: Improved version of the original MergeCombinedObjects script.
- FO4MergePreVisandCleanRefr.pas: Improved version of the original MergePreVis script.
- 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.

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


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.


FO4FindNewPCStatics.pas FO4Edit script to locate/exclude problem Precombineable Meshes (that crash the CK):

Above shows it run on my Atlas Summit PRP seed, and the STAT I have excluded as I found it crashes Precombine building in the CK on that Cell.
If you "exclude all" and the CK still crashes then run the script again and it will do a deeper check (that will take much longer).