Unarmored Corrector V01 (for players)

by DinkumThinkum

A workaround for the Unarmored bug:
The Unarmored Corrector automatically equips an invisible helm when the PC is not wearing any armor. Having the invisible helm equipped makes the character's Unarmored skill work correctly. See readme for more info.

Download Unarmored Corrector V01
from Elric Melnibone

Download Unarmored Corrector V01
from Planet Elder Scrolls

Download Unarmored Corrector V01
from Emma's Elder Scrolls Site


From the ReadMe-file

A mod that provides a workaround for the Unarmored bug for player characters.

The Unarmored Corrector will not make your Unarmored character indestructible:
this is not a cheat mod. But if your character is wearing no armor at all, then this mod will make their Unarmored skill work correctly: as their skill goes up the amount of damage taken from attacks will be reduced.

This initial release is the version for player characters. I also plan to eventually do a version for companions and other NPCs, since NPCs are also affected by the Unarmored bug. The companion version will probably be released as some type of resource pack for modders to use.

Installation and use:
Just place the .esp and this ReadMe into your Morrowind Data Files directory.
When you start the game, choose the Data Files option on the menu and enable the .esp by check marking the box next to the .esp on the list (double click on the box).

If you have only Bloodmoon, use the Bloodmoon .esp. If you have only Tribunal, use the Tribunal .esp. If you have both expansions, use just ONE .esp (doesn't matter which one).

(This mod requires that you have either the Tribunal or the Bloodmoon expansion installed; it uses script functions that aren't available in the original game.)

After you load your saved game, you'll see a brief message 'Unarmored Corrector activated' and another message 'Your journal has been updated'. If you're starting a new character, you won't see the messages until after you leave the Census Office at the end of character creation.

The corrector is meant to be left running all the time: if your character does put on armor, the corrector will detect it and wait until they stop wearing it again. If you ever do need to stop or restart the Unarmored Corrector, open up the console with the '~' key and enter

StartScript DT_UC_MessageBoxes

on one line, then hit the Return key.

That will pop up a message box telling you whether or not the script is running and giving you options to stop or start it, or to leave it alone.

The main reason for wanting to stop the script would be for a mod or quest that requires your character to have absolutely no armor at all. My mod corrects for the Unarmored bug by equipping your character with an invisible helm, which could interfere with mods or quests that depend on you having no armor equipped.

My script automatically detects if your character already has armor equipped, so there's no need to turn the corrector off if you decided to start wearing armor all the time. On my (fairly good) system, I haven't noticed any impact on FPS when my script is running, but turning it off might save you a few CPU cycles.

If you check the 'All Quests' list in your journal, you'll find a new entry: 'Unarmored Corrector information'. That just has the above console command for starting or stopping the corrector, so you don't have to exit the game to look it up in this ReadMe.

Unarmored bug:
Unless a character is wearing at least one piece of armor, the Unarmored skill has no effect. With no armor at all worn, a character with an Unarmored skill of 100 will take as much damage in combat as a character with an Unarmored skill of 1.

If the character is wearing at least one piece of armor (on any part of their body), then the Unarmored skill will work correctly for the parts not covered by armor: damage from blows will be reduced based on the character's Armor Rating.

Note that this bug also affects the Shield spell effect: if no armor is being worn, the Armor Rating provided by the Shield spell has no effect.

The Sanctuary effect is not affected by this bug; it reduces the chance of being hit whether or not any armor is being worn.

Two standard workarounds for the Unarmored bug:
1. Dodge mods: these provide a Sanctuary spell effect that increases with Unarmored skill level.

2. Wearing a cloth bracer: the piece of armor makes the Armor Rating from the Unarmored skill effective, and using cloth armor somewhat fits in with the idea of a truly unarmored character.

The Unarmored Corrector:
My Unarmored Corrector is an improved and automated version of the 'wear a cloth bracer' approach. It uses a script to handle the armor in the background as inconspicuously as possible.

1. Cloth bracers and other non-invisible armor pieces are visible when worn.

The corrector armor in this mod is invisible and doesn't show up on the character; better for roleplayers.

2. Cloth bracers and most invisible armor show up in the character's inventory.

The corrector armor won't show up on the character's paper doll in the inventory window, but there will be an icon that looks like a piece of paper in the inventory list: that icon is an invisible helm. It can be dropped, sold, etc. without causing problems: the scripting will just replace it as needed. If you experiment and wind up with more than one, just leave them in your inventory and my code will get rid of the extras.

3. Cloth bracers or other armor pieces may raise or lower your Armor Rating by several points when worn, depending on your Unarmored and Light Armor skills.

This mod includes several different pieces of corrector armor with different armor ratings, and minimizes the change in the character's armor rating by using the Unarmored skill level to determine which piece to equip.

4. Cloth bracers and other armor pieces need to be repaired on a regular basis, which (to me) rather wrecks the immersiveness of trying to play an Unarmored character.

The script in this mod automatically replaces the corrector armor on a regular basis with a brand new piece of armor, so there's no need to manually repair the armor.

Overall, a major goal of this Unarmored Corrector mod is to correct for the Unarmored bug as inconspicuously as possible. I want this to be a mod you just install and forget about.

I can't get rid of the paper icon in the inventory list without triggering 'Removed from inventory' messages every time you talk to an NPC. But, from a role playing point of view, I'm comfortable with a monk or mage carrying around handwritten notes on self defense.

Also, because of the invisible helm, your character's Light Armor skill will go up occasionally, even when playing fully Unarmored. It might be possible to eliminate the Light Armor skill increases with scripting, but the increase is slow and too trivial to be worth risking bugs and conflicts with other mods.

Other than that, this mod should make it appear to the player as though the character is truly Unarmored, but without the bug.

The Unarmored Corrector is meant especially for players who want to play fully unarmored, but it will not interfere at all with wearing armor.

If the player is wearing one or more pieces of armor, that will make the Unarmored skill work correctly for the rest of their body: there's no need for the Unarmored Corrector to equip any armor. The script will detect that the player or companion already has armor equipped, and it will simply skip equipping its own armor; thus no interference.

Also, I specifically tested (briefly) with a character in werewolf form. In werewolf form, the character is still affected by the Unarmored bug and (the good news) the Unarmored Corrector works just fine to correct it.

Effectiveness of the Unarmored Corrector
Without the corrector, a fully Unarmored character (no armor of any type equipped) will take the full damage of an attack, regardless of their Unarmored skill.

With the corrector, the damage will be correctly reduced based on the character's armor rating.

For example, if the character has an Unarmored skill of 100 and is hit by a 50-point blow: with no armor at all and the corrector not running, they'll take 50 points of damage. That's the same amount they'd take with an Unarmored skill of zero: that is the Unarmored bug.

Start the corrector, and, with an Unarmored skill of 100, they'll take a little less than 25 points of damage from every 50 point blow: the rest of the blow's force is now deflected by their Unarmored skill. And that is how the Unarmored skill is supposed to work.

If you ever want to uninstall the Unarmored Corrector mod for some reason, first turn it off using the console command given above (and in your journal). This will stop the main script and cleanup any invisible helms in your character's inventory. Once you've shut the corrector down, save the game and exit. 
Now you can deselect the .esp file (and remove it entirely, if you want).

The next time you start the game, you may have to click past some error messages, but you should be able to continue playing normally without further errors.

Naturally, there's always a potential for problems when removing a mod that's part of your saved game. Always back up your current saved game before uninstalling any mods, and make a new separate saved game after removing mods.

When you use the console command given above to shut down the corrector, that stops the only script that runs in the background. A start up script will run for a fraction of a second each time the game is loaded, but other than that my corrector will be completely shut down. So there's no real need to actually uninstall the .esp: when shut down the corrector will have no effect on the game.

Miscellaneous notes:
1. NPCs in the game respond to your character's clothing based on the total value of everything you're wearing. My invisible helms have a value of zero, so they won't affect this.

Also, if the only thing your character is wearing is an invisible helm, NPCs will consider you nude (due to the zero value). This may be enough to satisfy the conditions for quests or encounters that require your character to be totally nude; if not, use the console command given above to temporarily shut down the corrector so it will stop giving you invisible helms.

2. One person discovered that if you go open and close the dialogue window quickly and your timing is just right, you may see messages in the dialogue window about an invisible helm being removed and added to your inventory.

The actual removal and adding takes place when the dialogue window is closed, but an apparent timing glitch in the game engine may cause messages to be displayed if the dialogue window is opened right after the removal/adding takes place.

You're not likely to see those messages very often, but if you do just ignore them: they're completely harmless.

Technical notes for modders:
In the process of creating and debugging these scripts, I had to deal with some other bugs and glitches in the game besides the Unarmored bug that was my primary target. Several people in Emma's private forum helped in figuring these issues out; I'll put the information here in case it's useful to other modders.

1. If a script generates more than one text message in a single frame, there's a possibility of a CTD. This applies not only to text produced by 'MessageBox' statements, but also to the 'Your journal has been updated' message generated by a 'Journal' statement. This is why my StartUpScript puts a one frame delay
between the '...activated' message and the 'Journal' statement: I had a couple of CTDs happen at start up when they were both displaying text in the same frame.

I haven't done any testing beyond the above, but it's possible that the CTDs may also be triggered if other text messages from the game show up too close together.

2. If the target of a targeted global script is not placed in the game world in the Construction Set, the script will lose its target each time the game is reloaded. For example, the 'Player' ID is not actually in the game world in the editor: it's placed there after you start a new game. In order to keep my Main script targeted on the player, the StartUpScript will stop and restart it, properly targeted on 'Player', each time the game is reloaded.

3. If the player is fighting Hand-to-Hand and has their hands readied (i.e., fists up in front of them), equipping or removing a piece of armor or clothing will cause the character to briefly 'twitch': they'll snap back to the normal standing position, hands at their side, then snap back to the H-to-H ready position. Normally, this is barely noticeable. However, with my script periodically equipping invisible helms, I had to add some extra timing tweaks and checks to keep this from being annoying.

Note that #3 is not just a graphics glitch: the value returned by GetWeaponDrawn' briefly returns to zero each time this happens.

1. The Other Felix, who discovered and reported the Unarmored bug, and who also made useful suggestions for my workaround.

2. The Lone Badger, whose 'Dream Armor for Morrowind' mod showed me how to create invisible armor, which probably saved me from a lot of hair pulling trying to figure it out for myself.

3. GhanBuriGhan: without his Scripting for Dummies, there's no way I could have done anything like this.

4. ManaUser: for taking the first look at the code, trying it in the game, and making some very helpful suggestions.

5. Emma, cdcooley, and Peter (aka ps33) for helpful information and suggestions.
A special thank you to Emma for letting me use her private forum, and providing encouragement and support in my modding efforts.

6. fragonard, torch, and OldeCow69: for Beta testing and useful feedback.

7. A whole bunch of people in the forums who asked questions, made suggestions, and provided invaluable input. I'm not going to list names, because I'd inevitably leave some of you out. But many thanks to all of you!

8. And last but by no means least: Dennis, aka Grumpy. Inspiration, motivation, example, and one heck of a great guy. Gone but not forgotten.

Support, distribution, permissions for use, etc.:
1. Support:

I visit the official Bethesda Morrowind Mods forum regularly, as well as several other Morrowind forums. You can reach me by PM at the Bethesda forums as 'DinkumThinkum', as well as at other Morrowind forums where you see me posting regularly.

2. Distribution:

Please do not upload this mod to any distribution sites. Let me take care of uploading it myself, so I know where all the copies are if I ever need to release any updates, bug fixes, etc.

If for some reason this mod is not available for download anywhere, please try to contact me. If nobody is able to contact me and the mod is not available for download anywhere for over a month, then the latest, unaltered version of this mod can be uploaded to one of the well-known major Morrowind mod download sites. But first make a genuine effort to contact me, and send me a PM and/or E-mail to let me know if you do upload it somewhere.

Note: Emma always has permission to put any mods or modders' resources I publicly release on her site.

3. Permissions:

Please do not distribute modified versions of this mod without my express consent, and please do not copy or modify my work and put your name on it.

Feel free to use my ideas as a starting point for writing your own scripts and creating your own mods, but please don't just copy my code: write your own. If you give me credit for whatever inspiration or ideas you gain from this, that will be appreciated.

If you have an idea for a mod that would incorporate my code along with your own code or other contributions, contact me first.

The companion version of this mod will be released as a modders' resource, intended for modders to freely use in their own projects for companions and other NPCs. I'll include separate permissions, etc. in that resource pack when I get it done (still in the early stages, but it's looking good so far).