Difference between revisions of "TES5Edit Scripting Functions"
Jump to navigation
Jump to search
no edit summary
imported>Sharlikran (Created page with "Work in progress: To become the future home of scriptiong functions for TES5Edit. Turulo from the Nexus communithy started this but it's hard to do a lot of work alone. If y...") |
imported>Turulo |
||
Line 1: | Line 1: | ||
Work in progress: To become the future home of | Work in progress: To become the future home of scripting functions for TES5Edit. Turulo from the Nexus community started this but it's hard to do a lot of work alone. If you make scripts for TES5Edit please contribute to this page. | ||
Returns | {| class="TES5Edit Scripting Functions" style="border-collapse: separate; border-spacing: 4; border: 1px solid #000; cellpadding: 5" | ||
IwbElement | |- | ||
! scope="col" align="left" | Function | |||
integer | ! scope="col" align="left" | Returns | ||
! scope="col" align="left" | Arguments | |||
! scope="col" align="left" | Description | |||
IwbFile | |- | ||
IwbFile | ! scope="row" align="left" | Add | ||
| IwbElement | |||
boolean | | container : IwbContainer, name : string, silent = true : boolean, | ||
boolean | | Implemented for main records etc. | ||
boolean | |||
|- | |||
boolean | ! scope="row" align="left" | AddElement | ||
IwbGroupRecord | | | ||
IwbMainRecord | | container : IwbContainer , element : IwbElement , , | ||
| | |||
boolean | |||
TConflictThis | |- | ||
TConflictThis | ! scope="row" align="left" | AdditionalElementCount | ||
| integer | |||
TConflictThis | | container : IwbContainer, , , | ||
IwbMainRecord | | | ||
TwbDefType | |||
IwbElement | |- | ||
! scope="row" align="left" | AddMasterIfMissing | |||
IwbElement | | | ||
IwbElement | | file : IwbFile , mastername : string , , | ||
IwbElement | | | ||
integer | |||
boolean | |- | ||
TwbElementType | ! scope="row" align="left" | AddMessage | ||
boolean | | | ||
| message : string , , , | |||
IwbFile | | Adds a message line into the TES5Edit output panel | ||
cardinal | |||
IwbGroupRecord | |- | ||
cardinal | ! scope="row" align="left" | AddNewFile | ||
| IwbFile | |||
string | | , , , | ||
IwbContainer | | Adds a new file and returns its reference | ||
string | |||
string | |- | ||
variant | ! scope="row" align="left" | AddRequiredElementMasters | ||
IwbFile | | IwbFile | ||
string | | aSourceElement : IwbElement , aTargetFile : IwbFile , aAsNew : boolean , | ||
cardinal | | Add the element''s master into the target file. | ||
boolean | |||
boolean | |- | ||
boolean | ! scope="row" align="left" | Assigned | ||
boolean | | | ||
| element : IwbElement , , , | |||
cardinal | | | ||
cardinal | |||
variant | |- | ||
! scope="row" align="left" | CanContainFormIDs | |||
cardinal | | boolean | ||
integer | | element : IwbElement , , , | ||
boolean | | | ||
integer | |- | ||
! scope="row" align="left" | CanMoveDown | |||
| boolean | |||
| element : IwbElement , , , | |||
boolean | | | ||
boolean | |||
boolean | |- | ||
! scope="row" align="left" | CanMoveUp | |||
IwbElement | | boolean | ||
IwbElement | | element : IwbElement , , , | ||
cardinal | | | ||
IInterface | |- | ||
IInterface | ! scope="row" align="left" | ChangeFormSignature | ||
cardinal | | | ||
IwbMainRecord | | record : IwbMainRecord , signature : TwbSignature , , | ||
| | |||
|- | |||
! scope="row" align="left" | Check | |||
cardinal | | boolean | ||
string | | element : IwbElement , , , | ||
IwbMainRecord | | | ||
IwbMainRecord | |||
|- | |||
cardinal | ! scope="row" align="left" | ChildGroup | ||
cardinal | | IwbGroupRecord | ||
IwbMainRecord | | record : IwbMainRecord , , , | ||
| | |||
IwbElement | |||
IwbElement | |- | ||
boolean | ! scope="row" align="left" | ChildrenOf | ||
| IwbMainRecord | |||
cardinal | | group : IwbGroupRecord , , , | ||
boolean | | | ||
|- | |||
! scope="row" align="left" | CleanMasters | |||
| | |||
| file : IwbFile , , , | |||
| | |||
|- | |||
! scope="row" align="left" | CompareExchangeFormID | |||
| boolean | |||
| mainrecord : IwbMainRecord , oldFormID : Cardinal , aNewFormID : Cardinal , | |||
| | |||
string | |- | ||
string | ! scope="row" align="left" | ConflictAllForMainRecord | ||
string | | TConflictThis | ||
| record : IwbMainRecord , , , | |||
IwbElement | | Gets the ConflictThis argument of the record by calling ConflictLevelForMainRecord (see ctXxxxx enums) | ||
IwbElement | |||
boolean | |- | ||
! scope="row" align="left" | ConflictAllForNode | |||
| TConflictThis | |||
| node : IwbElement , , , | |||
| Gets the ConflictAll argument of the record by calling ConflictLevelForMainRecord (see ctXxxxx enums) | |||
|- | |||
! scope="row" align="left" | ConflictThisForMainRecord | |||
| TConflictThis | |||
| record : IwbMainRecord , , , | |||
| Gets the ConflictThis argument of the record by calling ConflictLevelForMainRecord (see ctXxxxx enums) | |||
|- | |||
! scope="row" align="left" | ConflictThisForNode | |||
| TConflictThis | |||
| node : IwbElement , , , | |||
| Gets the ConflictAll argument of the record by calling ConflictLevelForMainRecord (see ctXxxxx enums) | |||
|- | |||
! scope="row" align="left" | ContainingMainRecord | |||
| IwbMainRecord | |||
| element : IwbElement , , , | |||
| | |||
|- | |||
! scope="row" align="left" | DefType | |||
| TwbDefType | |||
| element : IInterface , , , | |||
| returns the IwbElement::DefType (see dtXxxx enums) | |||
|- | |||
! scope="row" align="left" | ElementAssign | |||
| IwbElement | |||
| container : IwbContainer , aInder : integer, [element : IwbElement], aOnlySK : boolean | |||
| Adds a new element to the container | |||
|- | |||
! scope="row" align="left" | ElementByIndex | |||
| IwbElement | |||
| container : IwbContainer , index : integer , , | |||
| Gets an element in the container by index | |||
|- | |||
! scope="row" align="left" | ElementByName | |||
| IwbElement | |||
| container : IwbContainer , name : string , , | |||
| Gets an element in the container by name | |||
|- | |||
! scope="row" align="left" | ElementByPath | |||
| IwbElement | |||
| container : IwbContainer , path : string , , | |||
| Gets an element in the container by path | |||
|- | |||
! scope="row" align="left" | ElementBySignature | |||
| IwbElement | |||
| container : IwbContainer , signature : string , , | |||
| Gets an element in the container by its signature | |||
|- | |||
! scope="row" align="left" | ElementCount | |||
| integer | |||
| container : IwbContainer , , , | |||
| Returns the number of elements in a container | |||
|- | |||
! scope="row" align="left" | ElementExists | |||
| boolean | |||
| container : IwbContainer , name : string , , | |||
| Checks if the name of the element already exist in the container | |||
|- | |||
! scope="row" align="left" | ElementType | |||
| TwbElementType | |||
| element : IwbElement , , , | |||
| Returns the ElementType of the element | |||
|- | |||
! scope="row" align="left" | Equals | |||
| boolean | |||
| element1 : IwbElement , element2 : IwbElement , , | |||
| Compares both elements by their ElementID | |||
|- | |||
! scope="row" align="left" | FileByIndex | |||
| IwbFile | |||
| index : integer , , , | |||
| Gets the file at the specified index | |||
|- | |||
! scope="row" align="left" | FileByLoadOrder | |||
| IwbFile | |||
| loadorder : integer , , , | |||
| Gets the file at the specified load order | |||
|- | |||
! scope="row" align="left" | FileFormIDtoLoadOrderFormID | |||
| cardinal | |||
| file : IwbFile , formid : string/cardinal , , | |||
| | |||
|- | |||
! scope="row" align="left" | FindChildGroup | |||
| IwbGroupRecord | |||
| group : IwbGroupRecord , aType : integer , aMainRecord : IwbMainRecord , | |||
| | |||
|- | |||
! scope="row" align="left" | FixedFormID | |||
| cardinal | |||
| aMainRecord : IwbMainRecord , , , | |||
| | |||
|- | |||
! scope="row" align="left" | FormID | |||
| cardinal | |||
| aMainRecord : IwbMainRecord , , , | |||
| Obtains the FormID of the record | |||
|- | |||
! scope="row" align="left" | FullPath | |||
| string | |||
| element : IwbElement , , , | |||
| | |||
|- | |||
! scope="row" align="left" | GetContainer | |||
| IwbContainer | |||
| element : IwbElement , , , | |||
| Gets the container of the element | |||
|- | |||
! scope="row" align="left" | GetEditValue | |||
| string | |||
| element : IwbElement , , , | |||
| Gets the element's value represented as text | |||
|- | |||
! scope="row" align="left" | GetElementEditValues | |||
| string | |||
| element : IwbElement , name : string , , | |||
| Gets the element's value represented as text | |||
|- | |||
! scope="row" align="left" | GetElementNativeValues | |||
| variant | |||
| element : IwbElement , name : string , , | |||
| Gets the element's native value | |||
|- | |||
! scope="row" align="left" | GetFile | |||
| IwbFile | |||
| element : IwbElement , , , | |||
| Gets the file that defines the element | |||
|- | |||
! scope="row" align="left" | GetFileName | |||
| string | |||
| file : IwbFile , , , | |||
| Obtains the filename of the plugin file | |||
|- | |||
! scope="row" align="left" | GetFormVersion | |||
| cardinal | |||
| mainrecord : IwbMainRecord , , , | |||
| | |||
|- | |||
! scope="row" align="left" | GetIsDeleted | |||
| boolean | |||
| mainrecord : IwbMainRecord , , , | |||
| Indicates if the record has been deleted | |||
|- | |||
! scope="row" align="left" | GetIsESM | |||
| boolean | |||
| file : IwbFile , , , | |||
| Indicates if the plugin is an ESM file | |||
|- | |||
! scope="row" align="left" | GetIsInitiallyDisabled | |||
| boolean | |||
| mainrecord : IwbMainRecord , , , | |||
| | |||
|- | |||
! scope="row" align="left" | GetIsPersistent | |||
| boolean | |||
| mainrecord : IwbMainRecord , , , | |||
| | |||
|- | |||
! scope="row" align="left" | GetIsVisibleWhenDistant | |||
| boolean | |||
| mainrecord : IwbMainRecord , , , | |||
| | |||
|- | |||
! scope="row" align="left" | GetLoadOrder | |||
| cardinal | |||
| file : IwbFile , , , | |||
| Gets the global load order of the file | |||
|- | |||
! scope="row" align="left" | GetLoadOrderFormID | |||
| cardinal | |||
| mainrecord : IwbMainRecord , , , | |||
| Obtains the FormID with the current load order applied | |||
|- | |||
! scope="row" align="left" | GetNativeValue | |||
| variant | |||
| element : IwbElement , , , | |||
| Gets the element's native value | |||
|- | |||
! scope="row" align="left" | GroupBySignature | |||
| | |||
| file : IwbFile , signature : string , , | |||
| | |||
|- | |||
! scope="row" align="left" | GroupLabel | |||
| cardinal | |||
| group : IwbGroupRecord , , , | |||
| | |||
|- | |||
! scope="row" align="left" | GroupType | |||
| integer | |||
| group : IwbGroupRecord , , , | |||
| | |||
|- | |||
! scope="row" align="left" | HasGroup | |||
| boolean | |||
| file : IwbFile , signature : string , , | |||
| | |||
|- | |||
! scope="row" align="left" | HasMaster | |||
| boolean | |||
| file : IwbFile , signature : string , , | |||
| Returns true if the file has a master file defined | |||
|- | |||
! scope="row" align="left" | IndexOf | |||
| integer | |||
| container : IwbContainer , element : IwbElement , , | |||
| Gets the index of the element inside the collection | |||
|- | |||
! scope="row" align="left" | InsertElement | |||
| | |||
| container : IwbContainer , position : integer , element : IwbElement , | |||
| Inserts an existing element inside a collection by position | |||
|- | |||
! scope="row" align="left" | IsEditable | |||
| boolean | |||
| element : IwbElement , , , | |||
| | |||
|- | |||
! scope="row" align="left" | IsInjected | |||
| boolean | |||
| element : IwbElement , , , | |||
| | |||
|- | |||
! scope="row" align="left" | IsMaster | |||
| boolean | |||
| record : IwbMainRecord , , , | |||
| | |||
|- | |||
! scope="row" align="left" | IsWinningOverride | |||
| boolean | |||
| record : IwbMainRecord , , , | |||
| | |||
|- | |||
! scope="row" align="left" | JumpTo | |||
| TConflictThis | |||
| record : IwbMainRecord , backward : boolean , , | |||
| Selects the specified record | |||
|- | |||
! scope="row" align="left" | LastElement | |||
| IwbElement | |||
| container : IwbContainer , , , | |||
| Obtains the last element in the collection | |||
|- | |||
! scope="row" align="left" | LinksTo | |||
| IwbElement | |||
| element : IwbElement , , , | |||
| Obtains the referenced element | |||
|- | |||
! scope="row" align="left" | LoadOrderFormIDtoFileFormID | |||
| cardinal | |||
| file : IwbFile , aFormID : cardinal , , | |||
| | |||
|- | |||
! scope="row" align="left" | MainRecordByEditorID | |||
| IwbMainRecord | |||
| group : IwbGroupRecord , , , | |||
| Does not work for every case because its inefficient | |||
|- | |||
! scope="row" align="left" | Master | |||
| IInterface | |||
| record : IwbMainRecord , , , | |||
| | |||
|- | |||
! scope="row" align="left" | MasterByIndex | |||
| IInterface | |||
| file : IwbFile , index : integer , , | |||
| | |||
|- | |||
! scope="row" align="left" | MasterCount | |||
| cardinal | |||
| file : IwbFile , , , | |||
| | |||
|- | |||
! scope="row" align="left" | MasterOrSelf | |||
| IwbMainRecord | |||
| record : IwbMainRecord , , , | |||
| | |||
|- | |||
! scope="row" align="left" | MoveDown | |||
| | |||
| element : IwbElement , , , | |||
| Moves the element down | |||
|- | |||
! scope="row" align="left" | MoveUp | |||
| | |||
| element : IwbElement , , , | |||
| Moves the element up | |||
|- | |||
! scope="row" align="left" | Name | |||
| | |||
| element : IwbElement , , , | |||
| Obtains the name of the element | |||
|- | |||
! scope="row" align="left" | OverrideByIndex | |||
| IwbMainRecord | |||
| record : IwbMainRecord , index : integer , , | |||
| | |||
|- | |||
! scope="row" align="left" | OverrideCount | |||
| cardinal | |||
| record : IwbMainRecord , , , | |||
| | |||
|- | |||
! scope="row" align="left" | Path | |||
| string | |||
| element : IwbElement , , , | |||
| | |||
|- | |||
! scope="row" align="left" | RecordByEditorID | |||
| IwbMainRecord | |||
| file : IwbFile , editorid : string , , | |||
| | |||
|- | |||
! scope="row" align="left" | RecordByFormID | |||
| IwbMainRecord | |||
| file : IwbFile , formid : integer , aAllowInjected : boolean , | |||
| | |||
|- | |||
! scope="row" align="left" | RecordByIndex | |||
| IwbMainRecord | |||
| file : IwbFile , index : integer , , | |||
| | |||
|- | |||
! scope="row" align="left" | RecordCount | |||
| cardinal | |||
| file : IwbFile , , , | |||
| | |||
|- | |||
! scope="row" align="left" | ReferencedByCount | |||
| cardinal | |||
| record : IwbMainRecord , , , | |||
| | |||
|- | |||
! scope="row" align="left" | ReferencedByIndex | |||
| IwbMainRecord | |||
| record : IwbMainRecord , index : integer , , | |||
| | |||
|- | |||
! scope="row" align="left" | Remove | |||
| | |||
| element : IwbElement , , , | |||
| | |||
|- | |||
! scope="row" align="left" | RemoveByIndex | |||
| IwbElement | |||
| container : IwbContainer , index : integer , aMarkModified : boolean , | |||
| | |||
|- | |||
! scope="row" align="left" | RemoveElement | |||
| IwbElement | |||
| container : IwbContainer , element : IwbElement , , | |||
| | |||
|- | |||
! scope="row" align="left" | RemoveNode | |||
| boolean | |||
| node : IwbElement , , , | |||
| Removes the node from the file | |||
|- | |||
! scope="row" align="left" | ResourceCopy | |||
| | |||
| container : IwbContainer , fileName : string , pathOut : string , containerIndex : integer | |||
| | |||
|- | |||
! scope="row" align="left" | ResourceCount | |||
| cardinal | |||
| container : IwbContainer , aFileName : string , containers : TStrings , | |||
| | |||
|- | |||
! scope="row" align="left" | ResourceExists | |||
| boolean | |||
| container : IwbContainer , aFileName : string , , | |||
| | |||
|- | |||
! scope="row" align="left" | ResourceList | |||
| | |||
| container : IwbContainer , aContainerName : string , containers : TStrings , | |||
| | |||
|- | |||
! scope="row" align="left" | ReverseElements | |||
| | |||
| container : IwbContainer , , , | |||
| | |||
|- | |||
! scope="row" align="left" | SetEditValue | |||
| | |||
| element : IwbElement , value : string , , | |||
| Sets the value of the element as string | |||
|- | |||
! scope="row" align="left" | SetElementEditValues | |||
| | |||
| container : IwbContainer , path : string , value : string , | |||
| Sets the value as a string of the element by its path | |||
|- | |||
! scope="row" align="left" | SetElementNativeValues | |||
| | |||
| container : IwbContainer , path : string , value : variant , | |||
| Sets the native value of the element by its path | |||
|- | |||
! scope="row" align="left" | SetFormVersion | |||
| | |||
| record : IwbMainRecord , version : integer , , | |||
| | |||
|- | |||
! scope="row" align="left" | SetIsDeleted | |||
| | |||
| record : IwbMainRecord , value : boolean , , | |||
| | |||
|- | |||
! scope="row" align="left" | SetIsESM | |||
| | |||
| file : IwbFile , value : boolean , , | |||
| | |||
|- | |||
! scope="row" align="left" | SetIsInitiallyDisabled | |||
| | |||
| record : IwbMainRecord , value : boolean , , | |||
| | |||
|- | |||
! scope="row" align="left" | SetIsPersistent | |||
| | |||
| record : IwbMainRecord , value : boolean , , | |||
| | |||
|- | |||
! scope="row" align="left" | SetIsVisibleWhenDistant | |||
| | |||
| record : IwbMainRecord , value : boolean , , | |||
| | |||
|- | |||
! scope="row" align="left" | SetLoadOrderFormID | |||
| | |||
| record : IwbMainRecord , loadOrderFormId : cardinal , , | |||
| | |||
|- | |||
! scope="row" align="left" | SetNativeValue | |||
| | |||
| element : IwbElement , value : variant , , | |||
| Sets the native value of the element | |||
|- | |||
! scope="row" align="left" | ShortName | |||
| string | |||
| element : IwbElement , , , | |||
| Gets the short name of the element | |||
|- | |||
! scope="row" align="left" | Signature | |||
| string | |||
| record : IwbMainRecord , , , | |||
| | |||
|- | |||
! scope="row" align="left" | SortKey | |||
| string | |||
| element : IwbElement, aExtended: boolean , , | |||
| | |||
|- | |||
! scope="row" align="left" | SortMasters | |||
| | |||
| file : IwbFile , , , | |||
| | |||
|- | |||
! scope="row" align="left" | wbCopyElementToFile | |||
| IwbElement | |||
| element : IwbElement , file : IwbFile , aAsNew : boolean , aDeepCopy : boolean | |||
| | |||
|- | |||
! scope="row" align="left" | wbCopyElementToRecord | |||
| IwbElement | |||
| element : IwbElement , aMainRecord : IwbMainRecord , aAsNew : boolean , aDeepCopy : boolean | |||
| | |||
|- | |||
! scope="row" align="left" | WinningOverride | |||
| boolean | |||
| record : IwbMainRecord , , , | |||
|} |