Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Biped Object Names in Race Records Causing System.ArgumentException #163

Open
Darkaxt opened this issue Nov 1, 2024 · 0 comments

Comments

@Darkaxt
Copy link

Darkaxt commented Nov 1, 2024

When editing or creating mods for Fallout 4 using xEdit, the Biped Object Names property within the Race record can exhibit characteristics that Mutagen does not handle well. This results in an error message similar to:

Unexpected header type: NAME System.ArgumentException

Two main issues have been identified:

  1. Number of Entries: The _Biped Object Names_ property is not always constrained to 32 entries (0 to 31). Having more than 32 entries can cause errors.
    
  2. Null Values: Some slots in the _Biped Object Names_ property can contain null values instead of properly defined empty slots.
    

Manual Fix:

  1. Ensure that null slots are replaced with empty, unnamed slots.
    
  2. Verify that the number of entries does not exceed 31, keeping the indexes within the allowed range (0 to 31).
    

xEdit Script for Reference: To help identify problematic records, here is an xEdit script that checks Race records for the issues outlined:

unit UserScript;

function Process(e: IInterface): integer;
var
  bipedObjNames: IInterface;
  count: integer;
begin
  Result := 0;

  // Check if the record is a race
  if Signature(e) <> 'RACE' then
    Exit;

  // Check if the current record has the "Biped Object Names" path
  bipedObjNames := ElementByPath(e, 'Biped Object Names');
  if Assigned(bipedObjNames) then begin
    // Count the number of sub-elements under "Biped Object Names"
    count := ElementCount(bipedObjNames);
    
    // Report if there are more than 32 entries
    if count > 32 then
      AddMessage('Record ' + Name(e) + ' has ' + IntToStr(count) + ' Biped Object Names entries.');
  end;
end;

function Finalize: integer;
begin
  AddMessage('Script completed.');
  Result := 0;
end;

end.

This script will identify Race records that have more than 32 Biped Object Names entries, allowing for easy review and correction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant