Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Infernio/59c0b983bffcc7cf991ecc7384f9f0f4 to your computer and use it in GitHub Desktop.
Save Infernio/59c0b983bffcc7cf991ecc7384f9f0f4 to your computer and use it in GitHub Desktop.
{
Check form version of all records in all currently loaded plugins.
Based on 'Check for old form version.pas'.
}
unit SSEFindOldFormVersions;
const
CheckFormVersion = 44;
function Initialize: integer;
var
i, j: integer;
plugin, rec: IInterface;
fileName: string;
begin
for i := 0 to Pred(FileCount) do begin
plugin := FileByIndex(i);
fileName := GetFileName(plugin);
if (fileName <> 'Skyrim.esm') and (fileName <> 'Update.esm') and (fileName <> 'Dawnguard.esm') and
(fileName <> 'HearthFires.esm') and (fileName <> 'Dragonborn.esm') and (fileName <> 'Skyrim.exe') then
for j := 0 to Pred(RecordCount(plugin)) do begin
rec := RecordByIndex(plugin, j);
// SPGD breaks on FormID version 44: https://bethesda.net/community/topic/23783/bug-form-version-44-spgd-record-unused-in-skyrim-se
if (Signature(rec) <> 'SPGD') and (GetFormVersion(rec) < CheckFormVersion) then
AddMessage('Outdated record with FormID ' + IntToHex(FormID(rec), 8) + ' of type ' + Signature(rec) + ', in plugin ' + fileName);
end;
end;
Result := 1;
end;
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment