Starfield Mod:Mod File Format/CTDA

CTDA subrecords hold information about Condition Data. It is a custom data structure with a fixed size of 32 bytes:


 * dword type
 * Type of comparison/condition.
 * float value
 * Value to use for comparison. This is usually a float but can also be a dword/formid depending on the condition type.
 * dword function
 * Function to call to get the value.
 * dword param1
 * dword param2
 * Parameters are "usually" dwords but depend on the function to determine exactly what kind of data.
 * dword runOn
 * dword reference
 * dword param3
 * Probably depends on the function for what type of data.

CTDA subrecords are optional and there can be more than one in each record (544 is the most found in a single record in Starfield.esm).

Found In
CTDA subrecords can be found in the following record types:


 * ACTI
 * ALCH
 * BMMO
 * CAMS
 * CHAL
 * CNDF
 * COBJ
 * CPTH
 * ENCH
 * FLST
 * GBFM
 * HAZD
 * IDLE
 * INFO
 * LSCR
 * LVLB
 * LVLI
 * LVLN
 * LVLP
 * MESG
 * MGEF
 * MUST
 * PACK
 * PCBN
 * PCCN
 * PCMT
 * PERK
 * PKIN
 * QUST
 * SCEN
 * SMBN
 * SMQN
 * SPEL
 * STBH
 * TMLM
 * WRLD

Type Values
The following are all the possible type values found in Starfield.esm:

0    1     2     3     32     33     34     36     4     5     64     65     66     68     69     96     97     98     100     101     102     128     129     130     131     132     133     134     16     160     161     162     164     166

The comparison type is a bitfield with the following definition (taken from [https://github.com/TES5Edit/TES5Edit/blob/dev-4.1.5/Core/wbDefinitionsSF1.pas xEdit wbDefinitionsSF1.pas): Compare operator (upper 3 bits) LGE 000   0=Equal to        001    1=Not equal to        010    2=Greater than 011   3=Greater than or equal to        100    4=Less than 101   5=Less than or equal to    Flags (lower 5 bits) 0x01=OR (default is to AND conditions together) 0x02=Parameters (use aliases) : Force function parameters to use quest alias data (exclusive with "use pack data") 0x04=Use global 0x08=Use Pack Data : Force function parameters to use pack data (exclusive with "use aliases") 0x10=Swap Subject and Target

Function Values
The following are all the possible functions values found in Starfield.esm:

1    5     14     18     27     32     35     46     47     49     50     56     58     59     61     62     67     69     70     71     72     73     74     77     80     84     122     133     142     144     145     152     157     159     161     170     182     203     214     248     250     255     263     266     267     286     288     289     300     314     323     359     360     362     414     415     426     430     444     448     449     459     465     497     511     513     543     544     560     561     562     566     580     590     595     598     604     605     610     625     629     640     682     707     709     722     726     728     730     751     758     759     760     762     764     765     766     795     815     816     820     824     827     828     837     838     843     845     846     848     849     850     854     856     857     858     860     874     899     900     922     931     934     944

The following complete function types is taken from xEdit wbDefinitionsSF1.pas: