[HELP] Finishing my Fists of Steel Script

Post » Wed Nov 20, 2013 1:19 am

Hey guys. A while back I posted about errors I had with my script, and you helped me out (just a little mix-up with values I would probably have never caught). Thanks a lot! I gave modding a break for a while, a much longer break than I planned on, and have come back for more help, with more errors.

My script should take the player's armor equipped, perks gained, and skill levels and calculate the current armor rating (not base armor) of the player's GAUNTLETS. It then adds it to their unarmed damage, and takes it away when they unequip. However, I cannot get the Matching Set perks to function correctly, nor the "Unison" perks, Custom Fit and Well Fitted.

I am at my wit's end, and frankly have no idea what the problem is, although I suspect it lies within my colored code below. Note that the Light and Heavy armor section are pretty much identical.

If anyone can help me out that'd be awesome, I wouldn't be asking if I didn't really need help.

EDIT: I guess colored code doesn't work here?

Scriptname PACFistsOfSteel extends ActorPerk Property FistsOfSteel AutoPerk Property WellFitted AutoPerk Property MatchingSetHeavy AutoPerk Property Juggernaut80 AutoPerk Property Juggernaut60 AutoPerk Property Juggernaut40 AutoPerk Property Juggernaut20 AutoPerk Property Juggernaut00 AutoPerk Property CustomFit AutoPerk Property MatchingSetLight AutoPerk Property AgileDefender80 AutoPerk Property AgileDefender60 AutoPerk Property AgileDefender40 AutoPerk Property AgileDefender20 AutoPerk Property AgileDefender00 AutoInt BonusClassInt NegativeHeavyInt NegativeLightEvent OnObjectEquipped(Form akBaseObject, ObjectReference akReference)	If (akBaseObject as Armor).GetSlotMask()==8		Float ArmorSkillHeavy		Float PercentArmorSkillHeavy		Float ActualArmorSkillHeavy		Float GauntletsArmorHeavy		Float UnisonHeavy		Float MatchingHeavy		Float HeavySet		Float HeavySetBonus		Float ArmorPerkHeavy		Int BonusHeavy		Float ArmorSkillLight		Float PercentArmorSkillLight		Float ActualArmorSkillLight		Float GauntletsArmorLight		Float UnisonLight		Float MatchingLight		Float LightSet		Float LightSetBonus		Float ArmorPerkLight		Int BonusLight		Armor Helmet = Game.GetPlayer().GetWornForm(0x00000001) as Armor		Int HelmetWeightClass		Armor Gauntlets = Game.GetPlayer().GetWornForm(0x00000008) as Armor		Int GauntletsWeightClass		Armor Cuirass = Game.GetPlayer().GetWornForm(0x00000004) as Armor		Int CuirassWeightClass		Armor Boots = Game.GetPlayer().GetWornForm(0x00000080) as Armor		Int BootsWeightClass		If Game.GetPlayer().HasPerk(FistsOfSteel)			HelmetWeightClass = Helmet.GetWeightClass()			GauntletsWeightClass = Gauntlets.GetWeightClass()			CuirassWeightClass = Cuirass.GetWeightClass()			BootsWeightClass = Boots.GetWeightClass()			If (GauntletsWeightClass == 1)				ArmorSkillHeavy = (Game.GetPlayer().GetActorValue("HeavyArmor")) as Float				PercentArmorSkillHeavy = (ArmorSkillHeavy * 0.0044444)				ActualArmorSkillHeavy = (PercentArmorSkillHeavy + 1)				GauntletsArmorHeavy = (Gauntlets.GetArmorRating()) as Float				BonusClass = 1				If Game.Getplayer().HasPerk(WellFitted)					If (HelmetWeightClass == 1)						If (CuirassWeightClass == 1)							If (BootsWeightClass == 1)								UnisonHeavy = 0.25							EndIf						EndIf					EndIf					Else					UnisonHeavy = 0.0				EndIf				If Game.Getplayer().HasPerk(MatchingSetHeavy)					If (HelmetWeightClass == 1)						If (CuirassWeightClass == 1)							If (BootsWeightClass == 1)								MatchingHeavy = 0.25							EndIf						EndIf					EndIf					Else					MatchingHeavy = 0.0				EndIf				HeavySet = (UnisonHeavy+MatchingHeavy)				HeavySetBonus = (1+HeavySet)				If Game.Getplayer().HasPerk(Juggernaut80)					ArmorPerkHeavy = 2 as Float					ElseIf (Game.Getplayer().HasPerk(Juggernaut60))					ArmorPerkHeavy = 1.8 as Float					ElseIf (Game.Getplayer().HasPerk(Juggernaut40))					ArmorPerkHeavy = 1.6 as Float					ElseIf (Game.Getplayer().HasPerk(Juggernaut20))					ArmorPerkHeavy = 1.4 as Float					ElseIf (Game.Getplayer().HasPerk(Juggernaut00))					ArmorPerkHeavy = 1.2 as Float					Else					ArmorPerkHeavy = 1 as Float				EndIf					BonusHeavy = (GauntletsArmorHeavy*ActualArmorSkillHeavy*HeavySetBonus*ArmorPerkHeavy) as Int					NegativeHeavy = (0-BonusHeavy)				Self.ModAV("UnarmedDamage", BonusHeavy)			ElseIf (GauntletsWeightClass == 0)				ArmorSkillLight = (Game.GetPlayer().GetActorValue("LightArmor")) as Float				PercentArmorSkillLight = (ArmorSkillLight * 0.0044444)				ActualArmorSkillLight = (PercentArmorSkillLight + 1)				GauntletsArmorLight = (Gauntlets.GetArmorRating()) as Float				BonusClass = 0				If Game.Getplayer().HasPerk(CustomFit)					If (HelmetWeightClass == 0)						If (CuirassWeightClass == 0)							If (BootsWeightClass == 0)								UnisonLight = 0.25							EndIf						EndIf					EndIf					Else					UnisonLight = 0				EndIf				If Game.Getplayer().HasPerk(MatchingSetLight)					If (HelmetWeightClass == 0)						If (CuirassWeightClass == 0)							If (BootsWeightClass == 0)								MatchingLight = 0.25							EndIf						EndIf					EndIf					Else					MatchingLight = 0				EndIf				LightSet = (UnisonLight+MatchingLight)				LightSetBonus = (1+LightSet)				If Game.Getplayer().HasPerk(AgileDefender80)					ArmorPerkLight = 2 as Float					ElseIf (Game.Getplayer().HasPerk(AgileDefender60))					ArmorPerkLight = 1.8 as Float					ElseIf (Game.Getplayer().HasPerk(AgileDefender40))					ArmorPerkLight = 1.6 as Float					ElseIf (Game.Getplayer().HasPerk(AgileDefender20))					ArmorPerkLight = 1.4 as Float					ElseIf (Game.Getplayer().HasPerk(AgileDefender00))					ArmorPerkLight = 1.2 as Float					Else					ArmorPerkLight = 1 as Float				EndIf					BonusLight = (GauntletsArmorLight*ActualArmorSkillLight*LightSetBonus*ArmorPerkLight) as Int					NegativeLight = (0-BonusLight)				Self.ModAV("UnarmedDamage", BonusLight)			EndIf		EndIf	EndIfEndEventEvent OnObjectUnequipped(Form akBaseObject, ObjectReference akReference)	If (akBaseObject as Armor).GetSlotMask()==8		If (BonusClass == 1)			Self.ModAV("UnarmedDamage", NegativeHeavy)		ElseIf (BonusClass == 0)			Self.ModAV("UnarmedDamage", NegativeLight)		EndIf	EndIfEndEvent
User avatar
Chad Holloway
 
Posts: 3388
Joined: Wed Nov 21, 2007 5:21 am

Return to V - Skyrim