Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Help with a Script


Malonn
 Share

Recommended Posts

Hi,

I'm stuck.  I've a function script that checks to see if the player is wearing all of one type of armor (light or heavy).  If the player is wearing all one type, the scripts then boost the armor rating by 20%.  No problem.  I've got that working.  My problem is if the player changes 1 or more armor pieces, I want to boost those new pieces by 20% too, without adding 20% more of a boost to the armor that didn't get changed (so already has a 20% boost).  Here's the complete set boosting script:

ScriptName FnBoostArmorRating

Array_var avTempB
Array_var avBoostEquip
Ref rCurBoost
Float fRating
Float fBoost

Begin Function { }

Let avTempB := ar_Construct StringMap
	Let avBoostEquip := Player.GetEquippedItems
	ForEach avTempB <- avBoostEquip
		Let rCurBoost := avTempB["value"]
		If IsArmor rCurBoost == 1
			Let fRating := GetArmorAR rCurBoost
			Let fBoost := fRating * 0.20
			Player.ModArmorAR fBoost rCurBoost
		Endif
	Loop

End

Any ideas?  Thanks.

Edited by Malonn
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...