Tes3Mod:MWEdit/Change Log v0.6.0

Major Changes
Merged with MWEditSE and MWE to include support for compiling extended script functions. See the CustomFunctions.dat file for more details.
Significant improvements to the script compiler. Fixed many existing and new bugs. Now allows extended expressions if if() and while() statements. Added several missing functions like some console commands that can be used in scripts. Redid script testing by comparing MWEdit compiled output with that from the Construction Set. Output is identical in most cases. 
Almost halved loading speed by using an improved record indexing method.
Dialogue INFOs will now display correctly.
Fixed the crash some people experienced when opening a plugin (finally).
Added undo the script editor.
Added new options including disabled backup saves, custom game path, and disable forcing of strict object IDs.
Added the 'extra file' option which allows plugins to be edited without needing to load their applicable masters. For example, this feature allows you to use the 'player' NPC object without needing to load Morrowind.esm or create a temporary player.
Various bug fixes and UI improvements all around.
Added script indent command which automatically indents a script according to various options.

Detailed Change Log
Improved indexing of records which roughly halves the loading time and speeds up record lookups in general.
Checks for duplicate IDs greatly speeded up using the improved record indexing.
Added link to UESP Wiki on the function help page (jumps to the appropriate article).
Added the custom game data path to the options. If this value is blank the default MW data path from the registry is used (if found). Specify a custom "Data Files" path if you wish to load files from an alternate game location.
Fixed the bug where the open dialog would crash if it found a file with a date set far in the future.
Merged in the v0.9.2a MWSE changes and custom function definitions. All custom functions are defined the "CustomFunctions.dat" file which allows one to add new function definitions as needed without requiring a recompile. See the data file for an explanation of how to edit/add new functions.
Fixed bug in script compiler which would incorrectly output if() statements when they  appeared directly after certain function calls.
Added the "backup saves" option which allows you to disable the automatic save backup option which is enabled by default.
Corrected the definition of the SetWereWolfAcrobatics function.
The error view at the bottom of the script dialog now shows up initially (maybe).
Added the "no compile prompt" option which disables the popup message box after a  script is compiled. The final compile message is added to the end of the messages in the error list at the bottom of the script window.
Added the "extra file" option. When this is enabled the given file is loaded and used if a certain record is not found in the current file. For example, the extra file  contains the "player" record. If you load an ESP without the Morrowind.esm master file you can still compile scripts using the "player" object by enabling this option. Any record type is supported in the extra file (globals, NPCs, scripts, etc...).
Added basic undo functionality to the script editor (Ctrl-Z, the right-click context menu or via the Undo button). 
Rearranged the function help page slightly and added the v0.9.2a MWSE functions. Note  the MWSE functions don't yet have an article on the Wiki.
Modified the weapon dialog to prevent scripts from being applied on thrown, arrow, and bolt weapons.
New NPCs will have initial values set for their race, class, hair, and head if there are any available. This is to try to prevent the Construction Set from crashing when editing the AI packages of an NPC with a missing race/class/hair/head.
Added the "Strict Object IDs" options. When enabled it works the same as previous versions where only certain new object IDs are allowed. When disabled you can use pretty much any ID as long as it starts with a letter, number, or underscore.
Added a bunch of the "Toggle..." and other functions as used in MW-Enhanced to the custom function file.
Fixed crash when cleaning a record.
Changed the cell name to force an output of a terminating null character to try and prevent the cell renaming bug.
Fixed bug when compiling scripts with the "extra file" enabled.
Fixed generation of new Info/StartScript IDs which resulted in a bad ID in some cases.
Corrected the default "extra file" name to match the distributed file.
Fixed crash when dragging in script editor.
Added undo for dragging text in script editor.
Fixed crash/error in script editor caused by undo in some cases.
Changed valid script if() syntax. Now allows operators, and functions on both sides and reference calls on the left side. Ensure to enclose both sides of the comparison operator in brackets to ensure it compiles correctly in the Construction Set, eg:
 
Changed how extra variables are checked at the end of function calls to prevent some errors when functions are used in if() statements.
Tabs will now undo in the script editor.
Added the 'Indent' button to the script toolbar. When used it attempts to automatically indent the script according to the current settings. This action can be undone.
Added various identation settings in the options dialog. 
Added the following console functions to the script compiler:
::*CenterOnCell
::*CenterOnExterior
::*FillMap
::*FixMe
::*ToggleAI
::*ToggleCollision
::*ToggleFogOfWar
::*ToggleGodMode
::*ToggleMenus
::*ToggleSky
::*ToggleVanityMode
::*ToggleWorld Verified script output matches 100% to that produced in the CS with the above functions.
Renamed "Ingrediant" to "Ingredient" on UI components.
Changed the enchantment type "Cast Strikes" to "Cast On Strike".
Added a bunch of AI data/flag columns to the right side of the NPC list.
The 'ifx' and 'whilex' keywords now ident properly in the script editor.
Fixed bug when renaming a record that would incorrectly change the name original record.
The infos listed in a dialogue should now be correct. Dialogues also should be properly copied and renamed now along with their associated infos.
When cleaning a record its edit window is automatically closed if open.
Fixed misspelling of xRefType in function data files.
Fixed a script compile bug with local variable references (eg: set SomeObject.LocalVar to 1) which would output incorrect data in some cases.
Local variables can now be checked in if statements, ex:
 
