Skyrim Special Edition
0 of 0

File information

Last updated

Original upload

Created by

Hishy

Uploaded by

hishutup

Virus scan

Safe to use

Tags for this mod

About this mod

An xEdit script to assist with record copying and supporting caching for records for persistent records in patches and full ESL support.

Requirements
Permissions and credits
Changelogs
A library to support something like a consistency file similar to that of SUM.
Use a unique identifier for both your script and the record you're trying to cache or retrieve.
If ESL is unsupported, ESP file will emulate the XXYYYZZZ formid format
If there are records that must be cached and must load after all patched files
Close the current cache and open a new one with a new id that runs after the initial cache instance.

To use these functions, just add the line to the top of your xEdit script under the unit
uses 'lib\Hishy_CacheRecords';

OpenCache(sFilePrefix, bIgnoreEslSupport)
must be called first before using either
CacheRecordWithPrefix()CacheRecord(), CloseCache() functions.

CacheRecordWithPrefix(iSrcElement, bDeepCopy, sTargetElementIdent, sPrefixRemove, sPrefix, sSuffix)
and CacheRecord(iSrcElement, bDeepCopy, sTargetElementIdent)
work pretty much as they wrap around the native functions
Though there is no override support

CloseCache(bSkipSave) 
must be called before script terminates to free memory and save the cache file.
The default path to the cache file is in xEdit's "Edit Scripts\lib" folder.
The default name is Hishy_RecordCache_wbGameMode.json

ClearCache(sPrefix) can be called when there is not an open cache file.
This will clear all cache for a specific file prefix

Argument Meanings:
bDeepCopy
Boolean, same as the native deep copy arg.
bIgnoreEslSupport
Boolean, if true, ESLs will not be used.
bSkipSave
Boolean, if true, cache file will not be saved.

iSrcElement
IInterface, element that will be copied.

sFilePrefix
String, file name to use for the patch file.
sPrefix
String, same as the native sPrefix.
sPrefixRemove
String, same as the native sPrefixRemove.
sSuffix
String, same as the native sSuffix.
sTargetElementIdent
String, the identifier used to lookup a specific record in the cache file.


I have included an example file under the name "Hishy_ExampleCacheRecords.pas"
Select a simple topgroup like that of Armor or Weapon and apply the script.
The script should copy all the records as new.
Regardless of what records are copied they should maintain their same FormID and file name through multiple generations.


Please do not alter the cache file in anyway.
Please pick a unique ID to you and your script.
Please do no edit this script and distribute, makes for terrible version control.
Feel free to edit as you please and feel free to share.
If you have some addition or fix, request permission to this page.