Skyrim Mod:Mod File Format/SCHR Field

The UESPWiki – Your source for The Elder Scrolls since 1995
Jump to: navigation, search

SCHR and related fields represent old scripting code. It is believed that these are all non-functional, but they can occasionally still be found in the game data on records with versions 31 and lower. See Oblivion's SCPT page for more information on how some of these fields work.

Note: much of the information on this page is taken from the Oblivion page and may need updating for Skyrim.

Field Layout[edit]

Like many of the other common complex field types, old script records can include numerous fields, always starting with an SCHR and sometimes including nothing else.

C SubRecord Name Type/Size Info
+ SCHR Unknown uint32 Always 0.
RefCount uint32 Number of references used script. This includes 'ref' local variables and direct references (eg: player). This should equal the number of SCRO and SCRV subrecords in the script.
CompiledSize uint32 Size of the compiled data (SCDA subrecord)?
VariableCount uint32 The last local variable index used in the script. For a new script this value will be 0. For a new script with a single local this will be 1. This index will always increase for a single script and never decrease. For example, if you create a new script, add a local variable, compile, delete the local, and recompile this value will remain at 1. If you add another local variable it will increase to 2. This is likely to prevent external references to a local variable from becoming invalid.
Type uint32 Type of script
0x00010000 - only value seen on any record type.
- SCDA Data byte[] Compiled script.
- SCTX Text string Script text.
- QNAM Quest formid The quest the script belongs to, if appropriate.
- SCRO Object formid Object referred to by compiled code (much like CIS* fields in CTDA subrecords).