Jump to content

need some help with scripting for UIExtensions


Recommended Posts

I've been working on my own version of an attribute mod hosted here on the nexus that uses SkyUI and the UIExtensions addon and so far I've made decent progress with the changes I've been trying to male. unfortunately, i've run into a problem where I can't figure out how to get a particular menu function working. You see, the base mod allows the player to allocate points through a point buy system to increase stats up to a particular limit, but my version will have the attributes set in stone at character creation based off of their race and sex. During the state allocation process, the player can click on any of the stats to increase or decrease the amount of points put into them, but I've changed it to simply show the current bonuses that are being granted by those stats.

For some reason however, I can't figure out how on earth the OG mod author made it so one particular option will send the player back to the state selection screen. As I've deleted and redone much of the code I'm not sure how to re-add that particular functionality and there appear to be other issues that are causing crashes and issues getting it to work in game. Can anyone here look through this code and tell me how to get these submenus for each stat working in game as easily and simply as possible? Overall it could use some refractoring and fixing up, but I can provide the source code from the original mod, if needed.


scriptName srAvaMenuQuestScript extends Quest

;-- Properties --------------------------------------
race property HighElfRace auto
globalvariable property srLevelUpIncM auto
globalvariable property srBaseAttFor auto
perk property srChaBribePerk auto
globalvariable property FavorRewardSmall auto
globalvariable property SpeechVeryEasy auto
globalvariable property srBaseAttAgi auto
globalvariable property srExtraPerkChance auto
perk property srIntSpellMagPerk auto
globalvariable property srBaseAttInt auto
globalvariable property FavorRewardMedium auto
globalvariable property SpeechEasy auto
globalvariable property FavorRewardLarge auto
race property OrcRace auto
globalvariable property srModAttFor auto
message property srAvaDifficulty auto
globalvariable property srBaseAttDex auto
globalvariable property QuestReward04Wow auto
perk property srStrMeleeDmgPerk auto
globalvariable property FavorGoldRewardSmall auto
race property DarkElfRace auto
globalvariable property MGR11Reward03 auto
spell property srAgiMovementSpeed auto
race property RedguardRace auto
globalvariable property srBaseAttStr auto
spell property srForResistDisease auto
perk property srChaIntimidatePerk auto
globalvariable property srBaseAttLuk auto
spell property Flames auto
spell property srWisResistMagic auto
globalvariable property srLevelUpIncCW auto
globalvariable property srModAttAgi auto
race property KhajiitRace auto
globalvariable property QuestReward02Medium auto
globalvariable property srModAttWis auto
globalvariable property MGR11Reward01 auto
globalvariable property srBaseAttEnd auto
globalvariable property srLevelUpIncS auto
spell property Healing auto
spell property ConjureFamiliar auto
perk property srForResistPhysicalPerk auto
globalvariable property srAttAbsMax auto
perk property srPerCritDmgPerk auto
globalvariable property SpeechAverage auto
globalvariable property QuestReward03Large auto
globalvariable property srAttributePoints auto
globalvariable property MGR11Reward04 auto
globalvariable property SpeechHard auto
perk property srStrPACostPerk auto
perk property srLukCritChancePerk auto
globalvariable property srBaseAttWis auto
perk property srDexFallDmgPerk auto
perk property srDexBowDmgPerk auto
globalvariable property srSavedAttributes auto
spell property srAgiMeleeSpeed auto
globalvariable property srModAttEnd auto
race property BretonRace auto
perk property srPerEvadePerk auto
perk property srWisSpellCostPerk auto
globalvariable property MGR11Reward05 auto
globalvariable property srModAttCha auto
spell property srForResistPoison auto
globalvariable property srModAttPer auto
race property WoodElfRace auto
globalvariable property srModAttInt auto
race property ImperialRace auto
globalvariable property SpeechVeryHard auto
globalvariable property srModAttDex auto
globalvariable property srBaseAttCha auto
globalvariable property srLevelUpIncH auto
globalvariable property FavorRewardIntimidate auto
race property ArgonianRace auto
perk property srPerPADmgPerk auto
globalvariable property srModAttLuk auto
spell property srStrUnarmedDamage auto
race property NordRace auto
globalvariable property FavorRewardBribe auto
globalvariable property srAttMaxInc auto
globalvariable property srBaseAttPer auto
spell property Fury auto
globalvariable property srModAttStr auto
actor property PlayerRef auto
globalvariable property MGR11Reward02 auto
perk property srIntSpellDurPerk auto
globalvariable property QuestReward01Small auto

