this should already be working in released 1.3 update (minus thrown weapons, that could be easily updated). Scripts structure has changed, script logic has been moved to the shield local script, removing/readding an item to inventory could cause local item script to not run any more on re-add
[EDIT]small update 1.4 (missing thrown weapon fix) released
I tested the new 1.4 scripts, and I discovered that I definitely prefer the script to do nothing when unarmed/2h/etc. as opposed to placing the shield on your character's back in those cases. It just plays better. I can live with the possibility of the script not firing (never happened to me) and the shield auto-repairing (unfortunate, but not that big of a deal for me).
I like to use 3rd person animations while in 1st person mode, and the only downside to that was being unable to put away my shield when I sheathed my weapons -- this mod solves that issue.
There were a few conflicts with mpp 1.6.6b... nothing major, and most people probably wouldn't care.
More importantly, this esp also makes a few undocumented changes (which I'm fairly sure were carried over from the original):
two cell edits and a couple of added/modified npcs, a bunch of stat changes on shields (including changing the stamina enchantment found on Shield of the Undaunted).
All of those changes are unnecessary and change the balance of the game to some extent.
In the interest of sharing: If anyone wants my edited version with all of the above addressed, here you go: https://dl.dropboxusercontent.com/u/32777109/Mods/Morrowind/modded%20mods/Galleo_AW_Shields_Back_1.2lite.esp
The following (minor) issues have nothing to do with the esp in this download, but with the (required) textures/meshes in the original mod:
1) Minor issue (related to the removal of the shieldplacer code? dunno): The shields are rotated a handful of degrees when on your back, away from the shoulder with the missing pauldron. I could almost understand it if they were rotated towards that shoulder... to better avoid clipping issues... but that doesn't work so well in practice either way because the rotation causes clipping with elbows during the run animation (for me, anyways, with better bodies and animation compilation). But easilly rotated back in nifscope if anyone cares enough to, so it's a minor issue. There's a lot of meshes, so I'm doing them one by one as I acquire new shields in this playthrough.
2) An even more minor issue: Not all shields use a seperate inner texture (the side facing you when you hold the shield) ... which, again is changeable via nifscope (and then making a new texture for it), and it wouldn't be a problem for anyone not using 3rd person animations in 1st person mode.... so, it might only affect me.
3) Even more minor: A number of the textures used are of questionable quality, but I could say the same thing about the majority of textures found in texture enhancement mods, so I guess a lot of people like that over-sharpened-cracked-glazed-donut look . I sometimes use them as an overlay layer in photoshop, so they have some value even to people like me.
EDIT:
Upon closer inspection of the scripts used, will this work properly with player-enchanted shields?
UPDATE:
No. The _GL_ab_<shieldName>_sh_b script fails to work properly at the line:
If ( Player->GetItemCount "<shieldName>" > 0 )
... when the shield has a player-made enchantment on it. So, what happens is a shield is both on your back AND on your arm at the same time. It's probably better that it does fail here, because the alternative would be that you'd lose all the enchantments on your shield (because it would be removed from your inventory and lost forever).
While this could be quickly fixed (kinda) by adding a check to the _GL_ab_<shieldName>_Sh (note the absence of the _b) script through adding an additional check to see if the shield name you're assuming is equipped is actually equipped:
if ( OnPCEquip ) if ( Player->GetWeaponDrawn == 0 ) if ( Shield_NB == 0 ) ++if ( Player->GetWeaponType >= 0 ) ;'Added to fix unarmed bug ++If ( Player->HasItemEquipped "<shieldName>" ) ;Added to fix player-enchanted shields
... all that would do is make the mod do absolutely nothing with player-enchanted shields. Now, while that would be preferable to the current behavior, it does call into question whether the mod is worth installing at all because, at some point, you're going to put an enchantment on your shield. I think it is.
The beginning of a complete solution would be: instead of removing shields entirely in these cases, it simply unequips them, leaving two shields in the player's inventory -- the back shield (B_shield) and the player-enchanted shield (A_shield). The A_shield could be unequipped by equipping and unequipping a dummy shield object (unsure if that needs to happen in two separate frames).
... BUT, how would you re-equip the A_Shield upon entering combat? MWSE functions may come to the rescue here, but now things can get tricky and it would require a lot of testing to iron away the problems. I don't know if all that is worth doing (but I'd like to see someone else do it).
There's also the unarmed bug (this mod needs to do nothing when unarmed).
I'll fix this all this the quick way (I'd only need to edit half the scripts) and make it available for download.
Update2:
Here you go. It's playable with these script changes (load after this mod's esp):
I think you would need to access the mesh name and the new-enchanted_itemid from script to be able to swap player-enchanted objects, not something you can do so far IIRC.
I have included some of your changes in the update I was working on
I noticed another problem... similar to the unarmed issue, the script needs to do nothing with any weapon that's not a 1h handed weapon (due to the oddity that you can/should have a shield equipped when using a 2h weapon unless you're making an unarmored character)... so the "A" version of the script needs to have something like:
;'Added to fix 2h weapons and unarmed -- using Shield_AB as temp variable to make copy/pasting this fix easier set Shield_AB to Player->GetWeaponType if ( Shield_AB == 0 ) ;'1h shortswords elseif ( Shield_AB == 1 ) ;'1h longswords elseif ( Shield_AB == 3 ) ;'1h blunt elseif ( Shield_AB == 7 ) ;'1h axe else set Shield_AB to 0 return endif set Shield_AB to 0
... in there where my previous (1.0) fix would just check if GetWeaponType >= 0 (just replace that line with the above code and delete a now-extra endif).
So, instead of just doing nothing when the player is unarmed/using an enchanted shield, it would additionally do nothing if the equipped weapon is NOT a one-handed type.
It looks ugly, but the if branch is starting to get deep, so the above way makes it not get deeper.
I may do them all, call it 1.1, and make it available for download here.
EDIT:
It probably should also check for thrown weapons (11). Testing shows GetWeaponType doesn't actually seem to return 12 or 13 under any normal conditions, so no need to check for them. So:
elseif ( Shield_IB == 11 ) ;'thrown weapons
... would probably need to be added to the above code.
EDIT2:
I'm interested to know what your changes are in the planned update. I think any other improvements would require mwse functions... like it re-equipping the un-equipped pauldron. Unsure if that would be straight-forward to implement or not using xEquip (would need to store the stringname in a global). The same technique may work on enchanted shields provided they're not actually removed from the gameworld and instead stored somewhere safe so they don't appear in the player's inventory. I would just keep it in the player's inventory to be on the safe side.
EDIT3:
The original author decided to use different variable names for Shield_AB across the different shields... making it a joy to update the scripts. /sarcasm Why would anyone do that? It makes no sense. I'll just make seperate getweapontype function calls to keep myself sane... it doesn't really matter here:
;' Added to fix 2h weapons and unarmed -- code looks half-assed because it is; to make it easy to copy/paste the fix
Here you go: https://dl.dropboxusercontent.com/u/32777109/Mods/Morrowind/modded%20mods/GAWSB%201.2lite%20script%20fix%201.1.esp
... and there is no very good straightforward way to automatically re-equip the pauldron, even with mwse functions (was looking at xEquip and xRefId). It's possible, but I think it will probably crash the game occasionally. I'd check out how fliggerty managed it in his More Quick-Keys mod (http://www.fliggerty.com/phpBB3/viewtopic.php?t=1109), but the complexity is worrisome.
I think the balls-easiest way is to simply use a standard ingame quick-key for the pauldron, press it yourself, and call it a day. Going one step further than that, something could be whipped up using Autohotkey that would actually work well enough. I think I'll do that...
EDIT5:
This autohotkey script works with the ingame quickkey slot 9 to equip the pauldron when the F key is held down for 350 milliseconds... takes some practice to avoid screwing up. Too bad there's nothing visible onscreen when you're in combat mode, otherwise I'd do a screen tap... but I guess I could use one of the mwse file I/O functions instead (if I cared that much):
~*f:: If (FKeyDown) return FKeyDown := true SetTimer, WaitForRelease, 350; ~1/3 of a second return
~*f Up:: SetTimer, WaitForRelease, Off FKeyDown := false return
8 comments
Scripts structure has changed, script logic has been moved to the shield local script, removing/readding an item to inventory could cause local item script to not run any more on re-add
[EDIT]small update 1.4 (missing thrown weapon fix) released
I like to use 3rd person animations while in 1st person mode, and the only downside to that was being unable to put away my shield when I sheathed my weapons -- this mod solves that issue.
There were a few conflicts with mpp 1.6.6b... nothing major, and most people probably wouldn't care.
More importantly, this esp also makes a few undocumented changes (which I'm fairly sure were carried over from the original):
two cell edits and a couple of added/modified npcs, a bunch of stat changes on shields (including changing the stamina enchantment found on Shield of the Undaunted).
All of those changes are unnecessary and change the balance of the game to some extent.
In the interest of sharing: If anyone wants my edited version with all of the above addressed, here you go: https://dl.dropboxusercontent.com/u/32777109/Mods/Morrowind/modded%20mods/Galleo_AW_Shields_Back_1.2lite.esp
The following (minor) issues have nothing to do with the esp in this download, but with the (required) textures/meshes in the original mod:
1) Minor issue (related to the removal of the shieldplacer code? dunno): The shields are rotated a handful of degrees when on your back, away from the shoulder with the missing pauldron. I could almost understand it if they were rotated towards that shoulder... to better avoid clipping issues... but that doesn't work so well in practice either way because the rotation causes clipping with elbows during the run animation (for me, anyways, with better bodies and animation compilation). But easilly rotated back in nifscope if anyone cares enough to, so it's a minor issue. There's a lot of meshes, so I'm doing them one by one as I acquire new shields in this playthrough.
2) An even more minor issue: Not all shields use a seperate inner texture (the side facing you when you hold the shield) ... which, again is changeable via nifscope (and then making a new texture for it), and it wouldn't be a problem for anyone not using 3rd person animations in 1st person mode.... so, it might only affect me.
3) Even more minor: A number of the textures used are of questionable quality, but I could say the same thing about the majority of textures found in texture enhancement mods, so I guess a lot of people like that over-sharpened-cracked-glazed-donut look . I sometimes use them as an overlay layer in photoshop, so they have some value even to people like me.
EDIT:
Upon closer inspection of the scripts used, will this work properly with player-enchanted shields?
UPDATE:
No. The _GL_ab_<shieldName>_sh_b script fails to work properly at the line:
If ( Player->GetItemCount "<shieldName>" > 0 )
... when the shield has a player-made enchantment on it. So, what happens is a shield is both on your back AND on your arm at the same time. It's probably better that it does fail here, because the alternative would be that you'd lose all the enchantments on your shield (because it would be removed from your inventory and lost forever).
While this could be quickly fixed (kinda) by adding a check to the _GL_ab_<shieldName>_Sh (note the absence of the _b) script through adding an additional check to see if the shield name you're assuming is equipped is actually equipped:
if ( OnPCEquip )
if ( Player->GetWeaponDrawn == 0 )
if ( Shield_NB == 0 )
++if ( Player->GetWeaponType >= 0 ) ;'Added to fix unarmed bug
++If ( Player->HasItemEquipped "<shieldName>" ) ;Added to fix player-enchanted shields
... all that would do is make the mod do absolutely nothing with player-enchanted shields. Now, while that would be preferable to the current behavior, it does call into question whether the mod is worth installing at all because, at some point, you're going to put an enchantment on your shield. I think it is.
The beginning of a complete solution would be: instead of removing shields entirely in these cases, it simply unequips them, leaving two shields in the player's inventory -- the back shield (B_shield) and the player-enchanted shield (A_shield). The A_shield could be unequipped by equipping and unequipping a dummy shield object (unsure if that needs to happen in two separate frames).
... BUT, how would you re-equip the A_Shield upon entering combat? MWSE functions may come to the rescue here, but now things can get tricky and it would require a lot of testing to iron away the problems. I don't know if all that is worth doing (but I'd like to see someone else do it).
There's also the unarmed bug (this mod needs to do nothing when unarmed).
I'll fix this all this the quick way (I'd only need to edit half the scripts) and make it available for download.
Update2:
Here you go. It's playable with these script changes (load after this mod's esp):
https://dl.dropboxusercontent.com/u/32777109/Mods/Morrowind/modded%20mods/GAWSB%201.2lite%20script%20fix%201.0.esp
I have included some of your changes in the update I was working on
I noticed another problem... similar to the unarmed issue, the script needs to do nothing with any weapon that's not a 1h handed weapon (due to the oddity that you can/should have a shield equipped when using a 2h weapon unless you're making an unarmored character)... so the "A" version of the script needs to have something like:
;'Added to fix 2h weapons and unarmed -- using Shield_AB as temp variable to make copy/pasting this fix easier
set Shield_AB to Player->GetWeaponType
if ( Shield_AB == 0 ) ;'1h shortswords
elseif ( Shield_AB == 1 ) ;'1h longswords
elseif ( Shield_AB == 3 ) ;'1h blunt
elseif ( Shield_AB == 7 ) ;'1h axe
else
set Shield_AB to 0
return
endif
set Shield_AB to 0
... in there where my previous (1.0) fix would just check if GetWeaponType >= 0 (just replace that line with the above code and delete a now-extra endif).
So, instead of just doing nothing when the player is unarmed/using an enchanted shield, it would additionally do nothing if the equipped weapon is NOT a one-handed type.
It looks ugly, but the if branch is starting to get deep, so the above way makes it not get deeper.
I may do them all, call it 1.1, and make it available for download here.
EDIT:
It probably should also check for thrown weapons (11). Testing shows GetWeaponType doesn't actually seem to return 12 or 13 under any normal conditions, so no need to check for them. So:
elseif ( Shield_IB == 11 ) ;'thrown weapons
... would probably need to be added to the above code.
EDIT2:
I'm interested to know what your changes are in the planned update. I think any other improvements would require mwse functions... like it re-equipping the un-equipped pauldron. Unsure if that would be straight-forward to implement or not using xEquip (would need to store the stringname in a global). The same technique may work on enchanted shields provided they're not actually removed from the gameworld and instead stored somewhere safe so they don't appear in the player's inventory. I would just keep it in the player's inventory to be on the safe side.
EDIT3:
The original author decided to use different variable names for Shield_AB across the different shields... making it a joy to update the scripts. /sarcasm Why would anyone do that? It makes no sense. I'll just make seperate getweapontype function calls to keep myself sane... it doesn't really matter here:
;' Added to fix 2h weapons and unarmed -- code looks half-assed because it is; to make it easy to copy/paste the fix
if ( Player->GetWeaponType == 0 ) ;' 1h shortswords
elseif ( Player->GetWeaponType == 1 ) ;' 1h longswords
elseif ( Player->GetWeaponType == 3 ) ;' 1h blunt
elseif ( Player->GetWeaponType == 7 ) ;' 1h axe
elseif ( Player->GetWeaponType == 11 ) ;' thrown weapons
else
return
endif
if ( 1 ) ;supreme half-assedness
EDIT4:
Here you go: https://dl.dropboxusercontent.com/u/32777109/Mods/Morrowind/modded%20mods/GAWSB%201.2lite%20script%20fix%201.1.esp
... and there is no very good straightforward way to automatically re-equip the pauldron, even with mwse functions (was looking at xEquip and xRefId). It's possible, but I think it will probably crash the game occasionally. I'd check out how fliggerty managed it in his More Quick-Keys mod (http://www.fliggerty.com/phpBB3/viewtopic.php?t=1109), but the complexity is worrisome.
I think the balls-easiest way is to simply use a standard ingame quick-key for the pauldron, press it yourself, and call it a day. Going one step further than that, something could be whipped up using Autohotkey that would actually work well enough. I think I'll do that...
EDIT5:
This autohotkey script works with the ingame quickkey slot 9 to equip the pauldron when the F key is held down for 350 milliseconds... takes some practice to avoid screwing up. Too bad there's nothing visible onscreen when you're in combat mode, otherwise I'd do a screen tap... but I guess I could use one of the mwse file I/O functions instead (if I cared that much):
~*f::
If (FKeyDown)
return
FKeyDown := true
SetTimer, WaitForRelease, 350; ~1/3 of a second
return
~*f Up::
SetTimer, WaitForRelease, Off
FKeyDown := false
return
WaitForRelease:
SetTimer, WaitForRelease, Off
Send, {9 down}
Sleep 30
Send, {9 up}
return