Checked output of whilex(i) using one character local variables as mentioned as a possible bug. Seems to be the same as multi-character variables and is the same output as MWEditSE.
The while statement now accepts extended expression like the if statement. This also fixes a bug with some while statements being output incorrectly.
Fixed bug when using extended functions within an if/while block (incorrect block size was begin output).
Blank lines in scripts are no longer idented when using auto-indent.
Script text is no longer selected when a script is opened.
Added the "Script Compare" option to the test menu to help in quickly confirming compiled script output matches that of the CS. To use, create a plugin with one or more scripts to test. Compile one copy in the CS and one copy in MWEdit. Select the "Script Compare" and open the copy compiled in the CS. The script compare window will open and show the basic comparison results from the compiled data.
Fixed bug which prevented the SameFaction function from being compiled.
Fixed script compile bug related to outputting some functions incorrectly (was due to the  recent change in how functions are parsed).
The omitted comma warning in function calls has been disabled at all warning levels.
Corrected the current values for the animation groups. The animation opcodes have changed sometime between the original version of the CS and the latest version.
Added some missing animation codes added in a previous patch or expansion. It is unsure whether any of these codes have a valid use in a script.
::*Attack1
::*Attack2
::*Attack3
::*Block Hit
::*Block Start
::*Block Stop
::*Equip Attach
::*Equip Start
::*Equip Stop
::*Loop Start
::*Loop Stop
::*Self Release
::*Self Start
::*Self Stop
::*Shoot Attach
::*Shoot Follow Attach
::*Shoot Follow Start
::*Shoot Follow Stop
::*Shoot Max Attack
::*Shoot Min Attack
::*Shoot Min Hit
::*Shoot Release
::*Shoot Start
::*Slash Hit
::*Slash Large Follow Start
::*Slash Large Follow Stop
::*Slash Max Attack
::*Slash Medium Follow Start
::*Slash Medium Follow Stop
::*Slash Min Attack
::*Slash Min Hit
::*Slash Small Follow Start
::*Slash Small Follow Stop
::*Slash Start
::*Start
::*Stop
::*SwimAttack1
::*SwimAttack2
::*SwimAttack3
::*SwimDeath2
::*SwimDeath3
::*SwimHit1
::*SwimHit2
::*SwimHit3
::*Target Release
::*Target Start
::*Target Stop
::*Thrust Hit
::*Thrust Large Follow Start
::*Thrust Large Follow Stop
::*Thrust Max Attack
::*Thrust Medium Follow Start
::*Thrust Medium Follow Stop
::*Thrust Min Attack
::*Thrust Min Hit
::*Thrust Small Follow Start
::*Thrust Small Follow Stop
::*Thrust Start
::*Touch Release
::*Touch Start
::*Touch Stop
::*Unequip Detach
::*Unequip Start
::*Unequip Stop
:Animation groups with a space in them must be enclosed in quotes when used, eg:
 
:New groups that have multiple opcodes use the lowest opcode value. See Animation Groups for the complete list of valid animation groups.
The script find dialog defaults to a down direction.
Added the GetLOS function as a short form for GetLineOfSight.
GetPCRank not accepts an optional faction parameter. Output in typical uses verified to 100% of that output by the CS.
Removed the "Local variable 'var' conflicts an object ID" warning.
Fixed bug with script undo when overwriting selected text with a character or paste operation.
Fixed script compiler bug which would insert an extra "-" in if() statements in some cases.
Lots of other minor improvements to the script compiler to ensure it matches the output of the CS as closely as possible.
Included the MwEditScriptTest.esp file which was used to verify the output of the  script compiler matches as close to possible the output from the CS. The scripts starting with "testbar" are known to contain issues:
::*testbad_aiwander:	AiWander calls with reset are output strangely from the CS.
::*testbad_if3:		If/set expressions with negatives are output differently by the CS but the final result is the same.
::*testbad_random1:
::*testbad_random2:	Random is just messed up by the CS but the 'correct' output from MWEdit seems to work just fine.
:All other scripts are verified to compile in MWEdit to exactly the same as from the CS.
Added the "Allow Bloodmoon" and "Allow Tribunal" options. When checked they allow the expansion specific script functions to be used (you'll receive an error/warning message otherwise). When "Allow Tribunal" is checked you can also use the extended set of animation groups. This feature does not currently recognize changes in existing functions made in the expansions, only new functions added in the expansion.
Added a script compiler warning if a '34th' local variable is used.
Improved the operation the function help command in the right-click context menu of the script editor.
Added the 'Compile Active Scripts' command in the Edit menu which attempts to compile all scripts in the active plugin.