Difference between revisions of "Armor Script"

1,064 bytes added ,  16:25, 7 June 2018
imported>Fg109
m (Accidentally erased everything else)
imported>Quindraco
 
(25 intermediate revisions by 8 users not shown)
Line 1: Line 1:
[[Category:Scripting]]
'''Extends:''' [[Form Script]]
[[Category:Papyrus]]
[[Category:Script Objects]]
 
'''Extends:''' [[Form Script (Papyrus)]]


Script for the manipulation of armor base objects.
Script for the manipulation of armor base objects.
Line 11: Line 7:
ScriptName Armor extends Form
ScriptName Armor extends Form
</source>
</source>
== Properties ==
None
== Global Functions ==
None


== Member Functions ==
== Member Functions ==
None


== SKSE Member Functions ==
== Special Edition Exclusive Functions ==
'''Int Function [[GetArmorRating - Armor|GetArmorRating]]()'''
*Returns the armor rating for this armor.


'''Int Function [[GetArmorRating - Armor|GetAR]]()'''
'''Float [[GetWarmthRating - Armor|GetWarmthRating]]()'''
*Alias for GetArmorRating().
*Obtains the total "warmth rating" for the armor


'''Function [[SetArmorRating - Armor|SetArmorRating]](int armorRating)'''
== SKSE Properties ==
*Sets the armor rating for this armor to the specified value.
*[[Slot Masks - Armor|List of Slot Masks]]


'''Function [[SetArmorRating - Armor|SetAR]](int armorRating)'''
*Alias for SetArmorRating().


'''Function [[ModArmorRating - Armor|ModArmorRating]](int modBy)'''
== SKSE Global Functions ==
*Modifies the armor rating for this armor by the specified amount.


'''Function [[ModArmorRating - Armor|ModAR]](int modBy)'''
:'''Int [[GetMaskForSlot - Armor|GetMaskForSlot]](Int ''slot'')'''
*Alias for ModArmorRating().
:*Returns the slotmask for a single slot.


'''String Function [[GetModelPath - Armor|GetModelPath]](bool bFemalePath)'''
*Returns the file path for the nif file representing the world model of the armor.


'''Function [[SetModelPath - Armor|SetModelPath]](string path, bool bFemalePath)'''
== SKSE Member Functions ==
*Sets the file path for the nif file representing the world model of the armor to the specified path.