;-- Variables ---------------------------------------
Float[] dTraitLuk
Int pcWis
Float[] dTraitStr
String[] chaStrings
Int aiSpellMag = 3
String[] lukStrings
Int pcAgi
Int aiFor = 1
String sCategory
Int aiCha = 8
Int aiBaseS = 4
Float[] dTraitCha
Int aiJump = 5
Int aiUnarmed = 3
Int aiCritHitChance = 1
Int aiBaseH = 1
Int aiBribe = 1
Int aiIntimidate = 2
Int aiMoveSpd = 3
Int aiMaladyR = 2
String[] forStrings
Float[] dTraitInt
String pcRace
Int aiBaseM = 4
Int pcInt
Int aiStr = 0
Int aiDex = 7
Float[] dTraitAgi
Int aiEnd = 2
Int pcPer
Int aiEvade = 2
String[] wisStrings
Int aiLuk = 9
Int aiCritDmg = 1
Float[] dTraitWis
Int aiSReg = 1
Int currentEntry
Int aiIncCW = 2
Int pcDex
Int aiWis = 4
Int aiPer = 5
Int MaxInc
Int aiSprintCost = 3
String mCategory
Int pcFor
Bool goBack
Int attChoice
Int MaxVal
Int aiRewardsMult = 3
Int pcStr
Int aiExtraPerk = 2
Float[] dTraitPer
Int aiPersuade = 3
Int aiFallDmg = 4
Int aiAgi = 6
Int aiMeleeSpd = 2
Int pcLuk
Int aiInt = 3
Int aiIncS = 1
Int pcCha
Int aiMagicR = 2
Int aiMReg = 1
Int aiIncM = 1
Int pcSex
Int aiSpellDur = 2
Float[] dTraitEnd
String[] attStrings
String[] agiStrings
Int aiBaseCW = 4
Int aiIncH = 4
Int aiPhysicalR = 3
Int aiPACost = 2
Int aiMeleeDmg = 1
Float[] dTraitDex
Int aiSpellCost = 3
String[] perStrings
String[] strStrings
String[] intStrings
Int aiPADmg = 3
Int aiManeuver = 3
String[] dexStrings
Int aiHReg = 1
String[] endStrings
Int pcEnd
Int aiBowDmg = 2
Float[] dTraitFor

;-- Functions ---------------------------------------

