Skip to content

GetNewFormID only allows 0 argument when it needs IwbFile as the input #946

Description

@lampuiho

What is the version of xEdit you are using?
FO4Edit 4.0.3 (819FA7E8) starting session 2021-08-22 07:11:29

Describe the bug
xejviScriptAdapter.pas
line 2121 AddFunction(cUnit, 'GetNewFormID', IwbFile_GetNewFormID, 0, [varEmpty], varEmpty);

contradicts the documentation on the page https://tes5edit.github.io/docs/13-Scripting-Functions.html
regarding the function GetNewFormID

To reproduce
Steps to reproduce the behavior:
Run the script
`unit userscript;

const
sNameElement = 'FULL - Name';

function Initialize: integer;
var
i, loadOrder: integer;
eFile: IwbFile;
sFName, sHexLO: string;
begin
for i := 0 to FileCount - 1 do begin
eFile := FileByIndex(i);
if Assigned(eFile) then begin
loadOrder := GetNewFormID(eFile);
sHexLO := IntToHex(loadOrder,8);
sFName:= GetFileName(eFile);
AddMessage(sFName + ' has the load order ' + sHexLO);
end;
end;
end;

end.`
And it reports
[00:00] Exception in unit line -1: Error in unit 'userscript' on line 15 : Too many actual parameters

Expected behavior
It should return the new FormID

Additional context
GetLoadOrder is also bugged with FO4edit when there are esl files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions