Armor Limitation

Post » Fri Feb 18, 2011 8:45 pm

Hello!

I resently finished a script that puts limitations to weapon use, according to the class of the npc. It divides th generic types of weapons into smaller ones (Example: Blade = (Dagger, Shortsword, Longsword), Blunt = (Mace,Axe,2hAxe,2hMace) using weapon type and weapon reach.

So i decided to make some limitations on armor use as well (Split armor to 3 categories (Light, Medium, Heavy) accoring to their weight). I found the situation too hard for that because, the armor is made from many different pieces, thing that nee too much typing and work to be done.

Can anywone really knows any easy way to make a sub category of armor, with the use of weight? I mean If i can make Chainmail count as a MediumArmor in my scripts (i dont care for skill advancement) so I can put limits to the classes (example: Bard can wear light armor and some pieces of heavy armor (the lighter ones that count as medium) but no really heavy armor like Daedric.

Thanks in advance...
User avatar
Marquis T
 
Posts: 3425
Joined: Fri Aug 31, 2007 4:39 pm

Post » Sat Feb 19, 2011 1:51 am

I to approached this same problem went making a Requirements mod a while back....I couldnt really find an easy solution :shrug:
User avatar
RAww DInsaww
 
Posts: 3439
Joined: Sun Feb 25, 2007 5:47 pm

Post » Fri Feb 18, 2011 11:30 pm

Does it have to be by weight? Duke Patrick's Combat Archery mod looks for key words (eg. 'ebony', 'glass', 'grummite' etc.) in the name of bows and arrows to assess their quality and thus their damage. Wouldn't this method be applicable here? I realise mod-added armour with unique names (rather than material based) would complicate matters but in lieu of something better...
User avatar
Britta Gronkowski
 
Posts: 3475
Joined: Mon Apr 09, 2007 3:14 pm

Post » Fri Feb 18, 2011 7:25 pm

Assign target weights to each body slot and test the weight of the piece occupying that slot. To get your target weights, just look at the weights in the CS and decide where you want your breakdown. For example, helmets that weigh < 1.8 units are light (eg. leather, fur), that weigh >= 1.8 && < 5 are medium (eg. chainmail, glass, elven, mithril) and > 5 are heavy (iron, orcish, steel, etc.). Bound armor is weight 0, so spellcasters would still be able to wear it. Assuming mod-added armors use reasonable weights, they should comply automatically. You'll have to remember to check for armor pieces that occupy multiple slots, like a set of greaves that includes boots, for example.
User avatar
Jason Wolf
 
Posts: 3390
Joined: Sun Jun 17, 2007 7:30 am

Post » Sat Feb 19, 2011 3:41 am


Assign target weights to each body slot and test the weight of the piece occupying that slot. To get your target weights, just look at the weights in the CS and decide where you want your breakdown.


What do you mean when you say that?

All the items in the SC have a certain weight, but i think it changes depending the person who wears it. For example a high skill in heavy armor, makes it weight less than before. So the wight is a variable characteristic, that will change in time, causing problems to my mod.

I personally think for ArmorRating... and i m looking if it changes during the game.
What do you think?
User avatar
Dylan Markese
 
Posts: 3513
Joined: Sat Dec 01, 2007 11:58 am

Post » Fri Feb 18, 2011 8:40 pm

Each piece of armor or clothing occupies one or more slots (in the CS they're found in the 'Biped Object' list of each object's dialogue). You can use the http://cs.elderscrolls.com/constwiki/index.php/GetBipedSlotMask function to get the slots occupied by any equippable object and then compare the weight of the object against a list of weights that you have decided best categorize a piece of armor as light, medium or heavy (as I suggested in the last post). The http://cs.elderscrolls.com/constwiki/index.php/GetWeight function returns the weight of the base object, which shouldn't change regardless of the player's skill, but I don't know how the game modifies the weight based on perks so you'd have to test it to be sure. That to me seems like the most straightforward solution. I'd be less confident about testing the Armor Rating since modders are known for doing things like assigning outrageous armor ratings to 'ordinary clothing' so they can look good without getting slaughtered in a fight. Whether or not a class can use the armor should depend more on how bulky and complex the armor is than on how much protection it provides. (Otherwise, you're going to have a lot of annoyed mages who can't wear enchanted armor-robes.)
User avatar
Cameron Wood
 
Posts: 3384
Joined: Wed Oct 31, 2007 3:01 pm

Post » Sat Feb 19, 2011 5:08 am


Assign target weights to each body slot and test the weight of the piece occupying that slot. To get your target weights, just look at the weights in the CS and decide where you want your breakdown.


What do you mean when you say that?

All the items in the SC have a certain weight, but i think it changes depending the person who wears it. For example a high skill in heavy armor, makes it weight less than before. So the wight is a variable characteristic, that will change in time, causing problems to my mod.

I personally think for ArmorRating... and i m looking if it changes during the game.
What do you think?


You are mistaken........when you have a high heavy armor for example, the weight reduction is only applied when you are wearing the armor piece, if you look you'll see the the weight of armor never actually changes, with the armor peck it just isnt applied at higher levels.USing GetWieght will always return the right value regradless of perks.
User avatar
Gavin Roberts
 
Posts: 3335
Joined: Fri Jun 08, 2007 8:14 pm

Post » Sat Feb 19, 2011 1:26 am

Just my contribution for valuable help! (A sample script for Weapon-Armor limitations for MONK)
I just get only 1 bug with daggers (When generally I give dagger to any character, it dissappers from his/her inventrory)
Dunno why... :P But the rest work just fine :)


The weapon reach numbers is from OOO (Oblivion Overhaul) so if someone want to use it for normal game he/she must change it.
Always a couple of numbers lower than the official reach number, because it will not work.

ref Weapon
ref Helmet
ref Chest
ref Greaves
ref Gauntlets
ref Boots
ref Shield
short WeaponType
float HelmetWeight
float ChestWeight
float GreavesWeight
float GauntletsWeight
float BootsWeight
float ShieldWeight
float WeaponSkill
float fQuestDelayTime

set NPC01 to GetSelf
set Weapon to NPC01.GetEquippedObject 16
set Weapontype to GetWeaponType Weapon
set WeaponSkill to GetWeaponReach Weapon
set Helmet to NPC01.GetEquippedObject 0
set Chest to NPC01.GetEquippedObject 2
set Greaves to NPC01.GetEquippedObject 3
set Gauntlets to NPC01.GetEquippedObject 4
set Boots to NPC01.GetEquippedObject 5
set Shield to NPC01.GetEquippedObject 13
set HelmetWeight to NPC01.GetWeight Helmet
set ChestWeight to NPC01.GetWeight Chest
set GreavesWeight to NPC01.GetWeight Greaves
set GauntletsWeight to NPC01.GetWeight Gauntlets
set BootsWeight to NPC01.GetWeight Boots
set ShieldWeight to NPC01.GetWeight Shield

;Weapon Limits for MONK (Can us only Mace, Light armor)
If NPC01Class == 14
If ( WeaponType == 0 ) && ( WeaponSkill >= 0.4900) && ( WeaponSkill <= 0.5100)
NPC01.RemoveItem weapon 1
Player.Additem weapon 1
elseif ( WeaponType == 0 ) && ( WeaponSkill >= 0.7400) && ( WeaponSkill <= 0.7600)
NPC01.RemoveItem weapon 1
Player.Additem weapon 1
elseIf ( WeaponType == 0 ) && ( WeaponSkill >= 0.8900) && ( WeaponSkill <= 0.9100)
NPC01.RemoveItem weapon 1
Player.Additem weapon 1
elseIf WeaponType == 1
NPC01.RemoveItem weapon 1
Player.Additem weapon 1
elseIf ( WeaponType == 2 ) && ( WeaponSkill >= 0.6400) && ( WeaponSkill <= 0.6600)
NPC01.RemoveItem weapon 1
Player.Additem weapon 1
elseIf ( WeaponType == 3 ) && ( WeaponSkill >= 0.8900 ) && ( WeaponSkill <= 0.9100 )
NPC01.RemoveItem weapon 1
Player.Additem weapon 1
elseIf ( WeaponType == 3 ) && ( WeaponSkill >= 0.9900 ) && ( WeaponSkill <= 1.0100 )
NPC01.RemoveItem weapon 1
Player.Additem weapon 1
ElseIf ( WeaponType == 4 )
NPC01.RemoveItem weapon 1
Player.Additem weapon 1
ElseIf ( WeaponType == 5 )
NPC01.RemoveItem weapon 1
Player.Additem weapon 1
endif
If ( HelmetWeight > 2.50 )
NPC01.RemoveItem Helmet 1
Player.Additem Helmet 1
endif
If ( ChestWeight > 12.90 )
NPC01.RemoveItem Chest 1
Player.Additem Chest 1
endif
If ( GreavesWeight > 7.70 )
NPC01.RemoveItem Greaves 1
Player.Additem Greaves 1
endif
If ( GauntletsWeight > 2.50 )
NPC01.RemoveItem Gauntlets 1
Player.Additem Gauntlets 1
endif
If ( BootsWeight > 3.80 )
NPC01.RemoveItem Boots 1
Player.Additem Boots 1
endif
If ( ShieldWeight > 0.10 )
NPC01.RemoveItem Shield 1
Player.Additem Shield 1
endif
endif
User avatar
stevie trent
 
Posts: 3460
Joined: Thu Oct 11, 2007 3:33 pm


Return to IV - Oblivion