Damage Scaling (script and unused actor values)

Post » Wed Dec 17, 2014 1:50 am

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. ( :cool: 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.

User avatar
Catharine Krupinski
 
Posts: 3377
Joined: Sun Aug 12, 2007 3:39 pm

Post » Wed Dec 17, 2014 5:23 am

Okay, update, just on a whim, I eliminated the "if playerref.isweapondrawn" and it worked suddenly. The two actor values scaled. I realized that it was because I had a typo and had the "isweapondrawn == 0" instead of ==1. So I'm going to try that. I did try changing the Magic conditions, but it didn't work...

Edit: Decided to eliminate the magic school requirements. I think the order that the conditions happened to be in was screwing it up. But I can't think of any other keyword that I'd want to ban other than alchemy and shouting. I may try and make it so it doesn't affect enchantments later. But for now, it works as intended. Sorry for the extra post.

User avatar
Dan Wright
 
Posts: 3308
Joined: Mon Jul 16, 2007 8:40 am


Return to V - Skyrim

cron