Dynamically adding crime gold when equipping an item

Post » Sat Aug 30, 2014 9:22 am

I'm trying to add some functionality to a mod I created that gives you a bounty in all holds when equipped, and removes it when the item is unequipped. I don't know where to begin, can anybody help me with a starting point?

User avatar
Epul Kedah
 
Posts: 3545
Joined: Tue Oct 09, 2007 3:35 am

Post » Sat Aug 30, 2014 6:11 pm

Indeed. I've done a similar thing. I'm assuming you've got a basic knowledge of scripting. Put this script on your item:

Scriptname BountyScript Extends Weapon; or ammo, or armor, or whatever it should extendFaction[] Property CrimeFactions Auto ;fill this array with all of the factions in Skyrim, I believe they all start with CrimeFactionActor Property PlayerREF Auto ;autofill this propertyInt iIndexEvent OnEquipped(Actor akActor)	If akActor == PlayerREF		iIndex = CrimeFactions.Length		While iIndex			CrimeFactions[iIndex].ModCrimeGold(100); change 100 to what you want the bounty to be, add a true if you want it to be a violent crime			iIndex -= 1		EndWhile	EndIfEndEventEvent OnUnequipped(Actor akActor)	If akActor == PlayerREF 		iIndex = CrimeFactions.Length		While iIndex			CrimeFactions[iIndex].ModCrimeGold(-100); replace 100 with the number you used a bove		EndWhile	EndIfEndEvent

If you want to set the crime gold in all factions to 0 after unequipping, change ModCrimeGold to SetCrimeGold(0). Be sure to fill the array property.

User avatar
Leilene Nessel
 
Posts: 3428
Joined: Sun Apr 15, 2007 2:11 am


Return to V - Skyrim