function OnMenuClose(String MenuName)

	if srSavedAttributes.GetValueInt() == 0 && MenuName == "RaceSex Menu"
		utility.Wait(1 as Float)
		pcRace = PlayerRef.GetRace() as String
		pcSex = PlayerRef.GetActorBase().GetSex()
		if pcRace == HighElfRace as String
			srBaseAttStr.SetValue(6 as Float)
			srBaseAttFor.SetValue(8 as Float)
			srBaseAttEnd.SetValue(8 as Float)
			srBaseAttInt.SetValue(12 as Float)
			srBaseAttWis.SetValue(10 as Float)
			srBaseAttPer.SetValue(8 as Float)
			srBaseAttAgi.SetValue(8 as Float)
			srBaseAttDex.SetValue(6 as Float)
			srBaseAttCha.SetValue(6 as Float)
			srBaseAttLuk.SetValue(10 as Float)
			PlayerRef.AddSpell(Fury, true)
		elseIf pcRace == ArgonianRace as String
			srBaseAttStr.SetValue(8 as Float)
			srBaseAttFor.SetValue(10 as Float)
			srBaseAttEnd.SetValue(8 as Float)
			srBaseAttInt.SetValue(6 as Float)
			srBaseAttWis.SetValue(8 as Float)
			srBaseAttPer.SetValue(6 as Float)
			srBaseAttAgi.SetValue(10 as Float)
			srBaseAttDex.SetValue(12 as Float)
			srBaseAttCha.SetValue(8 as Float)
			srBaseAttLuk.SetValue(6 as Float)
		elseIf pcRace == WoodElfRace as String
			srBaseAttStr.SetValue(6 as Float)
			srBaseAttFor.SetValue(8 as Float)
			srBaseAttEnd.SetValue(8 as Float)
			srBaseAttInt.SetValue(8 as Float)
			srBaseAttWis.SetValue(6 as Float)
			srBaseAttPer.SetValue(12 as Float)
			srBaseAttAgi.SetValue(10 as Float)
			srBaseAttDex.SetValue(10 as Float)
			srBaseAttCha.SetValue(8 as Float)
			srBaseAttLuk.SetValue(6 as Float)
		elseIf pcRace == BretonRace as String
			srBaseAttStr.SetValue(8 as Float)
			srBaseAttFor.SetValue(6 as Float)
			srBaseAttEnd.SetValue(6 as Float)
			srBaseAttInt.SetValue(10 as Float)
			srBaseAttWis.SetValue(10 as Float)
			srBaseAttPer.SetValue(8 as Float)
			srBaseAttAgi.SetValue(8 as Float)
			srBaseAttDex.SetValue(6 as Float)
			srBaseAttCha.SetValue(12 as Float)
			srBaseAttLuk.SetValue(8 as Float)
			PlayerRef.AddSpell(ConjureFamiliar, true)
		elseIf pcRace == DarkElfRace as String
			srBaseAttStr.SetValue(8 as Float)
			srBaseAttFor.SetValue(10 as Float)
			srBaseAttEnd.SetValue(6 as Float)
			srBaseAttInt.SetValue(10 as Float)
			srBaseAttWis.SetValue(12 as Float)
			srBaseAttPer.SetValue(8 as Float)
			srBaseAttAgi.SetValue(6 as Float)
			srBaseAttDex.SetValue(8 as Float)
			srBaseAttCha.SetValue(6 as Float)
			srBaseAttLuk.SetValue(8 as Float)
			PlayerRef.AddSpell(Flames, true)
		elseIf pcRace == ImperialRace as String
			srBaseAttStr.SetValue(8 as Float)
			srBaseAttFor.SetValue(6 as Float)
			srBaseAttEnd.SetValue(10 as Float)
			srBaseAttInt.SetValue(8 as Float)
			srBaseAttWis.SetValue(8 as Float)
			srBaseAttPer.SetValue(6 as Float)
			srBaseAttAgi.SetValue(6 as Float)
			srBaseAttDex.SetValue(8 as Float)
			srBaseAttCha.SetValue(10 as Float)
			srBaseAttLuk.SetValue(12 as Float)
			PlayerRef.AddSpell(Healing, true)
		elseIf pcRace == KhajiitRace as String
			srBaseAttStr.SetValue(6 as Float)
			srBaseAttFor.SetValue(6 as Float)
			srBaseAttEnd.SetValue(8 as Float)
			srBaseAttInt.SetValue(8 as Float)
			srBaseAttWis.SetValue(6 as Float)
			srBaseAttPer.SetValue(10 as Float)
			srBaseAttAgi.SetValue(12 as Float)
			srBaseAttDex.SetValue(10 as Float)
			srBaseAttCha.SetValue(8 as Float)
			srBaseAttLuk.SetValue(8 as Float)
		elseIf pcRace == NordRace as String
			srBaseAttStr.SetValue(12 as Float)
			srBaseAttFor.SetValue(8 as Float)
			srBaseAttEnd.SetValue(6 as Float)
			srBaseAttInt.SetValue(6 as Float)
			srBaseAttWis.SetValue(8 as Float)
			srBaseAttPer.SetValue(8 as Float)
			srBaseAttAgi.SetValue(6 as Float)
			srBaseAttDex.SetValue(8 as Float)
			srBaseAttCha.SetValue(10 as Float)
			srBaseAttLuk.SetValue(10 as Float)
		elseIf pcRace == OrcRace as String
			srBaseAttStr.SetValue(10 as Float)
			srBaseAttFor.SetValue(12 as Float)
			srBaseAttEnd.SetValue(10 as Float)
			srBaseAttInt.SetValue(6 as Float)
			srBaseAttWis.SetValue(8 as Float)
			srBaseAttPer.SetValue(6 as Float)
			srBaseAttAgi.SetValue(8 as Float)
			srBaseAttDex.SetValue(6 as Float)
			srBaseAttCha.SetValue(8 as Float)
			srBaseAttLuk.SetValue(8 as Float)
		elseIf pcRace == RedguardRace as String
			srBaseAttStr.SetValue(10 as Float)
			srBaseAttFor.SetValue(8 as Float)
			srBaseAttEnd.SetValue(12 as Float)
			srBaseAttInt.SetValue(8 as Float)
			srBaseAttWis.SetValue(6 as Float)
			srBaseAttPer.SetValue(10 as Float)
			srBaseAttAgi.SetValue(8 as Float)
			srBaseAttDex.SetValue(8 as Float)
			srBaseAttCha.SetValue(6 as Float)
			srBaseAttLuk.SetValue(6 as Float)
		else
			srBaseAttStr.SetValue(6 as Float)
			srBaseAttFor.SetValue(6 as Float)
			srBaseAttEnd.SetValue(6 as Float)
			srBaseAttInt.SetValue(6 as Float)
			srBaseAttWis.SetValue(6 as Float)
			srBaseAttPer.SetValue(6 as Float)
			srBaseAttAgi.SetValue(6 as Float)
			srBaseAttDex.SetValue(6 as Float)
			srBaseAttCha.SetValue(6 as Float)
			srBaseAttLuk.SetValue(6 as Float)
			
		endIf
		if pcSex == 0
			srBaseAttStr.SetValue(srBaseAttStr.GetValue() + 1 as Float)
			srBaseAttFor.SetValue(srBaseAttFor.GetValue() + 1 as Float)
			srBaseAttWis.SetValue(srBaseAttWis.GetValue() + 1 as Float)
			srBaseAttDex.SetValue(srBaseAttDex.GetValue() + 1 as Float)
			srBaseAttLuk.SetValue(srBaseAttLuk.GetValue() + 1 as Float)
		elseIf pcSex == 1
			srBaseAttEnd.SetValue(srBaseAttEnd.GetValue() + 1 as Float)
			srBaseAttInt.SetValue(srBaseAttInt.GetValue() + 1 as Float)
			srBaseAttPer.SetValue(srBaseAttPer.GetValue() + 1 as Float)
			srBaseAttAgi.SetValue(srBaseAttAgi.GetValue() + 1 as Float)
			srBaseAttCha.SetValue(srBaseAttCha.GetValue() + 1 as Float)
		endIf
		pcStr = srBaseAttStr.GetValueInt()
		pcFor = srBaseAttFor.GetValueInt()
		pcEnd = srBaseAttEnd.GetValueInt()
		pcInt = srBaseAttInt.GetValueInt()
		pcWis = srBaseAttWis.GetValueInt()
		pcPer = srBaseAttPer.GetValueInt()
		pcAgi = srBaseAttAgi.GetValueInt()
		pcDex = srBaseAttDex.GetValueInt()
		pcCha = srBaseAttCha.GetValueInt()
		pcLuk = srBaseAttLuk.GetValueInt()
		while srSavedAttributes.GetValue() != 1 as Float
			attStrings = new String[12]
			attStrings[0] = "Starting Stats"
			attStrings[1] = "Strength: " + "(Base: " + srBaseAttStr.GetValueInt() as String + " / Current: " + pcStr as String + ")"
			attStrings[2] = "Fortitude: " + "(Base: " + srBaseAttFor.GetValueInt() as String + " / Current: " + pcFor as String + ")"
			attStrings[3] = "Endurance: " + "(Base: " + srBaseAttEnd.GetValueInt() as String + " / Current: " + pcEnd as String + ")"
			attStrings[4] = "Intelligence: " + "(Base: " + srBaseAttInt.GetValueInt() as String + " / Current: " + pcInt as String + ")"
			attStrings[5] = "Willpower: " + "(Base: " + srBaseAttWis.GetValueInt() as String + " / Current: " + pcWis as String + ")"
			attStrings[6] = "Perception: " + "(Base: " + srBaseAttPer.GetValueInt() as String + " / Current: " + pcPer as String + ")"
			attStrings[7] = "Speed: " + "(Base: " + srBaseAttAgi.GetValueInt() as String + " / Current: " + pcAgi as String + ")"
			attStrings[8] = "Agility: " + "(Base: " + srBaseAttDex.GetValueInt() as String + " / Current: " + pcDex as String + ")"
			attStrings[9] = "Personality " + "(Base: " + srBaseAttCha.GetValueInt() as String + " / Current: " + pcCha as String + ")"
			attStrings[10] = "Luck: " + "(Base: " + srBaseAttLuk.GetValueInt() as String + " / Current: " + pcLuk as String + ")"
			attStrings[11] = "Accept"
			MaxInc = srAttMaxInc.GetValueInt()
			MaxVal = srAttAbsMax.GetValueInt()
			self.CalculateTraits()
			self.UpdateOptions()
			uilistmenu listMenu = uiextensions.GetMenu("uilistmenu", true) as uilistmenu
			listMenu.OpenMenu(none, none)
			if listMenu.GetResultString() == "Accept"
				goBack = true
				srSavedAttributes.SetValue(1 as Float)
			else
				mCategory = stringutil.SubString(listMenu.GetResultString(), 0, 3)
				goBack = false
				uilistmenu listSub = uiextensions.GetMenu("uilistmenu", true) as uilistmenu
			endIf
		endWhile
		self.CalculateTraits()
		srModAttStr.SetValueInt(pcStr)
		srModAttFor.SetValueInt(pcFor)
		srModAttEnd.SetValueInt(pcEnd)
		srModAttInt.SetValueInt(pcInt)
		srModAttWis.SetValueInt(pcWis)
		srModAttPer.SetValueInt(pcPer)
		srModAttAgi.SetValueInt(pcAgi)
		srModAttDex.SetValueInt(pcDex)
		srModAttCha.SetValueInt(pcCha)
		srModAttLuk.SetValueInt(pcLuk)
		srBaseAttStr.SetValueInt(pcStr)
		srBaseAttFor.SetValueInt(pcFor)
		srBaseAttEnd.SetValueInt(pcEnd)
		srBaseAttInt.SetValueInt(pcInt)
		srBaseAttWis.SetValueInt(pcWis)
		srBaseAttPer.SetValueInt(pcPer)
		srBaseAttAgi.SetValueInt(pcAgi)
		srBaseAttDex.SetValueInt(pcDex)
		srBaseAttCha.SetValueInt(pcCha)
		srBaseAttLuk.SetValueInt(pcLuk)
		PlayerRef.AddPerk(srStrMeleeDmgPerk)
		PlayerRef.AddPerk(srStrPACostPerk)
		PlayerRef.AddSpell(srStrUnarmedDamage, false)
		PlayerRef.SetActorValue("Health", dTraitFor[aiBaseH])
		srLevelUpIncH.SetValue(dTraitFor[aiIncH])
		PlayerRef.AddSpell(srForResistDisease, false)
		PlayerRef.AddSpell(srForResistPoison, false)
		PlayerRef.AddPerk(srForResistPhysicalPerk)
		PlayerRef.ForceActorValue("HealRate", dTraitEnd[aiHReg])
		PlayerRef.ModActorValue("CarryWeight", dTraitEnd[aiBaseCW] - PlayerRef.GetActorValue("CarryWeight"))
		srLevelUpIncCW.SetValue(dTraitEnd[aiIncCW])
		game.SetGameSettingFloat("fSprintStaminaDrainMult", dTraitEnd[aiSprintCost])
		PlayerRef.SetActorValue("Magicka", dTraitInt[aiBaseM])
		srLevelUpIncM.SetValue(dTraitInt[aiIncM])
		PlayerRef.ForceActorValue("MagickaRate", dTraitWis[aiMReg])
		PlayerRef.AddSpell(srWisResistMagic, false)
		PlayerRef.AddPerk(srWisSpellCostPerk)
		PlayerRef.AddPerk(srPerCritDmgPerk)
		PlayerRef.AddPerk(srPerEvadePerk)
		PlayerRef.AddPerk(srPerPADmgPerk)
		PlayerRef.SetActorValue("Stamina", dTraitAgi[aiBaseS])
		srLevelUpIncS.SetValue(dTraitAgi[aiIncS])
		PlayerRef.ForceActorValue("WeaponSpeedMult", 1.00000)
		PlayerRef.AddSpell(srAgiMeleeSpeed, false)
		PlayerRef.ForceActorValue("SpeedMult", 100 as Float)
		PlayerRef.AddSpell(srAgiMovementSpeed, false)
		PlayerRef.ForceActorValue("StaminaRate", dTraitDex[aiSReg])
		PlayerRef.AddPerk(srDexBowDmgPerk)
		PlayerRef.AddPerk(srDexFallDmgPerk)
		game.SetGameSettingFloat("fJumpHeightMin", dTraitDex[aiJump])
		PlayerRef.AddPerk(srChaBribePerk)
		PlayerRef.AddPerk(srChaIntimidatePerk)
		SpeechVeryEasy.SetValue(dTraitCha[aiPersuade] / 100 as Float * 8 as Float)
		SpeechEasy.SetValue(dTraitCha[aiPersuade] / 100 as Float * 20 as Float)
		SpeechAverage.SetValue(dTraitCha[aiPersuade] / 100 as Float * 40 as Float)
		SpeechHard.SetValue(dTraitCha[aiPersuade] / 100 as Float * 60 as Float)
		SpeechVeryHard.SetValue(dTraitCha[aiPersuade] / 100 as Float * 80 as Float)
		PlayerRef.AddPerk(srLukCritChancePerk)
		srExtraPerkChance.SetValue(dTraitLuk[aiExtraPerk])
		FavorGoldRewardSmall.SetValue(FavorGoldRewardSmall.GetValue() * dTraitLuk[aiRewardsMult] / 100 as Float)
		FavorRewardBribe.SetValue(FavorRewardBribe.GetValue() * dTraitLuk[aiRewardsMult] / 100 as Float)
		FavorRewardIntimidate.SetValue(FavorRewardIntimidate.GetValue() * dTraitLuk[aiRewardsMult] / 100 as Float)
		FavorRewardLarge.SetValue(FavorRewardLarge.GetValue() * dTraitLuk[aiRewardsMult] / 100 as Float)
		FavorRewardMedium.SetValue(FavorRewardMedium.GetValue() * dTraitLuk[aiRewardsMult] / 100 as Float)
		FavorRewardSmall.SetValue(FavorRewardSmall.GetValue() * dTraitLuk[aiRewardsMult] / 100 as Float)
		MGR11Reward01.SetValue(MGR11Reward01.GetValue() * dTraitLuk[aiRewardsMult] / 100 as Float)
		MGR11Reward02.SetValue(MGR11Reward02.GetValue() * dTraitLuk[aiRewardsMult] / 100 as Float)
		MGR11Reward03.SetValue(MGR11Reward03.GetValue() * dTraitLuk[aiRewardsMult] / 100 as Float)
		MGR11Reward04.SetValue(MGR11Reward04.GetValue() * dTraitLuk[aiRewardsMult] / 100 as Float)
		MGR11Reward05.SetValue(MGR11Reward05.GetValue() * dTraitLuk[aiRewardsMult] / 100 as Float)
		QuestReward01Small.SetValue(QuestReward01Small.GetValue() * dTraitLuk[aiRewardsMult] / 100 as Float)
		QuestReward02Medium.SetValue(QuestReward02Medium.GetValue() * dTraitLuk[aiRewardsMult] / 100 as Float)
		QuestReward03Large.SetValue(QuestReward03Large.GetValue() * dTraitLuk[aiRewardsMult] / 100 as Float)
		QuestReward04Wow.SetValue(QuestReward04Wow.GetValue() * dTraitLuk[aiRewardsMult] / 100 as Float)
		PlayerRef.AddPerk(srIntSpellDurPerk)
		PlayerRef.AddPerk(srIntSpellMagPerk)
		debug.Notification("Attributes Assigned and Traits Adjusted Successfully")
	endIf
endFunction

function OnInit()

	self.RegisterForMenu("RaceSex Menu")
endFunction

; Skipped compiler generated GetState

; Skipped compiler generated GotoState

function UpdateOptions()

	strStrings = new String[5]
	strStrings[0] = "---------- Strength Traits ----------"
	strStrings[1] = "Melee Damage: " + (dTraitStr[aiMeleeDmg] as Int) as String + "%"
	strStrings[2] = "Power Attack Cost: " + (dTraitStr[aiPACost] as Int) as String + "%"
	strStrings[3] = "Unarmed Damage Bonus: +" + (dTraitStr[aiUnarmed] as Int) as String
	strStrings[4] = "Back"
	forStrings = new String[5]
	forStrings[0] = "---------- Fortitude Traits ----------"
	forStrings[1] = "Health Base: " + (dTraitFor[aiBaseH] as Int) as String + " / +" + (dTraitFor[aiIncH] as Int) as String + " per Level"
	forStrings[2] = "Disease/Poison Resistance: " + (dTraitFor[aiMaladyR] as Int) as String + "%"
	forStrings[3] = "Physical Resistance: " + (dTraitFor[aiPhysicalR] as Int) as String + "%"
	forStrings[4] = "Back"
	endStrings = new String[5]
	endStrings[0] = "---------- Endurance Traits ----------"
	endStrings[1] = "Health Regeneration: " + stringutil.SubString(dTraitEnd[aiHReg] as String, 0, 5) + " (" + ((dTraitEnd[aiHReg] / 0.700000 * 100 as Float) as Int) as String + "%)"
	endStrings[2] = "Carry Weight: " + (dTraitEnd[aiBaseCW] as Int) as String + " / +" + (dTraitEnd[aiIncCW] as Int) as String + " per Level"
	endStrings[3] = "Sprint Stamina Cost: " + stringutil.SubString(dTraitEnd[aiSprintCost] as String, 0, 4) + " (" + ((dTraitEnd[aiSprintCost] / 7 as Float * 100 as Float) as Int) as String + "%)"
	endStrings[4] = "Back"
	intStrings = new String[5]
	intStrings[0] = "---------- Intelligence Traits ----------"
	intStrings[1] = "Magicka Base: " + (dTraitInt[aiBaseM] as Int) as String + " / +" + (dTraitInt[aiIncM] as Int) as String + " per Level"
	intStrings[2] = "Spell Duration: " + (dTraitInt[aiSpellDur] as Int) as String + "%"
	intStrings[3] = "Spell Magnitude: " + (dTraitInt[aiSpellMag] as Int) as String + "%"
	intStrings[4] = "Back"
	wisStrings = new String[5]
	wisStrings[0] = "---------- Wisdom Traits ----------"
	wisStrings[1] = "Magicka Regeneration: " + stringutil.SubString(dTraitWis[aiMReg] as String, 0, 4) + " (" + ((dTraitWis[aiMReg] / 3 as Float * 100 as Float) as Int) as String + "%)"
	wisStrings[2] = "Magic Resist: " + (dTraitWis[aiMagicR] as Int) as String + "%"
	wisStrings[3] = "Spell Cost: " + (dTraitWis[aiSpellCost] as Int) as String + "%"
	wisStrings[4] = "Back"
	perStrings = new String[5]
	perStrings[0] = "---------- Perception Traits ----------"
	perStrings[1] = "Critical Damage: " + (dTraitPer[aiCritDmg] as Int) as String + "%"
	perStrings[2] = "Evade Attack Chance: " + (dTraitPer[aiEvade] as Int) as String + "%"
	perStrings[3] = "Power Attack Damage: " + (dTraitPer[aiPADmg] as Int) as String + "%"
	perStrings[4] = "Back"
	agiStrings = new String[5]
	agiStrings[0] = "---------- Agility Traits ----------"
	agiStrings[1] = "Stamina Base: " + (dTraitAgi[aiBaseS] as Int) as String + " / +" + (dTraitAgi[aiIncS] as Int) as String + " per Level"
	agiStrings[2] = "Melee Speed: " + ((dTraitAgi[aiMeleeSpd] * 100 as Float) as Int) as String + "%"
	agiStrings[3] = "Movement Speed: " + (dTraitAgi[aiMoveSpd] as Int) as String + "%"
	agiStrings[4] = "Back"
	dexStrings = new String[5]
	dexStrings[0] = "---------- Dexterity Traits ----------"
	dexStrings[1] = "Stamina Regeneration: " + stringutil.SubString(dTraitDex[aiSReg] as String, 0, 4) + " (" + ((dTraitDex[aiSReg] / 5 as Float * 100 as Float) as Int) as String + "%)"
	dexStrings[2] = "Ranged Damage: " + (dTraitDex[aiBowDmg] as Int) as String + "%"
	dexStrings[3] = "Jump/Fall: " + (dTraitDex[aiManeuver] as Int) as String + "%"
	dexStrings[4] = "Back"
	chaStrings = new String[5]
	chaStrings[0] = "---------- Charisma Traits ----------"
	chaStrings[1] = "Bribe Cost: " + (dTraitCha[aiBribe] as Int) as String + "%"
	chaStrings[2] = "Intimidate Chance Mult: " + (dTraitCha[aiIntimidate] as Int) as String + "%"
	chaStrings[3] = "Persuade Mult: " + (dTraitCha[aiPersuade] as Int) as String + "%"
	chaStrings[4] = "Back"
	lukStrings = new String[5]
	lukStrings[0] = "---------- Luck Traits ----------"
	lukStrings[1] = "Critical Hit Chance: " + (dTraitLuk[aiCritHitChance] as Int) as String + "%"
	lukStrings[2] = "Extra Perk Chance: " + (dTraitLuk[aiExtraPerk] as Int) as String + "%"
	lukStrings[3] = "Rewards Multiplier: " + (dTraitLuk[aiRewardsMult] as Int) as String + "%"
	lukStrings[4] = "Back"
