GetWeightClass - Armor

From the CreationKit Wiki
Jump to navigation Jump to search

SKSE Member of: Armor Script

Returns the weight class of the armor. (This function requires SKSE)

Syntax[edit | edit source]

int Function GetWeightClass() native

Parameters[edit | edit source]

None.

Return Value[edit | edit source]

An integer representing the weight class of the armor:

  • 0 = Light
  • 1 = Heavy
  • 2 = None

Examples[edit | edit source]

Armor PlayerShield = Game.GetPlayer().GetEquippedShield()
if (PlayerShield)
	int WeightClass = PlayerShield.GetWeightClass()
	if (WeightClass == 0)
		Debug.Trace("Player is equipped with a light shield.")
	elseif (WeightClass == 1)
		Debug.Trace("Player is equipped with a heavy shield.")
	else
		Debug.Trace("Strange! The player has a shield equipped, but it's neither light nor heavy.")
	endif
else
	Debug.Trace("Player doesn't have an equipped shield.")
endif

See Also[edit | edit source]