Difference between revisions of "User:DavidJCobb/Sandbox/TES5Edit Scripting Functions"
imported>DavidJCobb (→DDS functions: added functions from the source code) |
imported>DavidJCobb (Several additions and corrections -- thanks, /u/Galahi!) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 41: | Line 41: | ||
{{TES5Edit function row|even | {{TES5Edit function row|even | ||
|Assigned|boolean|aeElement: IwbElement | |Assigned|boolean|aeElement: IwbElement | ||
|An extension to Delphi's native [http://www.delphibasics.co.uk/RTL.asp?Name=Assigned Assigned] function: returns true if ''aeElement'' is not ''Nil'', and returns false otherwise.}} | |An extension to Delphi's native [http://www.delphibasics.co.uk/RTL.asp?Name{{=}}Assigned Assigned] function: returns true if ''aeElement'' is not ''Nil'', and returns false otherwise.}} | ||
{{TES5Edit function row|odd | {{TES5Edit function row|odd | ||
|ObjectToElement|IInterface|akObject | |ObjectToElement|IInterface|akObject | ||
Line 50: | Line 50: | ||
{{TES5Edit function row|odd | {{TES5Edit function row|odd | ||
|EnableSkyrimSaveFormat|| | |EnableSkyrimSaveFormat|| | ||
| | |As of xEdit 3.1.2, calling this function will corrupt saved plugins until xEdit is restarted.}} | ||
{{TES5Edit function row|even | {{TES5Edit function row|even | ||
|GetRecordDefNames||akList: TStrings | |GetRecordDefNames||akList: TStrings | ||
Line 56: | Line 56: | ||
{{TES5Edit function row|odd | {{TES5Edit function row|odd | ||
|wbFilterStrings||akListIn: TStrings;<br/> akListOut: TStrings;<br/> asFilter: String | |wbFilterStrings||akListIn: TStrings;<br/> akListOut: TStrings;<br/> asFilter: String | ||
|Modifies ''akListOut'', adding every entry in ''akListIn'' that contains ''asFilter''.}} | |Modifies ''akListOut'', adding every entry in ''akListIn'' that contains the substring ''asFilter''.}} | ||
{{TES5Edit function row|even | {{TES5Edit function row|even | ||
|wbRemoveDuplicateStrings||akList: TStringList | |wbRemoveDuplicateStrings||akList: TStringList | ||
|Modifies ''akList'', removing duplicate entries that it contains.}} | |Modifies ''akList'', removing any duplicate entries that it contains.}} | ||
|} | |} | ||
Line 73: | Line 73: | ||
{{TES5Edit function row|even | {{TES5Edit function row|even | ||
|BaseName|string|aeElement: IwbElement | |BaseName|string|aeElement: IwbElement | ||
| | |Identical to ''Name'' except that it handles IwbFiles differently. ''Name'' will prepend a load order index (i.e. <code>[02] PluginName.esp</code>), while ''BaseName'' will not.}} | ||
{{TES5Edit function row|odd | {{TES5Edit function row|odd | ||
|BuildRef||aeElement: IwbElement | |BuildRef||aeElement: IwbElement | ||
|Builds reference information for the element. Note that this function will run even if reference information has already been built.}} | |Builds reference information for the element and all of its descendants. Note that this function will run even if reference information has already been built.}} | ||
{{TES5Edit function row|even | {{TES5Edit function row|even | ||
|CanContainFormIDs|boolean|aeElement: IwbElement | |CanContainFormIDs|boolean|aeElement: IwbElement | ||
| | |Guaranteed to return ''True'' if the element can contain form IDs, but not guaranteed to return ''False'' if it can't. This accesses an internal property, ''CanContainFormIDs'', which the internal implementation of ''BuildRef'' uses to skip processing certain descendant elements.}} | ||
{{TES5Edit function row|odd | {{TES5Edit function row|odd | ||
|CanMoveDown|boolean|aeElement: IwbElement | |CanMoveDown|boolean|aeElement: IwbElement | ||
Line 88: | Line 88: | ||
{{TES5Edit function row|odd | {{TES5Edit function row|odd | ||
|Check|string|aeElement: IwbElement | |Check|string|aeElement: IwbElement | ||
| | |Returns the error message produced when the "Check for Errors" functionality is run on ''aeElement''; or else an empty string if no error is found.}} | ||
{{TES5Edit function row|even | {{TES5Edit function row|even | ||
|ClearElementState||aeElement: IwbElement;<br/> aiState: TwbElementState | |ClearElementState||aeElement: IwbElement;<br/> aiState: TwbElementState | ||
| | |Manipulates the internal flags of an element, e.g. <code>ClearElementState(eElement, esModified);</code>. See also: ''GetElementState'', ''SetElementState''.}} | ||
{{TES5Edit function row|odd | {{TES5Edit function row|odd | ||
|DefType|TwbDefType|aeElement: IwbElement | |DefType|TwbDefType|aeElement: IwbElement | ||
Line 97: | Line 97: | ||
{{TES5Edit function row|even | {{TES5Edit function row|even | ||
|DisplayName|string|aeElement: IwbElement | |DisplayName|string|aeElement: IwbElement | ||
|Returns the display name of the element, if it has one.}} | |Returns the display name of the element, if it has one; otherwise, this behaves identically to ''Name''. See also: ''BaseName'', ''ShortName''.}} | ||
{{TES5Edit function row|odd | {{TES5Edit function row|odd | ||
|ElementAssign|IwbElement|aeContainer: IwbContainer;<br/> aiIndex: integer;<br/> aeSource: IwbElement;<br/> abOnlySK: boolean | |ElementAssign|IwbElement|aeContainer: IwbContainer;<br/> aiIndex: integer;<br/> aeSource: IwbElement;<br/> abOnlySK: boolean | ||
Line 109: | Line 109: | ||
:Element to copy from. Use ''Nil'' to create a blank element of the appropriate type. | :Element to copy from. Use ''Nil'' to create a blank element of the appropriate type. | ||
;abOnlySK | ;abOnlySK | ||
:Unknown. False appears to work. | :Unknown; believed to be a "shallow copy only" bool. False appears to work. | ||
Sample: there is a script to copy VMAD subrecords "Skyrim - Copy VMAD subrecord.pas"}} | Sample: there is a script to copy VMAD subrecords "Skyrim - Copy VMAD subrecord.pas"}} | ||
Line 120: | Line 120: | ||
{{TES5Edit function row|even | {{TES5Edit function row|even | ||
|Equals|boolean|aeElement1: IwbElement;<br/> aeElement2: IwbElement | |Equals|boolean|aeElement1: IwbElement;<br/> aeElement2: IwbElement | ||
|Compares two elements by their ElementID. This is sometimes necessary, as different IInterface variables pointing to the same element don't always compare properly when using the <code>=</code> operator.}} | |Compares two elements by their ElementID. This is sometimes necessary, as different IInterface variables pointing to the same element don't always compare properly when using the <code>{{=}}</code> operator.}} | ||
{{TES5Edit function row|odd | {{TES5Edit function row|odd | ||
|FlagValues|string|aeElement: IwbElement | |FlagValues|string|aeElement: IwbElement | ||
Line 126: | Line 126: | ||
{{TES5Edit function row|even | {{TES5Edit function row|even | ||
|FullPath|string|aeElement: IwbElement | |FullPath|string|aeElement: IwbElement | ||
|Returns the full path to the element, going all the way down to its containing file. | |Returns the full path to the element, going all the way down to its containing file. See also: ''Path'', ''PathName''.}} | ||
{{TES5Edit function row|odd | {{TES5Edit function row|odd | ||
|GetContainer|IwbContainer|aeElement: IwbElement | |GetContainer|IwbContainer|aeElement: IwbElement | ||
Line 138: | Line 138: | ||
{{TES5Edit function row|even | {{TES5Edit function row|even | ||
|GetElementState|TwbElementState|aeElement: IwbElement;<br/> aiState: TwbElementState | |GetElementState|TwbElementState|aeElement: IwbElement;<br/> aiState: TwbElementState | ||
| | |Checks the internal flags of an element. See also: ''ClearElementState'', ''SetElementState''.}} | ||
{{TES5Edit function row|odd | {{TES5Edit function row|odd | ||
|GetFile|IwbFile|aeElement: IwbElement | |GetFile|IwbFile|aeElement: IwbElement | ||
Line 165: | Line 165: | ||
{{TES5Edit function row|odd | {{TES5Edit function row|odd | ||
|Name|string|aeElement: IwbElement | |Name|string|aeElement: IwbElement | ||
|Returns the name of the element, if it has one.}} | |Returns the name of the element, if it has one. If ''aeElement'' is an IwbFile or certain kinds of IwbMainRecords, ''Name'' will return a "pretty" name, while ''BaseName'' or ''ShortName'' will return a more basic string. See also: ''DisplayName''.}} | ||
{{TES5Edit function row|even | {{TES5Edit function row|even | ||
|Path|string|aeElement: IwbElement | |Path|string|aeElement: IwbElement | ||
|Returns the path | |Returns the ''path component'' of ''aeElement'' -- that is, ''one single piece'' of the path that ''FullPath'' would return. You could use this when manually constructing a path to supply to ''ElementByPath''. See also (and don't confuse with): ''FullPath'', ''PathName''.}} | ||
{{TES5Edit function row|odd | {{TES5Edit function row|odd | ||
|PathName|string|aeElement: IwbElement | |PathName|string|aeElement: IwbElement | ||
| | |Similar to ''FullPath'' except that names in the path are prefixed with brackets, to uniquely identify each element's unique position among its siblings (see ''IndexOf''). | ||
Example: <code>\[02] neromancer.esp\[7] Worldspace\[1] World Children\[1] Children of 00000D74\[0] Persistent\[2] [REFR:00100452]</code>}} | |||
{{TES5Edit function row|even | {{TES5Edit function row|even | ||
|Remove||aeElement: IwbElement | |Remove||aeElement: IwbElement | ||
|Removes the element from its file.}} | |Removes the element from its file.}} | ||
{{TES5Edit function row|odd | {{TES5Edit function row|odd | ||
|ReportRequiredMasters||aeElement: IwbElement;<br/> | |ReportRequiredMasters||aeElement: IwbElement;<br/> akListOut: TStrings;<br/> akUnknown1: boolean;<br/> akUnknown2: boolean | ||
| | |Checks which master files ''aeElement'' depends on, and adds their filenames to ''akListOut''. The boolean arguments' purposes are unknown, but the "Report masters.pas" script passes ''False'' for both.}} | ||
{{TES5Edit function row|even | {{TES5Edit function row|even | ||
|SetEditValue|string|aeElement: IwbElement;<br/> asValue: string | |SetEditValue|string|aeElement: IwbElement;<br/> asValue: string | ||
Line 183: | Line 185: | ||
{{TES5Edit function row|odd | {{TES5Edit function row|odd | ||
|SetElementState|TwbElementState|aeElement: IwbElement;<br/> aiState: TwbElementState | |SetElementState|TwbElementState|aeElement: IwbElement;<br/> aiState: TwbElementState | ||
| | |Manipulates the internal flags of an element. Returns the value prior to modification. See also: ''ClearElementState'', ''GetElementState''.}} | ||
{{TES5Edit function row|even | {{TES5Edit function row|even | ||
|SetNativeValue|string|aeElement: IwbElement;<br/> avValue: variant | |SetNativeValue|string|aeElement: IwbElement;<br/> avValue: variant | ||
Line 189: | Line 191: | ||
{{TES5Edit function row|odd | {{TES5Edit function row|odd | ||
|SetToDefault||aeElement: IwbElement | |SetToDefault||aeElement: IwbElement | ||
|Unknown.}} | |Unknown. Introduced in xEdit 3.1.3.}} | ||
{{TES5Edit function row|even | {{TES5Edit function row|even | ||
|ShortName|string|aeElement: IwbElement | |ShortName|string|aeElement: IwbElement | ||
| | |Generally the same as ''Name'' unless ''aeElement'' is a reference, cell, or similar record. ''Name'' will return detailed information for those records, while ''ShortName'' will return the signature and form ID in the format <code>[XXXX:01234567]</code>.}} | ||
{{TES5Edit function row|odd | {{TES5Edit function row|odd | ||
|SortKey|string|aeElement: IwbElement | |SortKey|string|aeElement: IwbElement | ||
|Returns a string unique to the element entered. This can be used for sorting elements or for comparing them; for example, you could compare the SortKey for two elements in records which override each other to see if they are different from each other.}} | |Returns a string unique to the element entered. This can be used for sorting elements or for comparing them; for example, you could compare the SortKey for two elements in records which override each other to see if they are different from each other.}} | ||
{{TES5Edit function row|even | {{TES5Edit function row|even | ||
|wbCopyElementToFile|IwbElement|aeElement: IwbElement;<br/> aeFile: IwbFile;<br/> | |wbCopyElementToFile|IwbElement|aeElement: IwbElement;<br/> aeFile: IwbFile;<br/> abAsNew: boolean;<br/> abDeepCopy: boolean | ||
| | |Copies an IwbMainRecord, IwbGroupRecord, or IwbContainer to the specified file. The ''abAsNew'' boolean controls whether or not you're copying the record as an override record. Returns the copied element.}} | ||
{{TES5Edit function row|odd | {{TES5Edit function row|odd | ||
|wbCopyElementToFileWithPrefix|IwbElement|aeElement: IwbElement;<br/> aeFile: IwbFile;<br/> | |wbCopyElementToFileWithPrefix|IwbElement|aeElement: IwbElement;<br/> aeFile: IwbFile;<br/> abAsNew: boolean;<br/> abDeepCopy: boolean;<br/> akUnknown;<br/> akUnknown;<br/> akUnknown | ||
|Details unknown. Returns the copied element.}} | |Details unknown. Returns the copied element.}} | ||
{{TES5Edit function row|even | {{TES5Edit function row|even | ||
|wbCopyElementToRecord|IwbElement|aeElement: IwbElement;<br/> aeRecord: IwbMainRecord;<br/> | |wbCopyElementToRecord|IwbElement|aeElement: IwbElement;<br/> aeRecord: IwbMainRecord;<br/> abAsNew: boolean;<br/> abDeepCopy: boolean | ||
| | |Copies an element to a record, e.g. the "Conditions" element on a [[Constructible Object|COBJ]] record or a faction from an [[ActorBase|NPC_]] record. Returns the copied element.}} | ||
|} | |} | ||
Line 222: | Line 224: | ||
{{TES5Edit function row|even | {{TES5Edit function row|even | ||
|AdditionalElementCount|integer|aeContainer: IwbContainer | |AdditionalElementCount|integer|aeContainer: IwbContainer | ||
|Unknown.}} | |Unknown. This getter accesses an internal function used internally for imposing some order on the sub-elements; it checks whether this element "counts," and if so, how many times. Seems to return 1 or 2 for (main?) records, and 0 for record fields (sub-records).}} | ||
{{TES5Edit function row|odd | {{TES5Edit function row|odd | ||
|ContainerStates|byte|aeContainer: IwbContainer | |ContainerStates|byte|aeContainer: IwbContainer | ||
| | |Returns the internal container flags for ''aeContainer'' (e.g. whether it's initialized, or whether it has had references built) as a bitmask. Refer to "Worldspace browser.pas" for a usage example.}} | ||
{{TES5Edit function row|even | {{TES5Edit function row|even | ||
|ElementByIndex|IwbElement|aeContainer: IwbContainer;<br/> aiIndex: integer | |ElementByIndex|IwbElement|aeContainer: IwbContainer;<br/> aiIndex: integer | ||
Line 244: | Line 246: | ||
|ElementExists|boolean|aeContainer: IwbContainer;<br/> asName: string | |ElementExists|boolean|aeContainer: IwbContainer;<br/> asName: string | ||
|Returns true if ''aeContainer'' as a child element whose name is ''asName''. See also: ''ElementByName''.}} | |Returns true if ''aeContainer'' as a child element whose name is ''asName''. See also: ''ElementByName''.}} | ||
{{TES5Edit function row|odd | |||
|GetElementEditValues|string|aeContainer: IwbContainer;<br/> asPath: string | |||
|Finds the element within ''aeContainer'' specified by ''asPath'', and returns a string representation of its value.}} | |||
{{TES5Edit function row|even | |||
|GetElementNativeValues|variant|aeContainer: IwbContainer;<br/> asPath: string | |||
|Finds the element within ''aeContainer'' specified by ''asPath'', and returns its value.}} | |||
{{TES5Edit function row|even | {{TES5Edit function row|even | ||
|IndexOf|integer|aeContainer: IwbContainer;<br/> aeChild: IwbElement | |IndexOf|integer|aeContainer: IwbContainer;<br/> aeChild: IwbElement | ||
Line 252: | Line 260: | ||
{{TES5Edit function row|even | {{TES5Edit function row|even | ||
|IsSorted|boolean|aeContainer: IwbSortableContainer | |IsSorted|boolean|aeContainer: IwbSortableContainer | ||
| | |Checks whether xEdit always keeps ''aeContainer'' sorted. If so, this function will return ''True'', and calling ''CanMoveUp'' and ''CanMoveDown'' on child elements will always return ''False''.}} | ||
{{TES5Edit function row|odd | {{TES5Edit function row|odd | ||
|LastElement|IwbElement|aeContainer: IwbContainer | |LastElement|IwbElement|aeContainer: IwbContainer | ||
|Returns the last child element in ''aeContainer'', or ''Nil'' if there are no child elements.}} | |Returns the last child element in ''aeContainer'', or ''Nil'' if there are no child elements.}} | ||
{{TES5Edit function row|even | {{TES5Edit function row|even | ||
|RemoveByIndex|IwbElement|aeContainer: IwbContainer;<br/> aiIndex: integer | |RemoveByIndex|IwbElement|aeContainer: IwbContainer;<br/> aiIndex: integer;<br/> abMarkModified: boolean | ||
|Removes the ''aiIndex''-th child from ''aeContainer'', and returns it.}} | |Removes the ''aiIndex''-th child from ''aeContainer'', and returns it.}} | ||
{{TES5Edit function row|odd | {{TES5Edit function row|odd | ||
Line 280: | Line 288: | ||
! scope="col" style="background-color: #DDDDDD" | Arguments | ! scope="col" style="background-color: #DDDDDD" | Arguments | ||
! scope="col" style="background-color: #DDDDDD" | Description | ! scope="col" style="background-color: #DDDDDD" | Description | ||
{{TES5Edit function row|even | |||
|BaseRecord|IwbMainRecord|aeRecord: IwbMainRecord | |||
|If ''aeRecord'' is a [[reference]], this function returns the IwbMainRecord of its base form. Otherwise, the function returns ''Nil''.}} | |||
{{TES5Edit function row|odd | |||
|BaseRecordID|cardinal|aeRecord: IwbMainRecord | |||
|Appears to return the load-order-relative form ID of ''aeRecord''.}} | |||
{{TES5Edit function row|even | |||
|ChangeFormSignature||aeRecord: IwbMainRecord;<br/> asNewSignature: string | |||
|Changes ''aeRecord''<nowiki/>'s signature to ''asNewSignature''. No other information is modified.}} | |||
{{TES5Edit function row|odd | |||
|ChildGroup|IwbGroupRecord|aeRecord: IwbMainRecord | |||
|Returns the group that ''aeRecord'' contains, if any. For example, a [[Worldspace|WRLD]] record will be followed by a GRUP containing the worldspace's [[Cell|CELL]]s, and you would use this function to retrieve that group.}} | |||
{{TES5Edit function row|even | |||
|CompareExchangeFormID|boolean|aeRecord: IwbMainRecord;<br/> aiOldFormID: cardinal;<br/> aiNewFormID: cardinal | |||
|Attempts to change ''aeRecord''<nowiki/>'s form ID from ''aiOldFormID'' to ''aiNewFormID'', and returns ''True'' if the operation succeeds.}} | |||
{{TES5Edit function row|odd | |||
|EditorID|string|aeRecord: IwbMainRecord | |||
|Returns the record's editor ID.}} | |||
{{TES5Edit function row|even | |||
|FixedFormID|cardinal|aeRecord: IwbMainRecord | |||
|Returns the local FormID of the record. Local records will not have a load-order prefix (i.e. 0x00FFFFFF), and overrides will have a prefix relative to the record's file's masters. See also: ''FormID'', ''GetLoadOrderFormID''.}} | |||
{{TES5Edit function row|odd | |||
|FormID|cardinal|aeRecord: IwbMainRecord | |||
|Returns the record's form ID. See also: ''FixedFormID'', ''GetLoadOrderFormID''.}} | |||
{{TES5Edit function row|even | |||
|GetFormVCS1|cardinal|aeRecord: IwbMainRecord | |||
|Returns the value of the Version Control Info 1 field. See also: ''SetFormVCS1''.}} | |||
{{TES5Edit function row|odd | |||
|GetFormVCS2|cardinal <!-- even though the field itself is a word -->|aeRecord: IwbMainRecord | |||
|Returns the value of the Version Control Info 2 field. See also: ''SetFormVCS2''.}} | |||
{{TES5Edit function row|even | |||
|GetFormVersion|cardinal|aeRecord: IwbMainRecord | |||
|Unknown. See also: ''SetFormVersion''.}} | |||
{{TES5Edit function row|odd | |||
|GetGridCell|TwbGridCell|aeRecord: IwbMainRecord | |||
|If ''aeRecord'' is an exterior [[cell]], this function will return its grid coordinates as a TwbGridCell; you can access the coordinates by checking <code>returnValue.x</code> and <code>returnValue.y</code>.}} | |||
{{TES5Edit function row|even | |||
|GetIsDeleted|boolean|aeRecord: IwbMainRecord | |||
|Checks the record's "deleted" flag. See also: ''SetIsDeleted''.}} | |||
{{TES5Edit function row|odd | |||
|GetIsInitiallyDisabled|boolean|aeRecord: IwbMainRecord | |||
|Checks the record's "initially disabled" flag. See also: ''SetIsInitiallyDisabled''.}} | |||
{{TES5Edit function row|even | |||
|GetIsPersistent|boolean|aeRecord: IwbMainRecord | |||
|Checks the record's "persistent" flag. See also: ''SetIsPersistent''.}} | |||
{{TES5Edit function row|odd | |||
|GetIsVisibleWhenDistant|boolean|aeRecord: IwbMainRecord | |||
|Checks the record's "visible when distant" flag. See also: ''SetIsVisibleWhenDistant''.}} | |||
{{TES5Edit function row|even | |||
|GetLoadOrderFormID|cardinal|aeRecord: IwbMainRecord | |||
|Returns the record's form ID relative to the current load order. See also: ''FixedFormID'', ''SetLoadOrderFormID''.}} | |||
{{TES5Edit function row|odd | |||
|GetPosition|TwbVector|aeRecord: IwbMainRecord | |||
|If ''aeRecord'' is a [[reference]] (or a subtype, like ACHR), this function will return its position.}} | |||
{{TES5Edit function row|even | |||
|GetRotation|TwbVector|aeRecord: IwbMainRecord | |||
|If ''aeRecord'' is a [[reference]] (or a subtype, like ACHR), this function will return its rotation.}} | |||
{{TES5Edit function row|odd | |||
|HasPrecombinedMesh|boolean|aeRecord: IwbMainRecord | |||
|Checks whether ''aeRecord'' is a Fallout 4 [[reference]] that has precombined mesh data generated. See also: ''PrecombinedMesh''.}} | |||
{{TES5Edit function row|even | |||
|HighestOverrideOrSelf|IwbMainRecord|aeRecord: IwbMainRecord | |||
|See also: ''WinningOverride''.}} | |||
{{TES5Edit function row|odd | |||
|IsMaster|boolean|aeRecord: IwbMainRecord | |||
|Returns ''True'' if ''aeRecord'' is a master, and false if it is an override or not an IwbMainRecord. See also: ''Master'', ''MasterOrSelf''.}} | |||
{{TES5Edit function row|even | |||
|IsWinningOverride|boolean|aeRecord: IwbMainRecord | |||
|Returns ''True'' if ''aeRecord'' is the last loaded override for its master. See also: ''Master'', ''MasterOrSelf''.}} | |||
{{TES5Edit function row|odd | |||
|Master|IwbMainRecord|aeRecord: IwbMainRecord | |||
|}} | |||
{{TES5Edit function row|even | |||
|MasterOrSelf|IwbMainRecord|aeRecord: IwbMainRecord | |||
|If ''aeRecord'' is an override, the function returns the master record that it overrides. Otherwise, the function returns ''aeRecord'' itself. See also: ''IsMaster'', ''IsWinningOverride''.}} | |||
{{TES5Edit function row|odd | |||
|OverrideByIndex|IwbMainRecord|aeRecord: IwbMainRecord;<br/> aiIndex: integer | |||
|Returns the ''aiIndex''-th override of ''aeRecord''.}} | |||
{{TES5Edit function row|even | |||
|OverrideCount|cardinal|aeRecord: IwbMainRecord | |||
|Returns the number of records that override ''aeRecord''.}} | |||
{{TES5Edit function row|odd | |||
|PrecombinedMesh|string|aeRecord: IwbMainRecord | |||
|Returns the path to ''aeRecord''<nowiki/>'s precombined mesh file, if ''aeRecord'' is a Fallout 4 [[reference]] that could have that data (i.e. not a placed actor). See also: ''HasPrecombinedMesh''.}} | |||
{{TES5Edit function row|even | |||
|ReferencedByIndex|IwbMainRecord|aeRecord: IwbMainRecord;<br/> aiIndex: integer | |||
|Returns the ''aiIndex''-th record that references ''aeRecord''.}} | |||
{{TES5Edit function row|odd | |||
|ReferencedByCount|cardinal|aeRecord: IwbMainRecord | |||
|Returns the number of records that refer to ''aeRecord''.}} | |||
{{TES5Edit function row|even | |||
|SetEditorID|string|aeRecord: IwbMainRecord | |||
|Sets the record's editor ID, and then returns it.}} | |||
{{TES5Edit function row|odd | |||
|SetFormVersion||aeRecord: IwbMainRecord;<br/> aiVersion: cardinal | |||
|Unknown. See also: ''GetFormVersion''.}} | |||
{{TES5Edit function row|even | |||
|SetIsDeleted|boolean|aeRecord: IwbMainRecord;<br/> abFlag: boolean | |||
|Modifies the record's "deleted" flag. See also: ''GetIsDeleted''.}} | |||
{{TES5Edit function row|odd | |||
|SetIsInitiallyDisabled|boolean|aeRecord: IwbMainRecord;<br/> abFlag: boolean | |||
|Modifies the record's "initially disabled" flag. See also: ''GetIsInitiallyDisabled''.}} | |||
{{TES5Edit function row|even | |||
|SetIsPersistent|boolean|aeRecord: IwbMainRecord;<br/> abFlag: boolean | |||
|Modifies the record's "persistent" flag. See also: ''GetIsPersistent''.}} | |||
{{TES5Edit function row|odd | |||
|SetIsVisibleWhenDistant|boolean|aeRecord: IwbMainRecord;<br/> abFlag: boolean | |||
|Modifies the record's "visible when distant" flag. See also: ''GetIsVisibleWhenDistant''.}} | |||
{{TES5Edit function row|even | |||
|SetLoadOrderFormID|cardinal|aeRecord: IwbMainRecord;<br/> aiFormID: cardinal; | |||
|Modifies the record's form ID, with the specified ID relative to the current load order. See also: ''GetLoadOrderFormID''.}} | |||
{{TES5Edit function row|odd | |||
|SetFormVCS1||aeRecord: IwbMainRecord;<br/> aiValue: cardinal | |||
|Modifies the Version Control Info 1 field. See also: ''GetFormVCS1''.}} | |||
{{TES5Edit function row|even | |||
|SetFormVCS2||aeRecord: IwbMainRecord;<br/> aiValue: cardinal <!-- even though the field itself is a word --> | |||
|Modifies the Version Control Info 2 field. See also: ''GetFormVCS2''.}} | |||
{{TES5Edit function row|odd | |||
|Signature|string|aeRecord: IwbMainRecord | |||
|Returns the record's signature, a four-character code such as [[ActorBase|NPC_]] or [[Topic|DIAL]].}} | |||
{{TES5Edit function row|even | |||
|UpdateRefs||aeRecord: IwbMainRecord | |||
|Appears to be the same as ''BuildRef'', except that it aborts if references are already in the middle of being built.}} | |||
{{TES5Edit function row|odd | |||
|WinningOverride|IwbMainRecord|aeRecord: IwbMainRecord | |||
|Returns the last loaded override for ''aeRecord''. See also: ''HighestOverrideOrSelf''.}} | |||
|} | |} | ||
Line 292: | Line 426: | ||
|ChildrenOf|IwbMainRecord|aeGroup: IwbGroupRecord | |ChildrenOf|IwbMainRecord|aeGroup: IwbGroupRecord | ||
|If ''aeGroup'' is a child group, this function returns the main record that it is associated with. For example, a [[Topic|Dialogue Topic]] (DIAL) is followed by a group (GRUP) that contains its [[Topic Info|Infos]] (INFO); and passing that GRUP to this function would retrieve the DIAL. [[Cell]]s (CELL) and [[Worldspace]]s (WRLD) have their contents set up similarly to Dialogue Topics, so this function will work with them as well.}} | |If ''aeGroup'' is a child group, this function returns the main record that it is associated with. For example, a [[Topic|Dialogue Topic]] (DIAL) is followed by a group (GRUP) that contains its [[Topic Info|Infos]] (INFO); and passing that GRUP to this function would retrieve the DIAL. [[Cell]]s (CELL) and [[Worldspace]]s (WRLD) have their contents set up similarly to Dialogue Topics, so this function will work with them as well.}} | ||
{{TES5Edit function row| | {{TES5Edit function row|odd | ||
|FindChildGroup|IwbGroupRecord|aeGroup: IwbGroupRecord;<br/>aiType: integer;<br/> aeMainRecord: IwbMainRecord;<br/> | |FindChildGroup|IwbGroupRecord|aeGroup: IwbGroupRecord;<br/>aiType: integer;<br/> aeMainRecord: IwbMainRecord;<br/> | ||
|Unknown.}} | |Unknown. The ''aiType'' value should match the group-type values used in [http://en.uesp.net/wiki/Tes5Mod:Mod_File_Format#Groups the file format]. The "Worldspace browser.pas" script uses <code>FindChildGroup(ChildGroup(cell), 9, cell);</code> to get the "Temporary" group within a CELL.}} | ||
{{TES5Edit function row|even | {{TES5Edit function row|even | ||
|GroupLabel|cardinal|aeGroup: IwbGroupRecord | |GroupLabel|cardinal|aeGroup: IwbGroupRecord | ||
| | |Returns the raw group label, as specified in [http://en.uesp.net/wiki/Tes5Mod:Mod_File_Format#Groups the file format].}} | ||
{{TES5Edit function row| | {{TES5Edit function row|odd | ||
|GroupType|integer|aeGroup: IwbGroupRecord | |GroupType|integer|aeGroup: IwbGroupRecord | ||
| | |Returns the raw group type, as specified in [http://en.uesp.net/wiki/Tes5Mod:Mod_File_Format#Groups the file format].}} | ||
{{TES5Edit function row|even | {{TES5Edit function row|even | ||
|MainRecordByEditorID|IwbMainRecord|aeGroup: IwbGroupRecord;<br/> asEditorID: string | |MainRecordByEditorID|IwbMainRecord|aeGroup: IwbGroupRecord;<br/> asEditorID: string | ||
Line 313: | Line 447: | ||
! scope="col" style="background-color: #DDDDDD" | Arguments | ! scope="col" style="background-color: #DDDDDD" | Arguments | ||
! scope="col" style="background-color: #DDDDDD" | Description | ! scope="col" style="background-color: #DDDDDD" | Description | ||
{{TES5Edit function row|even | |||
|AddMasterIfMissing||aeFile: IwbFile;<br/> asMasterFilename: string | |||
|Adds the specified file as a master for ''aeFile'', if it isn't already a master.}} | |||
{{TES5Edit function row|odd | |||
|CleanMasters||aeFile: IwbFile | |||
|Appears to find unnecessary files in ''aeFile''<nowiki/>'s master list and remove them, updating all form indices accordingly. Don't confuse this within "cleaning master files" as in "removing ITMs and UDRs from official DLCs." This function is used in "Skyrim - Book Covers Patch.pas".}} | |||
{{TES5Edit function row|even | |||
|FileFormIDtoLoadOrderFormID|cardinal|aeFile: IwbFile; aiFormID: cardinal | |||
|Converts ''aiFormID'' from a form ID relative to ''aeFile''<nowiki/>'s master list (like that returned by ''FixedFormID'') to a load-order-relative form ID (like that returned by ''FormID''). See also: ''LoadOrderFormIDtoFileFormID''.}} | |||
{{TES5Edit function row|odd | |||
|FileWriteToStream||aeFile: IwbFile;<br/> akOutStream: TStream | |||
|Writes the contents of ''aeFile'' to ''akOutStream''. Used in "SaveAs.pas" to allow a user to save a loaded file under a new name; that script creates a TFileStream object and uses this function to write to it.}} | |||
{{TES5Edit function row|even | |||
|GetFileName|string|aeFile: IwbFile | |||
|Returns ''aeFile''<nowiki/>'s filename.}} | |||
{{TES5Edit function row|odd | |||
|GetIsESM|boolean|aeFile: IwbFile | |||
|Returns ''True'' if ''aeFile'' is flagged as an ESM. See also: ''SetIsESM''.}} | |||
{{TES5Edit function row|even | |||
|GetLoadOrder|string|aeFile: IwbFile | |||
|Returns ''aeFile''<nowiki/>'s index in the load order, or -1 if called on something that is not an IwbFile.}} | |||
{{TES5Edit function row|odd | |||
|GetNewFormID|cardinal|aeFile: IwbFile | |||
|Returns a new form ID, the same way that <code>Add(..., ..., True)</code> does.}} | |||
{{TES5Edit function row|even | |||
|GroupBySignature|IwbGroupRecord|aeFile: IwbFile;<br/> asSignature: string | |||
|If ''aeFile'' has a top-level group with the specified signature, that group is returned.}} | |||
{{TES5Edit function row|odd | |||
|HasGroup|boolean|aeFile: IwbFile;<br/> asSignature: string | |||
|Returns ''True'' if ''aeFile'' contains a top-level group with the specified signature.}} | |||
{{TES5Edit function row|even | |||
|HasMaster|boolean|aeFile: IwbFile;<br/> asMasterFilename: string | |||
|Returns ''True'' if ''aeFile'' has a file with the name ''asMasterFilename'' as a master.}} | |||
{{TES5Edit function row|odd | |||
|LoadOrderFormIDtoFileFormID|cardinal|aeFile: IwbFile; aiFormID: cardinal | |||
|Converts ''aiFormID'' from a load-order-relative form ID (like that returned by ''FormID'') to a form ID relative to ''aeFile''<nowiki/>'s master list (like that returned by ''FixedFormID''). See also: ''FileFormIDtoLoadOrderFormID''.}} | |||
{{TES5Edit function row|even | |||
|MasterByIndex|IwbFile|aeFile: IwbFile;<br/> aiIndex: integer | |||
|Returns the ''aiIndex''-th master file for ''aeFile''.}} | |||
{{TES5Edit function row|odd | |||
|MasterCount|cardinal|aeFile: IwbFile | |||
|Returns the number of master files that ''aeFile'' has.}} | |||
{{TES5Edit function row|even | |||
|RecordByEditorID|IwbMainRecord|aeFile: IwbFile;<br/> asEditorID: string | |||
|Returns the [[Magic Effect|MGEF]] or [[Setting|GMST]] record in ''aeFile'' that has the specified editor ID. For all other record types, use something like <code>MainRecordByEditorID(GroupBySignature(f, 'ECZN'), 'RandomEncounterZone1')</code>.}} | |||
{{TES5Edit function row|odd | |||
|RecordByFormID|IwbMainRecord|aeFile: IwbFile;<br/> aiFormID: integer;<br/> abAllowInjected: boolean | |||
|Returns the main record in ''aeFile'' that has the specified form ID, or ''Nil'' if no records match. The form ID must be local to the file (see ''FixedFormID'').}} | |||
{{TES5Edit function row|even | |||
|RecordByIndex|IwbMainRecord|aeFile: IwbFile;<br/> aiIndex: integer | |||
|Returns the ''aiIndex''-th record in ''aeFile''.}} | |||
{{TES5Edit function row|odd | |||
|RecordCount|cardinal|aeFile: IwbFile | |||
|Returns the number of records that ''aeFile'' has.}} | |||
{{TES5Edit function row|even | |||
|SetIsESM||aeFile: IwbFile;<br/> abFlag: boolean | |||
|Modifies the ESM flag for ''aeFile''. See also: ''GetIsESM''.}} | |||
{{TES5Edit function row|odd | |||
|SortMasters||aeFile: IwbFile | |||
|Attempts to sort the masters for ''aeFile'' by their place in the current load order.}} | |||
|} | |} | ||
==== IwbResource ==== | ==== IwbResource ==== | ||
These functions are used in "Assets browser.pas", "Assets manager.pas", and "Skyrim - List used scripts.pas". | |||
{| class="wikitable" style="background-color: #AAAAAA; cellpadding: 0" | {| class="wikitable" style="background-color: #AAAAAA; cellpadding: 0" | ||
|- align="left" | |- align="left" | ||
Line 322: | Line 518: | ||
! scope="col" style="background-color: #DDDDDD" | Arguments | ! scope="col" style="background-color: #DDDDDD" | Arguments | ||
! scope="col" style="background-color: #DDDDDD" | Description | ! scope="col" style="background-color: #DDDDDD" | Description | ||
{{TES5Edit function row|even | |||
|ResourceContainerList||akContainers: TwbFastStringList | |||
|Fills ''akContainers'' with the full filenames (directory + name) of all loaded BSA and BA2 files, as well as the name of the Data directory. ''akContainers'' can be a TwbFastStringList or a TStringList.}} | |||
{{TES5Edit function row|odd | |||
|ResourceCopy||asContainerName: string;<br/> asFilename: string;<br/> asPathOut: string | |||
|Retrieves the resource named ''asFilename'' from the resource container named ''asContainerName'' (see ''ResourceContainerList''), and saves that resource to the specified file path ''asPathOut''. The "Assets browser.pas" script uses this to let users extract a resource from a BSA/BA2.}} | |||
{{TES5Edit function row|even | |||
|ResourceCount|cardinal|asFilename: string;<br/> akContainers: TStrings | |||
|Fills ''akContainers'' with a list of the loaded containers (BSA, BA2, Data directory) that a file named ''asFilename'' appears in. The "Assets browser.pas" script uses this to allow users to decide which version of a file to view, when the file is overridden at least once within their load order.}} | |||
{{TES5Edit function row|odd | |||
|ResourceExists|boolean|asFilename: string | |||
|Checks whether any loaded container has a file with the specified name.}} | |||
{{TES5Edit function row|even | |||
|ResourceList||asContainerName: string;<br/> akContainers: TStrings | |||
|Accesses the container with the full filename ''asContainerName'' (see ''ResourceContainerList''), and adds a list of all contained filenames to ''akContainers''. Note that added entries are unsorted, and there may be duplicates among them.}} | |||
{{TES5Edit function row|odd | |||
|ResourceOpenData|TBytesStream|asContainerName: string;<br/> asFilename: string | |||
|''asFilename'' should be formatted similar to the other Resource-oriented xEdit scripts. ''asContainerName'' should be filled with a string generated by the function ''ResourceContainerList''. The ''ResourceOpenData'' function should only be used in conjunction with ''NifTextureList'', as ''ResourceCopy'' removes any other need for this function.}} | |||
|} | |} | ||
Line 331: | Line 545: | ||
! scope="col" style="background-color: #DDDDDD" | Arguments | ! scope="col" style="background-color: #DDDDDD" | Arguments | ||
! scope="col" style="background-color: #DDDDDD" | Description | ! scope="col" style="background-color: #DDDDDD" | Description | ||
{{TES5Edit function row|even | |||
|LocalizationGetStringsFromFile||asFilename: string;<br/> akListOut: TStrings | |||
|}} | |||
{{TES5Edit function row|odd | |||
|wbAlphaBlend|boolean|akDestinationDeviceContext: unknown;<br/> aiDestinationX: integer;<br/> aiDestinationY: integer;<br/> aiDestinationWidth: integer;<br/> aiDestinationHeight: integer;<br/> akSourceDeviceContext: unknown;<br/> aiSourceX: integer;<br/> aiSourceY: integer;<br/> aiSourceWidth: integer;<br/> aiSourceHeight: integer;<br/> aiAlpha: integer | |||
|A wrapper for ''Windows.AlphaBlend'' which returns its result.}} | |||
{{TES5Edit function row|even | |||
|wbBlockFromSubBlock|TwbGridCell|akSubBlock: TwbGridCell | |||
|See also: ''wbPositionToGridCell'', ''wbSubBlockFromGridCell'', ''wbGridCellToGroupLabel'', ''wbIsInGridCell''.}} | |||
{{TES5Edit function row|odd | |||
|wbCRC32Data|cardinal|akData: TBytes | |||
|See also: ''wbCRC32File'', ''wbSHA1Data'', ''wbSHA1File'', ''wbMD5Data'', ''wbMD5File''.}} | |||
{{TES5Edit function row|even | |||
|wbCRC32File|cardinal|asFilename: string | |||
|See also: ''wbCRC32Data'', ''wbSHA1Data'', ''wbSHA1File'', ''wbMD5Data'', ''wbMD5File''.}} | |||
{{TES5Edit function row|odd | |||
|wbCRC32Resource|cardinal|asContainerName: string; asFileName: string | |||
|}} | |||
{{TES5Edit function row|even | |||
|wbFindREFRsByBase||aeREFR: IwbMainRecord;<br/> asSignatures: string;<br/> aiFlags: integer;<br/> akOutList: TList | |||
|Searches for sibling records to ''aeREFR'' whose base records' signatures match ''asSignatures'', and adds them to ''akOutList''. Further filtering can be done with ''aiFlags'': specify 1 to exclude deleted references, 2 to exclude initially disabled references, and 4 to exclude references that have an enable parent.}} | |||
{{TES5Edit function row|odd | |||
|wbFlipBitmap||akBitmap: TBitmap;<br/> aiAxes: integer | |||
|Flips the image data contained in ''akBitmap'' based on the specified axes. Specify 1 to flip horizontally, 2 to flip vertically, or 0 to flip on both axes.}} | |||
{{TES5Edit function row|even | |||
|wbGetSiblingRecords||aeRecord: IwbElement;<br/> asSignatures: string;<br/> abIncludeOverrides: boolean;<br/> akOutList: TList | |||
|Adds sibling records of ''aeRecord'' to ''akOutList'' if their signatures match ''asSignatures''. If ''abIncludeOverrides'' is not ''True'', then overrides will not be included in the result.}} | |||
{{TES5Edit function row|odd | |||
|wbGridCellToGroupLabel|cardinal|akGridCell: TwbGridCell | |||
|Returns an integer of the format 0xXXXXYYYY. See also: ''wbBlockFromSubBlock'', ''wbPositionToGridCell'', ''wbIsInGridCell'', ''wbSubBlockFromGridCell''.}} | |||
{{TES5Edit function row|even | |||
|wbIsInGridCell|boolean|akPosition: TwbVector;<br/> akGridCell: TwbGridCell | |||
|See also: ''wbBlockFromSubBlock'', ''wbGridCellToGroupLabel'', ''wbPositionToGridCell'', ''wbSubBlockFromGridCell''.}} | |||
{{TES5Edit function row|odd | |||
|wbMD5Data|cardinal|akData: TBytes | |||
|See also: ''wbCRC32Data'', ''wbCRC32File'', ''wbMD5File'', ''SHA1Data'', ''wbSH1Data''.}} | |||
{{TES5Edit function row|even | |||
|wbMD5File|cardinal|asFilename: string | |||
|Calculation time is about 2.5 times longer than CRC32. See also: ''wbCRC32Data'', ''wbCRC32File'', ''wbMD5Data'', ''SHA1Data'', ''wbSH1Data''.}} | |||
{{TES5Edit function row|odd | |||
|wbNormalizeResourceName|string|asResourceName: string; akResourceType: TGameResourceType | |||
|''akResourceType'' can be any of the following values: ''resMesh'', ''resTexture'', ''resSound'', ''resMusic''.}} | |||
{{TES5Edit function row|even | |||
|wbPositionToGridCell|TwbGridCell|akPosition: TwbVector | |||
|Converts ''akPosition'' to grid coordinates. In practice, this is done by dividing the physical coordinates by 4096, the lateral length and width of a cell. See also: ''wbBlockFromSubBlock'', ''wbGridCellToGroupLabel'', ''wbIsInGridCell'', ''wbSubBlockFromGridCell''.}} | |||
{{TES5Edit function row|odd | |||
|wbSHA1Data|cardinal|akData: TBytes | |||
|See also: ''wbCRC32Data'', ''wbCRC32File'', ''SHA1File'', ''wbMD5Data'', ''wbMD5File''.}} | |||
{{TES5Edit function row|even | |||
|wbSHA1File|cardinal|asFilename: string | |||
|Calculation time is about two times longer than CRC32. See also: ''wbCRC32Data'', ''wbCRC32File'', ''SHA1Data'', ''wbMD5Data'', ''wbMD5File''.}} | |||
{{TES5Edit function row|odd | |||
|wbStringListInString|integer|akList: TStringList; asSubstring: string | |||
|Checks if any of the strings in ''akList'' contains ''asSubstring''. Returns the index of the first matching entry, or -1. Checks are case-insensitive.}} | |||
{{TES5Edit function row|even | |||
|wbSubBlockFromGridCell|TwbGridCell|akGridCell: TwbGridCell | |||
|See also: ''wbBlockFromSubBlock'', ''wbGridCellToGroupLabel'', ''wbIsInGridCell'', ''wbPositionToGridCell''.}} | |||
|} | |} | ||
Line 340: | Line 611: | ||
! scope="col" style="background-color: #DDDDDD" | Arguments | ! scope="col" style="background-color: #DDDDDD" | Arguments | ||
! scope="col" style="background-color: #DDDDDD" | Description | ! scope="col" style="background-color: #DDDDDD" | Description | ||
{{TES5Edit function row|even | |||
|NifBlockList|boolean|akData: TBytes;<br/> akListOut: TStrings | |||
|Retrieves block information from the NIF file in ''akData'', and adds it to ''akListOut''. Each added index in ''akListOut'' will match up with a string key of the form "BlockName{{=}}BlockType" and (as an object) a pointer to the NIF block's index number. Returns ''True'' if the operation succeeded.}} | |||
{{TES5Edit function row|odd | |||
|NifTextureList|boolean|akData: TBytes;<br/> akListOut: TStrings | |||
|Searches the NIF file in ''akData'' for all texture paths, and adds them to ''akListOut''. Returns ''True'' if the operation succeeded.}} | |||
{{TES5Edit function row|even | |||
|NifTextureListResource|boolean|akData: variant;<br/> akListOut: TStrings | |||
|Searches the NIF file in ''akData'' for all texture paths, and adds them to ''akListOut''. Returns ''True'' if the operation succeeded.}} | |||
{{TES5Edit function row|odd | |||
|NifTextureListUVRange|boolean|akData: TBytes;<br/> afUVRange: Single;<br/> akListOut: TStrings | |||
|Searches the NIF file in ''akData'' for all texture paths, and adds them to ''akListOut''. Textures are only added if none of the relevant NiTriShape's UV sets have UVs greater than ''afUVRange'' or less than ''-afUVRange''. Returns ''True'' if the operation succeeded.}} | |||
|} | |} | ||
Line 350: | Line 633: | ||
! scope="col" style="background-color: #DDDDDD" | Description | ! scope="col" style="background-color: #DDDDDD" | Description | ||
{{TES5Edit function row|even | {{TES5Edit function row|even | ||
|wbDDSStreamToBitmap| | |wbDDSStreamToBitmap|boolean|akStream: TStream;<br/> akBitmapOut: TBitmap | ||
| | |Modifies ''akBitmapOut'' to contain the DDS information sourced from ''akStream''. Returns ''True'' if the operation succeeds.}} | ||
{{TES5Edit function row| | {{TES5Edit function row|odd | ||
|wbDDSDataToBitmap| | |wbDDSDataToBitmap|boolean|akData: TBytes;<br/> akBitmapOut: TBitmap | ||
| | |Modifies ''akBitmapOut'' to contain the DDS information sourced from ''akData''. Returns ''True'' if the operation succeeds.}} | ||
{{TES5Edit function row|even | {{TES5Edit function row|even | ||
|wbDDSResourceToBitmap| | |wbDDSResourceToBitmap|boolean|akUnknown;<br/> akBitmapOut: TBitmap | ||
| | |Modifies ''akBitmapOut'' to contain the DDS information sourced from the resource ''akUnknown''. Returns ''True'' if the operation succeeds.}} | ||
|} | |} |
Latest revision as of 20:01, 7 May 2017
TES5Edit Scripting Functions[edit | edit source]
xEdit scripts only have access to a generic type called IInterface, which wraps around every object that xEdit returns. However, different types are used internally to classify different objects. To illustrate this with an example: files are coded as IwbFile objects, while forms are coded as IwbMainRecord objects. However, an xEdit script will only ever see IInterface objects, and any IInterface can be a IwbFile or an IwbMainRecord. Functions like GetIsESM can be called on any IInterface, but are designed to work with IwbFiles and will not produce a meaningful result for other types (i.e. GetIsESM would always return false for any other type).
The functions below are sorted by the internal types that they operate on. This is to make it easier to find certain functions and to make this page easier to maintain (because frankly, fixing up row colors on a massive table is just a big disincentive to even editing the page).
The relationships between internal types are as follows:
IwbElement └ IwbContainerBase ├ IwbContainer │ ├ IwbDataContainer │ │ ├ IwbFileHeader │ │ └ IwbRecord │ │ ├ IwbGroupRecord │ │ ├ IwbMainRecord │ │ └ IwbSubRecord │ │ │ └ IwbFile │ └ IwbContainerElementRef IwbResource IwbResourceContainer │ IwbBA2File │ IwbBSAFile └ IwbFolder Misc functions └ DDS └ NIF
Global functions[edit | edit source]
These functions can be called on anything and should return a meaningful result.
Function | Returns | Arguments | Description |
---|---|---|---|
Assigned | boolean | aeElement: IwbElement | An extension to Delphi's native Assigned function: returns true if aeElement is not Nil, and returns false otherwise. |
ObjectToElement | IInterface | akObject | If you have stored an IInterface inside of a TList or TStringList, you must call this function when retrieving the object from the list, i.e. ObjectToElement(myList.Items[0]) .
|
FullPathToFilename | string | asFilename: string | Returns the full path to the filename asFilename. |
EnableSkyrimSaveFormat | As of xEdit 3.1.2, calling this function will corrupt saved plugins until xEdit is restarted. | ||
GetRecordDefNames | akList: TStrings | Unverified: Modifies akList by adding entries based on the contents of the global wbRecordDefs. | |
wbFilterStrings | akListIn: TStrings; akListOut: TStrings; asFilter: String |
Modifies akListOut, adding every entry in akListIn that contains the substring asFilter. | |
wbRemoveDuplicateStrings | akList: TStringList | Modifies akList, removing any duplicate entries that it contains. |
IwbElement[edit | edit source]
These functions can be called on any IwbElement IInterface.
Function | Returns | Arguments | Description |
---|---|---|---|
BaseName | string | aeElement: IwbElement | Identical to Name except that it handles IwbFiles differently. Name will prepend a load order index (i.e. [02] PluginName.esp ), while BaseName will not.
|
BuildRef | aeElement: IwbElement | Builds reference information for the element and all of its descendants. Note that this function will run even if reference information has already been built. | |
CanContainFormIDs | boolean | aeElement: IwbElement | Guaranteed to return True if the element can contain form IDs, but not guaranteed to return False if it can't. This accesses an internal property, CanContainFormIDs, which the internal implementation of BuildRef uses to skip processing certain descendant elements. |
CanMoveDown | boolean | aeElement: IwbElement | Returns true if the element is part of an array and can be moved further down using MoveDown. |
CanMoveUp | boolean | aeElement: IwbElement | Returns true if the element is part of an array and can be moved further up using MoveUp. |
Check | string | aeElement: IwbElement | Returns the error message produced when the "Check for Errors" functionality is run on aeElement; or else an empty string if no error is found. |
ClearElementState | aeElement: IwbElement; aiState: TwbElementState |
Manipulates the internal flags of an element, e.g. ClearElementState(eElement, esModified); . See also: GetElementState, SetElementState.
| |
DefType | TwbDefType | aeElement: IwbElement | Returns the def-type of the element. |
DisplayName | string | aeElement: IwbElement | Returns the display name of the element, if it has one; otherwise, this behaves identically to Name. See also: BaseName, ShortName. |
ElementAssign | IwbElement | aeContainer: IwbContainer; aiIndex: integer; aeSource: IwbElement; abOnlySK: boolean |
Copy the contents of one element into a container element, or create and append an element to a container.
Sample: there is a script to copy VMAD subrecords "Skyrim - Copy VMAD subrecord.pas" |
ElementType | TwbElementType | aeElement: IwbElement | Returns the type of the element. This is one of the following values: etFile, etMainRecord, etGroupRecord, etSubRecord, etSubRecordStruct, etSubRecordArray, etSubRecordUnion, etArray, etStruct, etValue, etFlag, etStringListTerminator,etUnion, etStructChapter. |
EnumValues | string | aeElement: IwbElement | If aeElement is a set of named enum values, this function returns the names of any values that have been set, separated with spaces. |
Equals | boolean | aeElement1: IwbElement; aeElement2: IwbElement |
Compares two elements by their ElementID. This is sometimes necessary, as different IInterface variables pointing to the same element don't always compare properly when using the = operator.
|
FlagValues | string | aeElement: IwbElement | If aeElement is a set of flags, this function returns the names of all set flags, separated with spaces. |
FullPath | string | aeElement: IwbElement | Returns the full path to the element, going all the way down to its containing file. See also: Path, PathName. |
GetContainer | IwbContainer | aeElement: IwbElement | Returns the element's container. |
GetContainingMainRecord | IwbMainRecord | aeElement: IwbElement | Returns the main record that contains the element. |
GetEditValue | string | aeElement: IwbElement | Returns a string representation of the element's value. See also: SetEditValue, GetElementEditValues, SetElementEditValues. |
GetElementState | TwbElementState | aeElement: IwbElement; aiState: TwbElementState |
Checks the internal flags of an element. See also: ClearElementState, SetElementState. |
GetFile | IwbFile | aeElement: IwbElement | Returns the file that contains the element. |
GetNativeValue | variant | aeElement: IwbElement | Returns the element's value. See also: SetNativeValue, GetElementNativeValues, SetElementNativeValues. |
IsEditable | boolean | aeElement: IwbElement | Returns true if the record can be edited. In some cases, xEdit will block edits to files like Skyrim.esm. |
IsInjected | boolean | aeElement: IwbElement | Returns true if the element is an injected record. |
LinksTo | IwbElement | aeElement: IwbElement | Obtains the referenced element. Not to be confused with ReferencedBy Elements. Call this function on any container element (etSubRecord) to get the iwbMainRecord of that form. (Ex: Calling LinksTo() on any 'LNAM - FormID' subRecord found in a FormID List will return the IwbMainRecord of that record). |
MarkModifiedRecursive | aeElement: IwbElement | Presumably marks the element and all of its descendants as modified. | |
MoveDown | aeElement: IwbElement | If the element is part of an array, this function moves it down by one slot. See also: CanMoveDown. | |
MoveUp | aeElement: IwbElement | If the element is part of an array, this function moves it up by one slot. See also: CanMoveUp. | |
Name | string | aeElement: IwbElement | Returns the name of the element, if it has one. If aeElement is an IwbFile or certain kinds of IwbMainRecords, Name will return a "pretty" name, while BaseName or ShortName will return a more basic string. See also: DisplayName. |
Path | string | aeElement: IwbElement | Returns the path component of aeElement -- that is, one single piece of the path that FullPath would return. You could use this when manually constructing a path to supply to ElementByPath. See also (and don't confuse with): FullPath, PathName. |
PathName | string | aeElement: IwbElement | Similar to FullPath except that names in the path are prefixed with brackets, to uniquely identify each element's unique position among its siblings (see IndexOf).
Example: |
Remove | aeElement: IwbElement | Removes the element from its file. | |
ReportRequiredMasters | aeElement: IwbElement; akListOut: TStrings; akUnknown1: boolean; akUnknown2: boolean |
Checks which master files aeElement depends on, and adds their filenames to akListOut. The boolean arguments' purposes are unknown, but the "Report masters.pas" script passes False for both. | |
SetEditValue | string | aeElement: IwbElement; asValue: string |
Sets the element's value to one that matches the string representation passed in. See also: GetEditValue, GetElementEditValues, SetElementEditValues. |
SetElementState | TwbElementState | aeElement: IwbElement; aiState: TwbElementState |
Manipulates the internal flags of an element. Returns the value prior to modification. See also: ClearElementState, GetElementState. |
SetNativeValue | string | aeElement: IwbElement; avValue: variant |
Sets the element's value. See also: GetNativeValue, GetElementNativeValues, SetElementNativeValues. |
SetToDefault | aeElement: IwbElement | Unknown. Introduced in xEdit 3.1.3. | |
ShortName | string | aeElement: IwbElement | Generally the same as Name unless aeElement is a reference, cell, or similar record. Name will return detailed information for those records, while ShortName will return the signature and form ID in the format [XXXX:01234567] .
|
SortKey | string | aeElement: IwbElement | Returns a string unique to the element entered. This can be used for sorting elements or for comparing them; for example, you could compare the SortKey for two elements in records which override each other to see if they are different from each other. |
wbCopyElementToFile | IwbElement | aeElement: IwbElement; aeFile: IwbFile; abAsNew: boolean; abDeepCopy: boolean |
Copies an IwbMainRecord, IwbGroupRecord, or IwbContainer to the specified file. The abAsNew boolean controls whether or not you're copying the record as an override record. Returns the copied element. |
wbCopyElementToFileWithPrefix | IwbElement | aeElement: IwbElement; aeFile: IwbFile; abAsNew: boolean; abDeepCopy: boolean; akUnknown; akUnknown; akUnknown |
Details unknown. Returns the copied element. |
wbCopyElementToRecord | IwbElement | aeElement: IwbElement; aeRecord: IwbMainRecord; abAsNew: boolean; abDeepCopy: boolean |
Copies an element to a record, e.g. the "Conditions" element on a COBJ record or a faction from an NPC_ record. Returns the copied element. |
IwbContainer[edit | edit source]
Function | Returns | Arguments | Description |
---|---|---|---|
Add | IwbElement | aeContainer: IwbContainer; asNameOrSignature: string; abSilent: boolean |
Creates a child element with the name-or-signature asNameOrSignature in aeContainer if no such child already exists; otherwise, marks the existing child as modified. Returns the created or existing element. |
AddElement | aeContainer: IwbContainer; aeElement: IwbElement |
Adds aeElement as a child of aeContainer. Throws an error if aeElement already has a container. | |
AdditionalElementCount | integer | aeContainer: IwbContainer | Unknown. This getter accesses an internal function used internally for imposing some order on the sub-elements; it checks whether this element "counts," and if so, how many times. Seems to return 1 or 2 for (main?) records, and 0 for record fields (sub-records). |
ContainerStates | byte | aeContainer: IwbContainer | Returns the internal container flags for aeContainer (e.g. whether it's initialized, or whether it has had references built) as a bitmask. Refer to "Worldspace browser.pas" for a usage example. |
ElementByIndex | IwbElement | aeContainer: IwbContainer; aiIndex: integer |
Returns the aiIndex-th child element in aeContainer. See also: ElementCount. |
ElementByName | IwbElement | aeContainer: IwbContainer; asName: string |
Searches aeContainer for the child element with name asName, and returns the found element or Nil. See also: ElementExists. |
ElementByPath | IwbElement | aeContainer: IwbContainer; asPath: string |
Searches aeContainer for the descendant element specified by path asPath, and returns the found element or Nil. |
ElementBySignature | IwbElement | aeContainer: IwbContainer; asSignature: string |
Searches aeContainer for the child element with signature asSignature, and returns the found element or Nil. |
ElementCount | integer | aeContainer: IwbContainer | Returns the number of child elements in aeContainer. See also: ElementByIndex. |
ElementExists | boolean | aeContainer: IwbContainer; asName: string |
Returns true if aeContainer as a child element whose name is asName. See also: ElementByName. |
GetElementEditValues | string | aeContainer: IwbContainer; asPath: string |
Finds the element within aeContainer specified by asPath, and returns a string representation of its value. |
GetElementNativeValues | variant | aeContainer: IwbContainer; asPath: string |
Finds the element within aeContainer specified by asPath, and returns its value. |
IndexOf | integer | aeContainer: IwbContainer; aeChild: IwbElement |
Returns the index of aeChild in aeContainer, or -1 if aeChild is not a child element of aeContainer. |
InsertElement | aeContainer: IwbContainer; aiPosition: Integer; aeElement: IwbElement |
Inserts aeElement as a child of aeContainer at the specified position. | |
IsSorted | boolean | aeContainer: IwbSortableContainer | Checks whether xEdit always keeps aeContainer sorted. If so, this function will return True, and calling CanMoveUp and CanMoveDown on child elements will always return False. |
LastElement | IwbElement | aeContainer: IwbContainer | Returns the last child element in aeContainer, or Nil if there are no child elements. |
RemoveByIndex | IwbElement | aeContainer: IwbContainer; aiIndex: integer; abMarkModified: boolean |
Removes the aiIndex-th child from aeContainer, and returns it. |
RemoveElement | IwbElement | aeContainer: IwbContainer; avChild: variant |
Removes avChild from aeContainer and returns the removed element. The avChild argument can be: the index of an element to remove from an array container; the name or signature of an element to remove; or an IwbElement to remove. |
ReverseElements | aeContainer: IwbContainer | Reverses the order of the child elements in aeContainer. | |
SetElementEditValues | aeContainer: IwbContainer; asPath: string; asValue: string |
Finds the element within aeContainer specified by asPath, and sets its value based on the string representation asValue. | |
SetElementNativeValues | aeContainer: IwbContainer; asPath: string; avValue: variant |
Finds the element within aeContainer specified by asPath, and sets its value to asValue. |
IwbMainRecord[edit | edit source]
Function | Returns | Arguments | Description |
---|---|---|---|
BaseRecord | IwbMainRecord | aeRecord: IwbMainRecord | If aeRecord is a reference, this function returns the IwbMainRecord of its base form. Otherwise, the function returns Nil. |
BaseRecordID | cardinal | aeRecord: IwbMainRecord | Appears to return the load-order-relative form ID of aeRecord. |
ChangeFormSignature | aeRecord: IwbMainRecord; asNewSignature: string |
Changes aeRecord's signature to asNewSignature. No other information is modified. | |
ChildGroup | IwbGroupRecord | aeRecord: IwbMainRecord | Returns the group that aeRecord contains, if any. For example, a WRLD record will be followed by a GRUP containing the worldspace's CELLs, and you would use this function to retrieve that group. |
CompareExchangeFormID | boolean | aeRecord: IwbMainRecord; aiOldFormID: cardinal; aiNewFormID: cardinal |
Attempts to change aeRecord's form ID from aiOldFormID to aiNewFormID, and returns True if the operation succeeds. |
EditorID | string | aeRecord: IwbMainRecord | Returns the record's editor ID. |
FixedFormID | cardinal | aeRecord: IwbMainRecord | Returns the local FormID of the record. Local records will not have a load-order prefix (i.e. 0x00FFFFFF), and overrides will have a prefix relative to the record's file's masters. See also: FormID, GetLoadOrderFormID. |
FormID | cardinal | aeRecord: IwbMainRecord | Returns the record's form ID. See also: FixedFormID, GetLoadOrderFormID. |
GetFormVCS1 | cardinal | aeRecord: IwbMainRecord | Returns the value of the Version Control Info 1 field. See also: SetFormVCS1. |
GetFormVCS2 | cardinal | aeRecord: IwbMainRecord | Returns the value of the Version Control Info 2 field. See also: SetFormVCS2. |
GetFormVersion | cardinal | aeRecord: IwbMainRecord | Unknown. See also: SetFormVersion. |
GetGridCell | TwbGridCell | aeRecord: IwbMainRecord | If aeRecord is an exterior cell, this function will return its grid coordinates as a TwbGridCell; you can access the coordinates by checking returnValue.x and returnValue.y .
|
GetIsDeleted | boolean | aeRecord: IwbMainRecord | Checks the record's "deleted" flag. See also: SetIsDeleted. |
GetIsInitiallyDisabled | boolean | aeRecord: IwbMainRecord | Checks the record's "initially disabled" flag. See also: SetIsInitiallyDisabled. |
GetIsPersistent | boolean | aeRecord: IwbMainRecord | Checks the record's "persistent" flag. See also: SetIsPersistent. |
GetIsVisibleWhenDistant | boolean | aeRecord: IwbMainRecord | Checks the record's "visible when distant" flag. See also: SetIsVisibleWhenDistant. |
GetLoadOrderFormID | cardinal | aeRecord: IwbMainRecord | Returns the record's form ID relative to the current load order. See also: FixedFormID, SetLoadOrderFormID. |
GetPosition | TwbVector | aeRecord: IwbMainRecord | If aeRecord is a reference (or a subtype, like ACHR), this function will return its position. |
GetRotation | TwbVector | aeRecord: IwbMainRecord | If aeRecord is a reference (or a subtype, like ACHR), this function will return its rotation. |
HasPrecombinedMesh | boolean | aeRecord: IwbMainRecord | Checks whether aeRecord is a Fallout 4 reference that has precombined mesh data generated. See also: PrecombinedMesh. |
HighestOverrideOrSelf | IwbMainRecord | aeRecord: IwbMainRecord | See also: WinningOverride. |
IsMaster | boolean | aeRecord: IwbMainRecord | Returns True if aeRecord is a master, and false if it is an override or not an IwbMainRecord. See also: Master, MasterOrSelf. |
IsWinningOverride | boolean | aeRecord: IwbMainRecord | Returns True if aeRecord is the last loaded override for its master. See also: Master, MasterOrSelf. |
Master | IwbMainRecord | aeRecord: IwbMainRecord | |
MasterOrSelf | IwbMainRecord | aeRecord: IwbMainRecord | If aeRecord is an override, the function returns the master record that it overrides. Otherwise, the function returns aeRecord itself. See also: IsMaster, IsWinningOverride. |
OverrideByIndex | IwbMainRecord | aeRecord: IwbMainRecord; aiIndex: integer |
Returns the aiIndex-th override of aeRecord. |
OverrideCount | cardinal | aeRecord: IwbMainRecord | Returns the number of records that override aeRecord. |
PrecombinedMesh | string | aeRecord: IwbMainRecord | Returns the path to aeRecord's precombined mesh file, if aeRecord is a Fallout 4 reference that could have that data (i.e. not a placed actor). See also: HasPrecombinedMesh. |
ReferencedByIndex | IwbMainRecord | aeRecord: IwbMainRecord; aiIndex: integer |
Returns the aiIndex-th record that references aeRecord. |
ReferencedByCount | cardinal | aeRecord: IwbMainRecord | Returns the number of records that refer to aeRecord. |
SetEditorID | string | aeRecord: IwbMainRecord | Sets the record's editor ID, and then returns it. |
SetFormVersion | aeRecord: IwbMainRecord; aiVersion: cardinal |
Unknown. See also: GetFormVersion. | |
SetIsDeleted | boolean | aeRecord: IwbMainRecord; abFlag: boolean |
Modifies the record's "deleted" flag. See also: GetIsDeleted. |
SetIsInitiallyDisabled | boolean | aeRecord: IwbMainRecord; abFlag: boolean |
Modifies the record's "initially disabled" flag. See also: GetIsInitiallyDisabled. |
SetIsPersistent | boolean | aeRecord: IwbMainRecord; abFlag: boolean |
Modifies the record's "persistent" flag. See also: GetIsPersistent. |
SetIsVisibleWhenDistant | boolean | aeRecord: IwbMainRecord; abFlag: boolean |
Modifies the record's "visible when distant" flag. See also: GetIsVisibleWhenDistant. |
SetLoadOrderFormID | cardinal | aeRecord: IwbMainRecord; aiFormID: cardinal; |
Modifies the record's form ID, with the specified ID relative to the current load order. See also: GetLoadOrderFormID. |
SetFormVCS1 | aeRecord: IwbMainRecord; aiValue: cardinal |
Modifies the Version Control Info 1 field. See also: GetFormVCS1. | |
SetFormVCS2 | aeRecord: IwbMainRecord; aiValue: cardinal |
Modifies the Version Control Info 2 field. See also: GetFormVCS2. | |
Signature | string | aeRecord: IwbMainRecord | Returns the record's signature, a four-character code such as NPC_ or DIAL. |
UpdateRefs | aeRecord: IwbMainRecord | Appears to be the same as BuildRef, except that it aborts if references are already in the middle of being built. | |
WinningOverride | IwbMainRecord | aeRecord: IwbMainRecord | Returns the last loaded override for aeRecord. See also: HighestOverrideOrSelf. |
IwbGroupRecord[edit | edit source]
Function | Returns | Arguments | Description |
---|---|---|---|
ChildrenOf | IwbMainRecord | aeGroup: IwbGroupRecord | If aeGroup is a child group, this function returns the main record that it is associated with. For example, a Dialogue Topic (DIAL) is followed by a group (GRUP) that contains its Infos (INFO); and passing that GRUP to this function would retrieve the DIAL. Cells (CELL) and Worldspaces (WRLD) have their contents set up similarly to Dialogue Topics, so this function will work with them as well. |
FindChildGroup | IwbGroupRecord | aeGroup: IwbGroupRecord; aiType: integer; aeMainRecord: IwbMainRecord; |
Unknown. The aiType value should match the group-type values used in the file format. The "Worldspace browser.pas" script uses FindChildGroup(ChildGroup(cell), 9, cell); to get the "Temporary" group within a CELL.
|
GroupLabel | cardinal | aeGroup: IwbGroupRecord | Returns the raw group label, as specified in the file format. |
GroupType | integer | aeGroup: IwbGroupRecord | Returns the raw group type, as specified in the file format. |
MainRecordByEditorID | IwbMainRecord | aeGroup: IwbGroupRecord; asEditorID: string |
Searches aeGroup for a main record whose editor ID is asEditorID and returns the matching record or Nil. This is not a performant function. |
IwbFile[edit | edit source]
Function | Returns | Arguments | Description |
---|---|---|---|
AddMasterIfMissing | aeFile: IwbFile; asMasterFilename: string |
Adds the specified file as a master for aeFile, if it isn't already a master. | |
CleanMasters | aeFile: IwbFile | Appears to find unnecessary files in aeFile's master list and remove them, updating all form indices accordingly. Don't confuse this within "cleaning master files" as in "removing ITMs and UDRs from official DLCs." This function is used in "Skyrim - Book Covers Patch.pas". | |
FileFormIDtoLoadOrderFormID | cardinal | aeFile: IwbFile; aiFormID: cardinal | Converts aiFormID from a form ID relative to aeFile's master list (like that returned by FixedFormID) to a load-order-relative form ID (like that returned by FormID). See also: LoadOrderFormIDtoFileFormID. |
FileWriteToStream | aeFile: IwbFile; akOutStream: TStream |
Writes the contents of aeFile to akOutStream. Used in "SaveAs.pas" to allow a user to save a loaded file under a new name; that script creates a TFileStream object and uses this function to write to it. | |
GetFileName | string | aeFile: IwbFile | Returns aeFile's filename. |
GetIsESM | boolean | aeFile: IwbFile | Returns True if aeFile is flagged as an ESM. See also: SetIsESM. |
GetLoadOrder | string | aeFile: IwbFile | Returns aeFile's index in the load order, or -1 if called on something that is not an IwbFile. |
GetNewFormID | cardinal | aeFile: IwbFile | Returns a new form ID, the same way that Add(..., ..., True) does.
|
GroupBySignature | IwbGroupRecord | aeFile: IwbFile; asSignature: string |
If aeFile has a top-level group with the specified signature, that group is returned. |
HasGroup | boolean | aeFile: IwbFile; asSignature: string |
Returns True if aeFile contains a top-level group with the specified signature. |
HasMaster | boolean | aeFile: IwbFile; asMasterFilename: string |
Returns True if aeFile has a file with the name asMasterFilename as a master. |
LoadOrderFormIDtoFileFormID | cardinal | aeFile: IwbFile; aiFormID: cardinal | Converts aiFormID from a load-order-relative form ID (like that returned by FormID) to a form ID relative to aeFile's master list (like that returned by FixedFormID). See also: FileFormIDtoLoadOrderFormID. |
MasterByIndex | IwbFile | aeFile: IwbFile; aiIndex: integer |
Returns the aiIndex-th master file for aeFile. |
MasterCount | cardinal | aeFile: IwbFile | Returns the number of master files that aeFile has. |
RecordByEditorID | IwbMainRecord | aeFile: IwbFile; asEditorID: string |
Returns the MGEF or GMST record in aeFile that has the specified editor ID. For all other record types, use something like MainRecordByEditorID(GroupBySignature(f, 'ECZN'), 'RandomEncounterZone1') .
|
RecordByFormID | IwbMainRecord | aeFile: IwbFile; aiFormID: integer; abAllowInjected: boolean |
Returns the main record in aeFile that has the specified form ID, or Nil if no records match. The form ID must be local to the file (see FixedFormID). |
RecordByIndex | IwbMainRecord | aeFile: IwbFile; aiIndex: integer |
Returns the aiIndex-th record in aeFile. |
RecordCount | cardinal | aeFile: IwbFile | Returns the number of records that aeFile has. |
SetIsESM | aeFile: IwbFile; abFlag: boolean |
Modifies the ESM flag for aeFile. See also: GetIsESM. | |
SortMasters | aeFile: IwbFile | Attempts to sort the masters for aeFile by their place in the current load order. |
IwbResource[edit | edit source]
These functions are used in "Assets browser.pas", "Assets manager.pas", and "Skyrim - List used scripts.pas".
Function | Returns | Arguments | Description |
---|---|---|---|
ResourceContainerList | akContainers: TwbFastStringList | Fills akContainers with the full filenames (directory + name) of all loaded BSA and BA2 files, as well as the name of the Data directory. akContainers can be a TwbFastStringList or a TStringList. | |
ResourceCopy | asContainerName: string; asFilename: string; asPathOut: string |
Retrieves the resource named asFilename from the resource container named asContainerName (see ResourceContainerList), and saves that resource to the specified file path asPathOut. The "Assets browser.pas" script uses this to let users extract a resource from a BSA/BA2. | |
ResourceCount | cardinal | asFilename: string; akContainers: TStrings |
Fills akContainers with a list of the loaded containers (BSA, BA2, Data directory) that a file named asFilename appears in. The "Assets browser.pas" script uses this to allow users to decide which version of a file to view, when the file is overridden at least once within their load order. |
ResourceExists | boolean | asFilename: string | Checks whether any loaded container has a file with the specified name. |
ResourceList | asContainerName: string; akContainers: TStrings |
Accesses the container with the full filename asContainerName (see ResourceContainerList), and adds a list of all contained filenames to akContainers. Note that added entries are unsorted, and there may be duplicates among them. | |
ResourceOpenData | TBytesStream | asContainerName: string; asFilename: string |
asFilename should be formatted similar to the other Resource-oriented xEdit scripts. asContainerName should be filled with a string generated by the function ResourceContainerList. The ResourceOpenData function should only be used in conjunction with NifTextureList, as ResourceCopy removes any other need for this function. |
Misc functions[edit | edit source]
Function | Returns | Arguments | Description |
---|---|---|---|
LocalizationGetStringsFromFile | asFilename: string; akListOut: TStrings |
||
wbAlphaBlend | boolean | akDestinationDeviceContext: unknown; aiDestinationX: integer; aiDestinationY: integer; aiDestinationWidth: integer; aiDestinationHeight: integer; akSourceDeviceContext: unknown; aiSourceX: integer; aiSourceY: integer; aiSourceWidth: integer; aiSourceHeight: integer; aiAlpha: integer |
A wrapper for Windows.AlphaBlend which returns its result. |
wbBlockFromSubBlock | TwbGridCell | akSubBlock: TwbGridCell | See also: wbPositionToGridCell, wbSubBlockFromGridCell, wbGridCellToGroupLabel, wbIsInGridCell. |
wbCRC32Data | cardinal | akData: TBytes | See also: wbCRC32File, wbSHA1Data, wbSHA1File, wbMD5Data, wbMD5File. |
wbCRC32File | cardinal | asFilename: string | See also: wbCRC32Data, wbSHA1Data, wbSHA1File, wbMD5Data, wbMD5File. |
wbCRC32Resource | cardinal | asContainerName: string; asFileName: string | |
wbFindREFRsByBase | aeREFR: IwbMainRecord; asSignatures: string; aiFlags: integer; akOutList: TList |
Searches for sibling records to aeREFR whose base records' signatures match asSignatures, and adds them to akOutList. Further filtering can be done with aiFlags: specify 1 to exclude deleted references, 2 to exclude initially disabled references, and 4 to exclude references that have an enable parent. | |
wbFlipBitmap | akBitmap: TBitmap; aiAxes: integer |
Flips the image data contained in akBitmap based on the specified axes. Specify 1 to flip horizontally, 2 to flip vertically, or 0 to flip on both axes. | |
wbGetSiblingRecords | aeRecord: IwbElement; asSignatures: string; abIncludeOverrides: boolean; akOutList: TList |
Adds sibling records of aeRecord to akOutList if their signatures match asSignatures. If abIncludeOverrides is not True, then overrides will not be included in the result. | |
wbGridCellToGroupLabel | cardinal | akGridCell: TwbGridCell | Returns an integer of the format 0xXXXXYYYY. See also: wbBlockFromSubBlock, wbPositionToGridCell, wbIsInGridCell, wbSubBlockFromGridCell. |
wbIsInGridCell | boolean | akPosition: TwbVector; akGridCell: TwbGridCell |
See also: wbBlockFromSubBlock, wbGridCellToGroupLabel, wbPositionToGridCell, wbSubBlockFromGridCell. |
wbMD5Data | cardinal | akData: TBytes | See also: wbCRC32Data, wbCRC32File, wbMD5File, SHA1Data, wbSH1Data. |
wbMD5File | cardinal | asFilename: string | Calculation time is about 2.5 times longer than CRC32. See also: wbCRC32Data, wbCRC32File, wbMD5Data, SHA1Data, wbSH1Data. |
wbNormalizeResourceName | string | asResourceName: string; akResourceType: TGameResourceType | akResourceType can be any of the following values: resMesh, resTexture, resSound, resMusic. |
wbPositionToGridCell | TwbGridCell | akPosition: TwbVector | Converts akPosition to grid coordinates. In practice, this is done by dividing the physical coordinates by 4096, the lateral length and width of a cell. See also: wbBlockFromSubBlock, wbGridCellToGroupLabel, wbIsInGridCell, wbSubBlockFromGridCell. |
wbSHA1Data | cardinal | akData: TBytes | See also: wbCRC32Data, wbCRC32File, SHA1File, wbMD5Data, wbMD5File. |
wbSHA1File | cardinal | asFilename: string | Calculation time is about two times longer than CRC32. See also: wbCRC32Data, wbCRC32File, SHA1Data, wbMD5Data, wbMD5File. |
wbStringListInString | integer | akList: TStringList; asSubstring: string | Checks if any of the strings in akList contains asSubstring. Returns the index of the first matching entry, or -1. Checks are case-insensitive. |
wbSubBlockFromGridCell | TwbGridCell | akGridCell: TwbGridCell | See also: wbBlockFromSubBlock, wbGridCellToGroupLabel, wbIsInGridCell, wbPositionToGridCell. |
NIF functions[edit | edit source]
Function | Returns | Arguments | Description |
---|---|---|---|
NifBlockList | boolean | akData: TBytes; akListOut: TStrings |
Retrieves block information from the NIF file in akData, and adds it to akListOut. Each added index in akListOut will match up with a string key of the form "BlockName=BlockType" and (as an object) a pointer to the NIF block's index number. Returns True if the operation succeeded. |
NifTextureList | boolean | akData: TBytes; akListOut: TStrings |
Searches the NIF file in akData for all texture paths, and adds them to akListOut. Returns True if the operation succeeded. |
NifTextureListResource | boolean | akData: variant; akListOut: TStrings |
Searches the NIF file in akData for all texture paths, and adds them to akListOut. Returns True if the operation succeeded. |
NifTextureListUVRange | boolean | akData: TBytes; afUVRange: Single; akListOut: TStrings |
Searches the NIF file in akData for all texture paths, and adds them to akListOut. Textures are only added if none of the relevant NiTriShape's UV sets have UVs greater than afUVRange or less than -afUVRange. Returns True if the operation succeeded. |
DDS functions[edit | edit source]
Function | Returns | Arguments | Description |
---|---|---|---|
wbDDSStreamToBitmap | boolean | akStream: TStream; akBitmapOut: TBitmap |
Modifies akBitmapOut to contain the DDS information sourced from akStream. Returns True if the operation succeeds. |
wbDDSDataToBitmap | boolean | akData: TBytes; akBitmapOut: TBitmap |
Modifies akBitmapOut to contain the DDS information sourced from akData. Returns True if the operation succeeds. |
wbDDSResourceToBitmap | boolean | akUnknown; akBitmapOut: TBitmap |
Modifies akBitmapOut to contain the DDS information sourced from the resource akUnknown. Returns True if the operation succeeds. |