***************************************************************** The Elder Scrolls III MORROWIND Mod: CDE: Inventory Control ***************************************************************** Index: 1. Description 2. Installation and Requirements 3. Playing the Plugin 4. Features 5. Version 6. Conflicts & Compatability 7. Thanks 8. Notes 9. Copyright ***************************************************************** 1. PLUGIN DESCRIPTION ***************************************************************** TITLE: CDE: Inventory Control VERSION: v1.2 BY: svengineer99 CONTACT: Bethesda software forum sveng This is a subcomponent of the Character Development Enhanced (CDE) project I am working on. More info at: http://forums.bethsoft.com/topic/1518059-wip-character-development-enhanced/ Inventory control enforces context dependent "time out"s ( lock out from menumode with player controls disabled ) for and/or restriction of equipment change and item use actions: A) Potion, ingredient and enchanted item use time outs B) Equipment change during combat time outs + equipment change under* other equipment restriction C) Equipment change during combat restriction [ only weapons and shields may be changed ] D) Equipmnet change time outs + equipment change under* other equipment restriction at all times *includes rings under gloves/guantlets, shirt under* cuirass, cuirass under robe, etc. Inventory controls A)-D) can be cycled through by holding down Shift-I(nventory)-C(ontrol) buttons for >1second to cycle through them: Level 0: Disables the mod for vanilla behavior Level 1: A) above Level 2: A)+B) above Level 3: A)+B)+C) above Level 4: A)+B)+C)+D) above The mod will default to Level 4 on first load Both menu mode and quick key item use and/or equiping are affected. Next/Previous ready enchanted items are restricted to equipped items for Level >=2 The present release requires default key assignments: "1"-"0" = Quick Keys (outside menu mode) "-","=" = Next/Previous Ready Item (outside menu mode) "[","]" = Next/Previous Weapon (outside menu mode) space = Activate, Pick Up (outside menu mode) Left Mouse Button = Pick Up / Drop (menu mode) Right Mouse Button = Enter/Exit Menu mode The mod should be possible to add/remove from the load order without restriction. ***************************************************************** 2. INSTALLING THE PLUGIN *****************************************************************S To install the plugin, unzip the files into the Morrowind/Data Files directory. The present release requires default key assignments (see above) REQUIREMENTS: Morrowind, Bloodmoon, Tribunal, MWSE v2.0 ( or later ) [ https://www.nexusmods.com/morrowind/mods/45468 ] Morrowind Code Patch (MCP) v2.3 (or later ) [ https://www.nexusmods.com/morrowind/mods/19510 ] -- "Incorrect item sound fix" required to detect potion and ingredient consumption -- "Enchanted item rebalance" optional; 4s MCP cool down will be in parallel with time outs ***************************************************************** 3. PLAYING THE PLUGIN ***************************************************************** From the Morrowind Launcher, select Data Files and check the box next to the CDE Inventory Control.esp file ***************************************************************** 4. PLUGIN FEATURES ***************************************************************** Global option variables: [ to change, open the console with "~" and enter "set to " ] 1) sve_inv_mbox[short default=1] Determines if (=1) or if not (=0) inventory control message boxes are displayed. 2) sve_inv_com_del/dist[floats default=5.0/2000.0] Defines the dist(ance) in game units that must be exceeded for the del(ay time) in seconds between the player and any hostile actor before the player is considered to have exited combat, for inventory control purposes. Additionally, there must be no line of sight between the player and any hostile actor or the del(ay) timer is reset. 3) sve_inv_enc_to[float default=2.0] Defines the timeout (in seconds) after enchanted item use. 4) sve_inv_to_cns_b/cns_m/cns_pow[float defaults=1.0/100.0/0.667] Defines the timeout (in seconds) after potion or ingredient consumption time out = b + ( m * weight / ( agility + speed ) )^pow Examples for PC with agility + speed = 100, default settings: Consuming a 0.5 weight potion incurs a 1.6second timeout Consuming a 5.0 weight potion incurs a 3.9second timeout 5a) sve_inv_to_armr_b/armr_m/eqp_pow[float defaults=1.5/25.0/0.667] 5b) sve_inv_to_clth_b/clth_m/eqp_pow[float defaults=1.0/50.0/0.667] 5c) sve_inv_to_weap_b/weap_m/eqp_pow[float defaults=0.5/5.0/0.667] 5d) sve_inv_un_eq_to_rat[float default=0.35] Defines the timeout (in seconds) to equip armor, clothing or weapons* time out (equip) = b + ( m * weight / ( agility + speed ) )^pow time out (un-equip) = b + ( rat * m * weight / ( agility + speed ) )^pow Equip and Un-Equip times are additive when swapping items. Examples for PC with ( gility + speed = 100, default settings: Equipping 3.0 weight steel dagger incurs a 0.8second timeout Equipping 0.1 weight common ring incurs a 1.2second timeout Equipping 1.0 weight chiten gauntlet incurs a 1.9second timeout Equipping 3.0 weight common robe incurs a 2.3second timeout Equipping 96.0 weight daedric warhammer incurs a 3.3second timeout Equipping 20.0 steel boots incurs a 4.4second timeout Equipping 90.0 weight daedric cuirass incurs a 9.5second timeout Un-equipping 90.0 weight daedric cuirass incurs a 5.5second timeout *shields, probes and lockpicks are treated as weapons for time out calculations 6) sve_inv_phase_freq [float default=1.0] Defines the frequency (in Hz = 1/seconds) that equipment is toggled on/off during timeouts that gives both a visual and real game effect (i.e. being un-armored for 50% of equipment change timeout durations) Set to 0 to disable the feature (as requested by Lucas9 on Morrowind Nexus) 7) sve_inv_def_bon_fac [float default=-5] Defines the defense bonus (negative = penalty) during time outs Defensen Bonus = def_bon_fac * time out duration (seconds) By default, a 5s time out will incur a -25 defense penalty for the duration of the time out 8) sve_inv_loop [short default=1000] Defines the maximum # of inventory items processed per frame. Note that inventory item process is only triggered by inventory access key or mouse button press release. Depending on your CPU speed, you may notice lag starting in the range of ~100-500 inventory items. Decreasing this global variable can smooth out that lag but it will also increase the chance of quick double key or mouse button press causing the script to miss an inventory access event or possibly get out of sync; if that happens you can try SHIFT-I-C cycling through the inventory control level to reset the script. Known script "defects": 1) Item sub-types are identified by item name sub-strings such as "cuirass" that will identify "chitin cuirass", "cuirass of the savior's hide", etc but not "chest of fire" so the former 2 cases will be correctly identified as a cuirass while the latter one will only be identified as a piece of armor. If the equipment sub-type can not be identified then those items won't be prohibited from equip /un-equip but instead will result in a time out. For the core Morrowind+Tribunal+ Bloodmoon.esms >95% of items should be correctly identified. If future MWSE expansion supports item sub-type functions this could be improved. 2) To kick the Morrowind Engine into re-building the ready item list with equipped on-use items only, a number of scripting steps are taken including adding and removing a dummy item from the player's inventory. In certain situations (such as the trading dialog menu) this results in messages "nothing added" and "removed" when an inventory change event is processed (such as purchase or sale of items). It is safe to ignore these messages. And if you happen to find an errant nothing in your inventory it is safe to keep or drop it. 3) Occassionally the player in combat detect check will return true even though there is no identifiable hostile actor in the area or return false even though there is. I'm not sure why this is happening but it seems harmless and gives a sometimes amusing or unexpected result. 4) Multiple items of the same type (for example >=2 "ring of fireball"s) present a special difficulty. Once one is equipped, the others can not be recognized as different for the purpose of inventory control. This can result in annoying behavior when using the previous/next ready buttons, in particular for additional rings of the same type but different charge that will get redundantly equipped, un-equipping other rings. If future MWSE expansion supports inventory true references, this could be improved. Global modder resource variables: 1) sve_inv_pc_in_com [long] Toggles between 0 (not in combat) and 1 (in combat) according to the sve_inv_com_del/dist global variables and formula discussed above. The check is re-freshed every second. 2) sve_inv_eq_weap_ar [long array] This is an array of long types. Index=0 returns the equipped weapon, probe or lockpick id or 0 if none equipped. Index=1 returns the equipped weapon, probe or lockpick name or 0 if none equipped. 3) sve_inv_eq_id_ar [long array], sve_inv_eq_id_ar_ct [long] This array contains the item ids for all equipped items. The highest valid index, starting at 0, is stored in the ar_ct variable; ar_ct=-1 indicates an empty array. ar_ct=-2 indicates the array is incomplete (during multiple frame construction) 4) sve_inv_itm/pot/ing_tot_ct [longs] sve_inv_itm_tot_cnt is the total # of player inventory items. sve_inv_pot_tot_cnt is the total # of player invetory potions. sve_inv_ing_tot_cnt is the total # of player inventory ingredients. ***************************************************************** 5. PLUGIN VERSION ***************************************************************** v1.01 - fixes bug when trading worn objects by disabling inventory control in menumode when the pc target is a trader or companion and the player is not in combat or sneaking, etc thanks to Lucas9 on Morrowind Nexus for reporting it v1.02 - changes the inventory control token name to 'nothing'. Thanks to harrytom for suggesting it. v1.1 - fixed several minor bugs reported after 100hrs of gameplay. Thanks to harrytom's feedback. ***************************************************************** 6. CONFLICTS & COMPATABILITY ***************************************************************** I am not aware of any conflicts with other mods. During timeouts, access to menu-mode is possible if it does not coincide with player right mouse button press, to allow the game engine or other mods to force menu mode open, if needed. Also during timeouts, the player controls enabled/disable state is checked before and during the timeout player control disabled enforcement and restored to the expected state following time out. The only thing that is undetectable is if the game engine or other script disables the player controls during a time out; it is assumed that such event would be properly handled on the other side. This shouldn't happen, but if player controls become stuck disabled try entering 'enableplayercontrols' in the console Please reports any bugs or problems at: http://forums.bethsoft.com/forum/12-morrowind-mods/ ***************************************************************** 7. THANKS ***************************************************************** NullCascasde and Greatness7: for MWSE 2.0 greatly improved efficiency, xContentListFiltered Merzasphor: For HUGELY extending MWSE including array and enchanted item functions Hrnchamd: For MCP inventory sound supportand MWE-XE game settings script functions CDC and the SF MWSE Dev Team: For MWSE development and release up to 0.9.4a Dave Humphries: For MWEdit Theodore Ward: for the AstroGrep search tool, for searching scripts in .esm/.esps Yacoby: For the MWEdit menutest work around documented in PursuitEnhanced Nigedo: For the menu close and HUD reset method Fliggarty, Yacoby, Abot, Logitech, Galsiah and many others: for past mods with working examples of standard and MWSE function usages Darkelfguy: for Morrowind Modding Showcases and Podcasts inspiration. The Assimilation Lab: For continuously updated Morrowind Modding Wiki entries GhanBuriGhan, Yacoby and melian: For Morrowind Scripting for Dummies Abot: For Morrowind Scripting for Smarties Greatness7 and Nakashi: For expanded MWSE discussion and feedback Lucas9: for bug reporting on Morrowind Nexus Bethsoft: Of course, for the game engine of and base construction set for Morrowind Everyone who commented and contributes on the Bethesda/TES/Morrowind Forums Everyone who has contributed and continues to contribute mods Anyone who I may have missed, please let me know ***************************************************************** 8. NOTES ***************************************************************** ***************************************************************** 9. COPYRIGHT ***************************************************************** This plugin is freely distributable and modifiable, as long as this readme file accompanies it and credit is given to the original author. But please remember that not everything here is my work. Refer to section 7.THANKS. By downloading and running this plugin, you acknowledge the following : - You have read and understood this readme file. - You acknowledge that the author of this plugin accepts no responsibility for damage to your game saves, operating system, computer, etc, when using this plugin. NOTE: Please do not upload this plugin for distribution without my permission. --svengineer99