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.

READ everything below, as well as any stickied Posts, before continuing otherwise you will have many problems!

You MUST download and update to the following files:
[Jul 2024] Updated V4.4 FO4Check_Previsbines.pas (Promoted to main version. See Changelog)
[Jul 2024] Updated V1.2 FO4CleanPrevisPatchMasters.pas (Various bug fixes)
[Jul 2024] Updated V2.4 FO4CkeckPrevisbineAssets.pas (Detect more issues)
[Jul 2024] Updated V1.7 FO4FindNewPCStatics.pas (Can be run against multiple mods - only updates the last mod in LO)
[Jun 2024] Updated V1.8 Batch_FO4MergePreVisandCleanRefr.pas (Fix: Wasn't cleaning out all "PleaseRemove" REFRs in Persistent Cell)
[Mar 2024] Updated V1.31 AutoCellDisplay (Fix: Display on crouch was not working)
[Jan 2024] Updated V2.0 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)
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.4) 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 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 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.
  • 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.
       Supported CK versions combinations are:
CK Version V1.10.162 and CK Fixes (2023 CKFixes V2.0.1)  OR
CK Version V1.10.162 and V0.2 build 941 of  CKPE with bOwnArchiveLoader=false set in CreationKitPlatformExtended.ini OR
CK Version V1.10.162 and V0.3 build 241 of CKPE if you are using NG archives (i.e. you downgraded your CK/Fallout4.exe only) OR
CK Next Gen update (V1.10.982.3) and CKPE V0.3 build 368 (at least).

        Note: If you are running Downgraded CK but NG archives you need to use CKPE V0.3-b241 and downgrade 2 archives (see Sticked Post).

    Also you MUST update the CKPE ini file CreationKitPlatformExtended.ini . Either download my version of that file under "optional files",
or manually edit your file to add:bBSPointerHandleExtremly=true and sOutputFile=CK.log

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.
  • The ONLY exception I have to 6) is a mod that updates a huge number of CELLs, and includes new Previsbines (e.g. total replacer mods). Such mods will easily have >1GB of precombines unpacked. You are much better off placing them after PRP and patching the result.
  • 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 READ THIS!
Spoiler:  
Show
  • FIRST Read the 2 articles with this mod which explains the general concepts and "seed" building.
  • SECOND Read the Stickied Posts as this talks about FO4 NG/CK/Steam/MO2 specific issues.
  • 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 at least once though steam (i.e. only used the F4SE loader) then the registry will point to the WRONG directory. Start your game at least once via Steam.
  • Starting the game once via Fallout4Launcher.exe is also sufficient, especially if you use the GOG version.
  • When prompted for your Previsbine Patch name, type the name you want it called .If there is no mod with that name in your Data directory it will look for xPrevisPatch.esp (created by FO4Check_Previsbines) and offer to use and rename it to that name.
    IF xPrevisPatch.esp does not exist then you will get an error. DO NOT use xPrevisPatch as your mod name!!!
  • NOTE: MO2 may have moved xPrevisPatch.esp to override and made it inaccessible, which may cause the above error.
  • DO NOT put spaces in your Mod name! The CK does not like to create CDX/CSG files with spaces in their name.
  • The process will begin. DO NOT touch your computer until it ends, otherwise the FO4Edit scripts may hang (as I send keystrokes to them).
  • If you find the process has hung in FO4Edit waiting on prompt then click/confirm that prompt and allow it to continue. DO NOTHING ELSE.
  • If the process has stopped due to an error box displayed by the CK then you need to resolve the problems as outlined in the Deep Dive.
  • NOTE: A failure in the CK may not result in a crash, but the script will still end noting an error. Still follow the Deep dive to resolve.
  • 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.


FO4FindNewPCStatics.pas (V1.7)  FO4Edit script to locate/exclude problem Precombineable Meshes (that 'may' crash the CK):
New: Now detects meshes known to crash the CK! Can be run against multiple mods (only updates last in LO).

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 new 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.
  翻译: