Difference between revisions of "AddForm - FormList"

257 bytes added ,  19:43, 9 March 2022
corrections
(more RE; figured out list ordering for good)
(corrections)
Line 24: Line 24:
== Notes ==
== Notes ==
=== Order of items in the list ===
=== Order of items in the list ===
FormLists are divided into three sections. First are all of the forms that are initially present in the FormList per its definition in the Creation Kit. Next are any forms that were not created during play (form ID does not start with 0xFF) and were added to the FormList by scripts. Last are forms that were created during play (form ID starts with 0xFF) and were added to the FormList by scripts. This means that FormLists will not necessarily store forms in the order they were added to the list.
FormLists are divided into three sections. First are any forms that were created during play (form ID starts with 0xFF) and were added to the FormList by scripts. Next are all of the forms that are initially present in the FormList per its definition in the Creation Kit. Last are any forms that were not created during play (form ID does not start with 0xFF) and were added to the FormList by scripts. This means that FormLists will not necessarily store forms in the order they were added to the list.


Consider a FormList that has forms ''A'', ''B'', ''C'', and ''D'' added to it in the Creation Kit.
Consider a FormList that has forms ''A'', ''B'', ''C'', and ''D'' added to it in the Creation Kit.
Line 32: Line 32:
Now, consider a FormList that has forms ''T'', ''U'', and ''V'' added to it in the Creation Kit.
Now, consider a FormList that has forms ''T'', ''U'', and ''V'' added to it in the Creation Kit.


Suppose a script adds forms ''W'', ''X'', ''Y'', and ''Z'' to the FormList; however, forms ''W'' and ''X'' are forms that were created during play (e.g. ObjectReferences spawned via PlaceAtMe), while forms ''Y'' and ''Z'' are forms defined in the user's load order. The FormList will now contain: ''T U V Y Z W X''.
Suppose a script adds forms ''W'', ''X'', ''Y'', and ''Z'' to the FormList; however, forms ''W'' and ''X'' are forms that were created during play (e.g. ObjectReferences spawned via PlaceAtMe), while forms ''Y'' and ''Z'' are forms defined in the user's load order. The FormList will now contain: ''W X T U V Y Z''.
 
Reverse-engineers should be aware that in memory, the list of non-temporary forms comes before the list of temporary forms; however, the underlying function for [[GetAt - FormList]] checks the latter first, treating the start of the latter as index 0.


=== Other notes ===
=== Other notes ===
53

edits