'''String Function [[GetIconPath - Armor|GetIconPath]](bool bFemalePath)'''
:;Int [[GetArmorRating - Armor|GetArmorRating]]()
*Returns the file path for the nif file representing the icon for the armor in the inventory.
:*Returns the armor rating for this armor.
:;Int [[GetArmorRating - Armor|GetAR]]()
:*Alias for GetArmorRating().
:;[[SetArmorRating - Armor|SetArmorRating]](Int ''armorRating'')
:*Sets the armor rating for this armor to the specified value.
:;[[SetArmorRating - Armor|SetAR]](Int ''armorRating'')
:*Alias for SetArmorRating().
:;[[ModArmorRating - Armor|ModArmorRating]](Int ''modBy'')
:*Modifies the armor rating for this armor by the specified amount.
:;[[ModArmorRating - Armor|ModAR]](Int ''modBy'')
:*Alias for ModArmorRating().
:;String [[GetModelPath - Armor|GetModelPath]](Bool ''bFemalePath'')
:*Returns the file path for the nif file representing the world model of the armor.
:;[[SetModelPath - Armor|SetModelPath]](String ''path'', Bool ''bFemalePath'')
:*Sets the file path for the nif file representing the world model of the armor to the specified path.
:;String [[GetIconPath - Armor|GetIconPath]](Bool ''bFemalePath'')
:*Returns the file path for the nif file representing the icon for the armor in the inventory.
:;[[SetIconPath - Armor|SetIconPath]](String ''path'', Bool ''bFemalePath'')
:*Sets the file path for the nif file representing the icon for the armor in the inventory to the specified path.
:;String [[GetMessageIconPath - Armor|GetMessageIconPath]](Bool ''bFemalePath'')
:*Returns the file path for the nif file representing the message icon for the armor.
:;[[SetMessageIconPath - Armor|SetMessageIconPath]](String ''path'', Bool ''bFemalePath'')
:*Sets the file path for the nif file representing the message icon for the armor to the specified path.
:;Int [[GetWeightClass - Armor|GetWeightClass]]()
:*Returns the weight class of the armor: 0 for Light, 1 for Heavy, 2 for None.
:;[[SetWeightClass - Armor|SetWeightClass]](Int ''weightClass'')
:*Sets the weight class of the armor to the specified weight class.
:;Enchantment [[GetEnchantment - Armor|GetEnchantment]]()
:*Returns the Enchantment associated with the Armor
:;[[SetEnchantment - Armor|SetEnchantment]](Enchantment ''e'')
:*Set the Enchantment associated with the Armor
:;Int [[GetSlotMask - Armor|GetSlotMask]]()
:*Returns the slot mask for the armor.
:;[[SetSlotMask - Armor|SetSlotMask]](Int ''slotMask'')
:*Sets the slot mask for the armor.
:;Int [[AddSlotToMask - Armor|AddSlotToMask]](Int ''slotMask'')
:*Adds the specified slotmask to the armor and returns the new slot mask for the armor.
:;Int [[RemoveSlotFromMask - Armor|RemoveSlotFromMask]](Int ''slotMask'')
:*Removes the specified slotmask from the armor and returns the new slot mask for the armor.
:;Int [[GetNumArmorAddons - Armor|GetNumArmorAddons]]()
:*Returns the number of armor addons for this armor.
:;ArmorAddon [[GetNthArmorAddon - Armor|GetNthArmorAddon]](Int ''n'')
:*Returns the nth armor addon for this armor.


'''Function [[SetIconPath - Armor|SetIconPath]](string path, bool bFemalePath)'''
===Convenience functions that check for a keyword.===
*Sets the file path for the nif file representing the icon for the armor in the inventory to the specified path.


'''String Function [[GetMessageIconPath - Armor|GetMessageIconPath]](bool bFemalePath)'''
All of these simply check for a keyword - they're one line functions defined as:
*Returns the file path for the nif file representing the message icon for the armor.


'''Function [[SetMessageIconPath - Armor|SetMessageIconPath]](string path, bool bFemalePath)'''
  bool Function funcName()
*Sets the file path for the nif file representing the message icon for the armor to the specified path.
      return HasKeywordString("RelevantKeyword")
  endFunction


