Dooge Posted August 8, 2016 Posted August 8, 2016 So this always says false even if the item is clothing or armor bool function IsArmor(Form akItem) if (akItem as armor).IsLightArmor() || (akItem as Armor).IsHeavyArmor() || (akItem as Armor).IsClothing() \ || (akItem as Armor).IsBoots() || (akItem as Armor).IsCuirass() || (akItem as Armor).IsGauntlets() || (akItem as Armor).IsHelmet() \ || (akItem as Armor).IsShield() || (akItem as Armor).IsJewelry() || (akItem as Armor).IsClothingHead() \ || (akItem as Armor).IsClothingBody() || (akItem as Armor).IsClothingFeet() || (akItem as Armor).IsClothingHands() \ || (akItem as Armor).IsClothingRing() || (akItem as Armor).IsClothingRich() || (akItem as Armor).IsClothingPoor() return true else return false endif endfunction How do I test what type of an item I have?
WraithSlayer Posted August 8, 2016 Posted August 8, 2016 If you don't mind having a SKSE dependency, and all you want is TRUE when the form is an armor/clothing, and FALSE otherwise, then this will do: If (akItem.GetType() == 26) return true Else return false EndIf Why 26? Reference. If that's not an option, then you'll want to check if akItem in your code is actually being successfully cast into an Armor. If not, then you'll always just get FALSE and a bunch of Papyrus log errors.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.