Enum IDs
Bethesda has more than once utilized a pattern where they declare a set of AutoReadOnly properties in a block like this:
|
; Set of read-only properties to essentually make a fake enum for critical stages |
|
int Property CritStage_None = 0 AutoReadOnly |
|
int Property CritStage_GooStart = 1 AutoReadOnly |
|
int Property CritStage_GooEnd = 2 AutoReadOnly |
|
int Property CritStage_DisintegrateStart = 3 AutoReadOnly |
|
int Property CritStage_DisintegrateEnd = 4 AutoReadOnly |
|
int Property CritStage_FreezeStart = 5 AutoReadOnly |
|
int Property CritStage_FreezeEnd = 6 AutoReadOnly |
These properties are all part of a singular "fake enum," and we should have a data structure to account for that. The simplest-for-users format would be to have a script-scoped Enum ID.
The simplest-to-implement solution would've been to include a reference to each property in the enum, but that gets exponentially more problematic the more enum members there are—especially as more are added. That solution leads to exponentially duplicated state and introduces ample opportunity for human error. Instead, a script-scoped ID allows for dynamic addition and removal from an enum by editing just one file.
A good editor UX should make the ID less prone to error, since we can show a modal before users create a brand-new Enum ID but not before they select an existing one.
Auto:Readonly:Enum IDs
Bethesda has more than once utilized a pattern where they declare a set of AutoReadOnly properties in a block like this:
papyrus-index/data/Fallout4/vanilla/Actor.psc
Lines 1031 to 1038 in d7eba22
These properties are all part of a singular "fake enum," and we should have a data structure to account for that. The simplest-for-users format would be to have a script-scoped Enum ID.
The simplest-to-implement solution would've been to include a reference to each property in the enum, but that gets exponentially more problematic the more enum members there are—especially as more are added. That solution leads to exponentially duplicated state and introduces ample opportunity for human error. Instead, a script-scoped ID allows for dynamic addition and removal from an enum by editing just one file.
A good editor UX should make the ID less prone to error, since we can show a modal before users create a brand-new Enum ID but not before they select an existing one.