Jump to content

Scripting Help


Tynethor

Recommended Posts

HI, the general idea behind the script I'm writing is to create a dynamic interplay between fatigue and skill levels. It's working perfectly, except that because the fatigue levels are constantly being called upon to adjust the skill levels, fortify and drain skill effects don't seem to work. I've included the relevant part of the script below, though I've cut out a bunch of variable defining to safe space.

 

Begin ScriptEffectUpdate

set curfat to player.GetActorvalue fatigue
Set bfat to player.GetBaseActorValue Fatigue
Set alchbase to Player.GetbaseActorValue Alchemy
Set fatper to (Curfat / bfat)


		If fatper <= 1
			Set acrocur2 to player.getActorValue Acrobatics
			Set skillfactacro to (1 - (mhuge * acrobase + bhuge))
			Set acro1 to pow skillfactacro skillexp
			Set acronew to (acro1 * fatfactor * acrobase)
			set acroper to (acronew / acrobase)
			set acromper to (1 - (yhuge / (zhuge + acrobase)))
				If acroper <= acromper
					set acromin to ( acromper * acrobase)
					set acromod to (acromin - acrocur2)
					player.ModActorValue Acrobatics acromod
				Elseif acroper > acromper
					set acromod to (acronew - acrocur2)
					player.modActorValue Acrobatics acromod
				Endif
		Endif

 

I've tried using ModAV2 instead of modAV, to no avail. I could try making it a quest script instead of a spell script effect so it doesn't update quite as often, but I don't think that will change the fundamental adjustments being made. One thing I've tried that I feel ought to work but isn't is doing this:

 

 

	If player.GetmagicEffectOtherActorValue DRSK != 26
	If player.GetMagicEffectotherActorValue FOSK != 26
		If fatper <= 1
			Set acrocur2 to player.getActorValue Acrobatics
			Set skillfactacro to (1 - (mhuge * acrobase + bhuge))
			Set acro1 to pow skillfactacro skillexp
			Set acronew to (acro1 * fatfactor * acrobase)
			set acroper to (acronew / acrobase)
			set acromper to (1 - (yhuge / (zhuge + acrobase)))
				If acroper <= acromper
					set acromin to ( acromper * acrobase)
					set acromod to (acromin - acrocur2)
					player.ModActorValue Acrobatics acromod
				Elseif acroper > acromper
					set acromod to (acronew - acrocur2)
					player.modActorValue Acrobatics acromod
				Endif
		Endif
	Endif
Endif

 

Where the number 26, if I understand correctly, represents Acrobatics. So, that should effectively block the script from running if there's a drain spell or fortify spell affecting Acrobatics, but it isn't. Does anyone know if I'm misunderstanding what GetmagicEffectOtherActorValue is supposed to do or am misusing it?

 

Any other suggestions on how to accomplish the dynamic skill modifications while allowing drain/fortify spells? I'm open to re-writting the whole thing, if need be.

 

Thanks!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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