endFunction

function CalculateTraits()

	dTraitStr = new Float[6]
	dTraitFor = new Float[6]
	dTraitEnd = new Float[6]
	dTraitInt = new Float[6]
	dTraitWis = new Float[6]
	dTraitPer = new Float[6]
	dTraitAgi = new Float[6]
	dTraitDex = new Float[6]
	dTraitCha = new Float[6]
	dTraitLuk = new Float[6]
	Float multStr = 0.750000 + (pcStr - 6) as Float * 0.0500000
	Float multFor = 0.750000 + (pcFor - 6) as Float * 0.0500000
	Float multEnd = 0.750000 + (pcEnd - 6) as Float * 0.0500000
	Float multInt = 0.750000 + (pcInt - 6) as Float * 0.0500000
	Float multWis = 0.750000 + (pcWis - 6) as Float * 0.0500000
	Float multPer = 0.750000 + (pcPer - 6) as Float * 0.0500000
	Float multAgi = 0.750000 + (pcAgi - 6) as Float * 0.0500000
	Float multDex = 0.750000 + (pcDex - 6) as Float * 0.0500000
	Float multCha = 0.750000 + (pcCha - 6) as Float * 0.0500000
	Float multLuk = 0.750000 + (pcLuk - 6) as Float * 0.0500000
	dTraitStr[aiMeleeDmg] = ((multStr * 100 as Float) as Int) as Float
	dTraitStr[aiPACost] = (2.00000 - multStr) * (100 as Int) as Float
	dTraitStr[aiUnarmed] = multStr * 5 as Float - (3 as Int) as Float
	dTraitFor[aiIncH] = multFor * 4 as Float - (2 as Int) as Float
	dTraitFor[aiMaladyR] = (multFor - 1.00000) * (100 as Int) as Float
	dTraitFor[aiPhysicalR] = (multFor - 1.00000) * (100 as Int) as Float
	dTraitFor[aiBaseH] = ((multFor * 100 as Float) as Int) as Float
	dTraitEnd[aiHReg] = multEnd * 0.700000
	dTraitEnd[aiIncCW] = multEnd * 4 as Float - (2 as Int) as Float
	dTraitEnd[aiSprintCost] = (2.00000 - multEnd) * (7 as Int) as Float
	dTraitEnd[aiBaseCW] = ((multEnd * 200 as Float) as Int) as Float
	dTraitInt[aiIncM] = multInt * 4 as Float - (2 as Int) as Float
	dTraitInt[aiSpellDur] = ((multInt * 100 as Float) as Int) as Float
	dTraitInt[aiSpellMag] = ((multInt * 100 as Float) as Int) as Float
	dTraitInt[aiBaseM] = ((multInt * 100 as Float) as Int) as Float
	dTraitWis[aiMReg] = multWis * 3.00000
	dTraitWis[aiMagicR] = (multWis - 1.00000) * (100 as Int) as Float
	dTraitWis[aiSpellCost] = (2.00000 - multWis) * (100 as Int) as Float
	dTraitPer[aiCritDmg] = ((multPer * 100 as Float) as Int) as Float
	dTraitPer[aiEvade] = (multPer / 5 as Float - 0.150000) * (100 as Int) as Float
	dTraitPer[aiPADmg] = ((multPer * 100 as Float) as Int) as Float
	dTraitAgi[aiIncS] = multAgi * 4 as Float - (2 as Int) as Float
	dTraitAgi[aiMeleeSpd] = multAgi * 0.600000 + 0.400000
	dTraitAgi[aiMoveSpd] = (multAgi * 0.600000 + 0.400000) * (100 as Int) as Float
	dTraitAgi[aiBaseS] = ((multAgi * 100 as Float) as Int) as Float
	dTraitDex[aiSReg] = multDex * 5.00000
	dTraitDex[aiBowDmg] = ((multDex * 100 as Float) as Int) as Float
	dTraitDex[aiManeuver] = ((multDex * 100 as Float) as Int) as Float
	dTraitDex[aiFallDmg] = (2.00000 - multDex) * (100 as Int) as Float
	dTraitDex[aiJump] = ((multDex * 76.0000) as Int) as Float
	dTraitCha[aiBribe] = (2.00000 - multCha) * (100 as Int) as Float
	dTraitCha[aiIntimidate] = ((multCha * 100 as Float) as Int) as Float
	dTraitCha[aiPersuade] = (2.00000 - multCha) * (100 as Int) as Float
	dTraitLuk[aiCritHitChance] = (multLuk / 5 as Float - 0.150000) * (100 as Int) as Float
	dTraitLuk[aiExtraPerk] = (multLuk / 5 as Float - 0.150000) * (100 as Int) as Float
	dTraitLuk[aiRewardsMult] = ((multLuk * 100 as Float) as Int) as Float
endFunction

Link to comment
Share on other sites

I can't help at all with the script, unfortunately. Scripting is my weakest link.

 

I just want to politely ask what the mod is and if you've checked the permissions on the mod page? If you have, or it's only a private mod, no worries.

Link to comment
Share on other sites

I can't help at all with the script, unfortunately. Scripting is my weakest link.

 

I just want to politely ask what the mod is and if you've checked the permissions on the mod page? If you have, or it's only a private mod, no worries.

it will be completely private of course, but here's a link to the original in case you need it: https://www.nexusmods.com/skyrimspecialedition/mods/23329

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...