I am having trouble with a certain script. Basically it is supposed to dynamically scale magic magnitude and weapon damage with the current Magicka Percentage and Stamina Percentage respectively. It consists of two parts.
1 - A questscript which takes the magicka and stamina percentage and runs it through a quadratic equation in order to get the magicka and stamina modifiers. The script then puts the Magicka and Stamina modifiers into the unused actor values of "LastFlattered" and "LastBribedIntimidated." This script is set to update every 0.1 seconds.
2 - A perk with two entries (a) - CalculateWeaponDamage = Original * LastBribedIntimidated * 1. ( ModSpellMagnitude = Original * LastFlattered * 1 [Conditions: HasKeywords: MagicAlchBeneficial (0), MagicAlchHarmful (0), MagicShout (0), MagicSchoolAlteration (1), MagicSchoolConjuration (1), MagicSchoolDestruction (1), MagicSchoolIllusion (1), MagicSchoolRestoration (1). I made a mistake here by not putting all the Magic Schools as "OR" rather than and, so Magicka Scaling definitely doesn't work.
Anyway, the first time I loaded up, both actor values were still zero. Because no spells are from all schools, magic saw no effect. However, my iron mace did no damage (which it should have done 2 damage, or so). Using magic or stamina up had no effect on the values.
I messed with another script entirely to work on it, but when I loaded up, the Mace was at 11 damage. (just under 12). So I checked the two actor values via console again, and they were 1.19. Expending Magicka and Stamina did not change the values. When I manually changed them, however, the damage of the mace scaled with it, so I know that part of the Perk is working.
Anyway, so I assume something is wrong in my script. If anyone can identify what is wrong, that'd be great. Thanks for reading.
Here is the Script:
Scriptname _Storm_Blood_DamageScaling extends Quest {Damage Scaling}Float MagiCentFloat MagiModFloat StamCentFloat StamModActor Property PlayerRef AutoPerk Property DamageScalingPK AutoEvent OnInit() RegisterForSingleUpdate(1.0)EndEventEvent OnUpdate()If PlayerRef.HasPerk(DamageScalingPK) == 0 PlayerRef.AddPerk(DamageScalingPK)EndIfIf (PlayerRef.IsWeaponDrawn() == 0) MagiCent = PlayerRef.GetAVPercentage ("Magicka") MagiMod = (-0.8834 * MagiCent * MagiCent) + (1.8543 * MagiCent) + 0.2174 PlayerRef.SetAV("LastFlattered", MagiMod) StamCent = PlayerRef.GetAVPercentage ("Stamina") StamMod = (-0.8834 * StamCent * StamCent) + (1.8543 * StamCent) + 0.2174 PlayerRef.SetAV("LastBribedIntimidated", StamMod)EndIfRegisterForSingleUpdate(0.5)EndEvent
------BTW, if someone could also help me learn how to do the spoiler tags, because I've yet to figure it out on my own. I even tried copypasting from a guide.