I have a question about armor.
Is there any way to restrict a certain armor type from being worn by the PC through scripting?
Example, restricting the PC from wearing any type of heavy armor. Any ideas on how to do this would be greatly appreciated.
Restrict armor
#1
Posté 19 mars 2015 - 05:15
#2
Posté 19 mars 2015 - 07:03
The usual way to do this is in the module OnPlayerEquipItem event. For example, here is the CEP script which prevents wearing items if the custom gender restriction applies:
In your example of heavy armour, you could check GetBaseItemType instead.
#3
Posté 19 mars 2015 - 12:40
The armors will all have the same baseitem type so it gets a little more complicated. The type of the armor is based on the chest part's ACBONUS value, which in turn determines if it's light, medium or heavy.
int nTorso = GetItemAppearance( oItem, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_TORSO); // Read 2DA for base AC string sACBase = Get2DAString( "parts_chest","ACBONUS", nTorso); int nAC = StringToInt(sACBase);
Then use nAC to determine if you consider this heavy armor or not. I think the game uses >= 6 for heavy. Of course you'll want to check the base item type is armor before using the above or won't mean much.
- Kato - aime ceci
#4
Posté 19 mars 2015 - 05:52
lol I remembered that shortly after posting - thanks for the correction.The armors will all have the same baseitem type so it gets a little more complicated....
#5
Posté 19 mars 2015 - 08:33
I thought you probably knew that
I was just giving a more complete soultion rather than trying to correct you.
- Proleric aime ceci
#6
Posté 19 mars 2015 - 11:03





Retour en haut