'''Int Function [[GetWeightClass - Armor|GetWeightClass]]()'''
As a result, you can fill in your own for "missing" convenience functions (such as IsClothingNecklace for Amulets/Necklaces, and IsClothingCirclet for Circlets) by writing your own with the appropriate keywords (ClothingNecklace and ClothingCirclet, respectively).  As another result, these ''do not'' use the above functions (for example, IsLightArmor and IsHeavyArmor, unlike the GetWeightClass function above, ''check for a keyword'', rather than actually checking the underlying armor form's armor skill).  
*Returns the weight class of the armor.


'''Function [[SetWeightClass - Armor|SetWeightClass]](int weightClass)'''
:;Bool [[IsLightArmor - Armor|IsLightArmor]]()
*Sets the weight class of the armor to the specified weight class.
:*Is this light armor?
:;Bool [[IsHeavyArmor - Armor|IsHeavyArmor]]()
:*Is this heavy armor?
:;Bool [[IsClothing - Armor|IsClothing]]()
:*Is this clothing?
:;Bool [[IsBoots - Armor|IsBoots]]()
:*Are these boots?
:;Bool [[IsCuirass - Armor|IsCuirass]]()
:*Is this a cuirass?
:;Bool [[IsGauntlets - Armor|IsGauntlets]]()
:*Are these gauntlets?
:;Bool [[IsHelmet - Armor|IsHelmet]]()
:*Is this a helmet?
:;Bool [[IsShield - Armor|IsShield]]()
:*Is this a shield?
:;Bool [[IsJewelry - Armor|IsJewelry]]()
:*Is this a piece of jewelry?
:;Bool [[IsClothingHead - Armor|IsClothingHead]]()
:*Is this a hat/circlet?
:;Bool [[IsClothingBody - Armor|IsClothingBody]]()
:*Is this a shirt/pants/dress?
:;Bool [[IsClothingFeet - Armor|IsClothingFeet]]()
:*Are these shoes?
:;Bool [[IsClothingHands - Armor|IsClothingHands]]()
:*Are these gloves?
:;Bool [[IsClothingRing - Armor|IsClothingRing]]()
:*Is this a ring?
:;Bool [[IsClothingRich - Armor|IsClothingRich]]()
:*Is this rich clothing?
:;Bool [[IsClothingPoor - Armor|IsClothingPoor]]()
:*Is this poor clothing?


'''Bool Function [[IsLightArmor - Armor|IsLightArmor]]()'''
[[Category:Scripting]]
*Is this light armor?
[[Category:Papyrus]]
 
[[Category:Script Objects]]
'''Bool Function [[IsHeavyArmor - Armor|IsHeavyArmor]]()'''
[[Category:SKSE]]
*Is this heavy armor?
[[Category:SKSE Script Objects]]
 
'''Bool Function [[IsClothing - Armor|IsClothing]]()'''
*Is this clothing?
 
'''Bool Function [[IsBoots - Armor|IsBoots]]()'''
*Are these boots?
 
'''Bool Function [[IsCuirass - Armor|IsCuirass]]()'''
*Is this a cuirass?
 
'''Bool Function [[IsGauntlets - Armor|IsGauntlets]]()'''
*Are these gauntlets?
 
'''Bool Function [[IsHelmet - Armor|IsHelmet]]()'''
*Is this a helmet?
 
'''Bool Function [[IsShield - Armor|IsShield]]()'''
*Is this a shield?
 
'''Bool Function [[IsJewelry - Armor|IsJewelry]]()'''
*Is this a piece of jewelry?
 
'''Bool Function [[IsClothingHead - Armor|IsClothingHead]]()'''
*Is this a hat/circlet?
 
'''Bool Function [[IsClothingBody - Armor|IsClothingBody]]()'''
*Is this a shirt/pants/dress?
 
'''Bool Function [[IsClothingFeet - Armor|IsClothingFeet]]()'''
*Are these shoes?
 
'''Bool Function [[IsClothingHands - Armor|IsClothingHands]]()'''
*Are these gloves?
 
'''Bool Function [[IsClothingRing - Armor|IsClothingRing]]()'''
*Is this a ring?
 
'''Bool Function [[IsClothingRich - Armor|IsClothingRich]]()'''
*Is this rich clothing?
 
'''Bool Function [[IsClothingPoor - Armor|IsClothingPoor]]()'''
*Is this poor clothing?
 
'''Int Function [[GetSlotMask - Armor|GetSlotMask]]()'''
*Returns the slot mask for the armor.
 
'''Function [[SetSlotMask - Armor|SetSlotMask]](int slotMask)'''
*Sets the slot mask for the armor.
 
'''Int Function [[AddSlotToMask - Armor|AddSlotToMask]](int slotMask)'''
*Adds the specified slotmask to the armor and returns the new slot mask for the armor.
 
'''Int Function [[RemoveSlotFromMask - Armor|RemoveSlotFromMask]](int slotMask)'''
*Removes the specified slotmask from the armor and returns the new slot mask for the armor.
 
'''Int Function [[GetMaskForSlot- Armor|GetMaskForSlot]](int slot)'''
*Returns the slotmask for a single slot.
 
== Events ==
None
Anonymous user