Talk:TES5Edit Scripting Functions
Wiki Updates (for this page) don't seem to be updating for anyone who is not logged in. I've tried viewing the site on 3 different browsers and cleared my cache. It just doesn't want to update.
- This has been a recurring issue with the wiki for a long time. For example, the site used to never show any SKSE function pages at all unless you were logged in. I'm not sure why it happens, or if that's still the case, because I've long since configured my browser to stay permanently logged in to this site. -egocarib (talk) 2015-05-25T11:18:16 (EDT)
TES5Edit Selection Detection
Is there a way to tell during Initialize or Process if we have selected a single record, multiple records, or a plugin? I would like to know what the selection is before allowing Process to go anywhere. The TES4 form seems to always be the last so having Process kill itself on that wouldn't work well. --Darkconsole (talk) 2016-03-01T16:11:39 (EST)
Bugs
As of TES5Edit 3.1.3 EXPERIMENTAL:
- Working with overrides is broken in the following case and in any similar case. xEdit itself is capable of creating files that are broken in this manner, and the only solution is to totally delete them and find a way to start with non-broken files.
- FileA.esp with Skyrim.esm and Update.esm as masters
- FileB.esp with FileA.esp as its only master
- This means that FileA forms have index 02 in xEdit's loaded file, but index 01 in FileB.
- Call FormID(...) on any override in FileB
- xEdit handles these overrides in a manner that is internally inconsistent: they will use load order prefix 02 in the UI and internally within the program, but xEdit APIs (e.g. Remove) called on them will use load order prefix 01, and the mismatch will cause these APIs to fail completely.
- xEdit fails with an error if you call Remove or RemoveNode on an element that has previously been removed and reinserted into the file, either during the current attempt at executing a script or any prior attempt.
RemoveByIndex doesn't even appear to do anything, Jesus Christthis may have been due to the inconsistent-state bug above
- If you call AddElement on an element that is still in the hierarchy, then your script will fail with an executable-level assertion deep within xEdit's own code. Moreover, when xEdit closes, it will throw the same assertion, raising the question of whether the program itself is even safe to use after a script fails in this manner.
DavidJCobb (talk) 2017-05-04T05:23:59 (EDT)
Article rewrite
Currently working to reorganize the list of scripting functions; saving my work under my userpage for now.
- Explicitly describe the class-inheritance of data types that scripts are likely to encounter (e.g. a IwbMainRecord is an IwbContainer is an IwbElement)
- Categorize functions by the internal data types they work with, instead of vomiting them all into a big pile that we can barely maintain
- Pull function definitions from the source code, so that we aren't missing any functions (even if we don't know what they all do)
- Use a template when listing functions on the page, to minimize ugly row markup and make it easier to style rows uniformly
Functions are made available to the scripting context through calls to AddFunction
in wbScriptAdapter.pas
. However, some scripting APIs wrap functions defined in other files, and it isn't always clear which other files they were defined in.
DavidJCobb (talk) 2017-05-05T17:55:49 (EDT)