Hello @ll,
I need some help regarding unmodified actor values.
Despite the two commands, getbaseav (CS) and getbaseav2 (obse) i do utilize the following code snippet (function)
to retrieve a totally unmodified base actor value. As you can see Tejon provided this function to me, because the two aforementioned commands didnt do the work.
scn egmFNgetPUAV
; by Tejon / Fundament
ref myself
int av
int index
array_var each
int tempPUAV1
int tempPUAV2
begin _Function {myself, av} // av is the actor value code to be retrieved in its unaltered form
if (av == 256) // this value is used to query Fatigue, which is Attribute 0, 2, 3, 5 multiplied by Speed
let tempPUAV1 := myself.GetBaseAV 0
let tempPUAV1 += myself.GetBaseAV 2
let tempPUAV1 += myself.GetBaseAV 3
let tempPUAV1 += myself.GetBaseAV 5
let tempPUAV2 := myself.GetBaseAV 4
else // this is the standard case for querying ONE unaltered base value
let tempPUAV1 := myself.GetBaseAV av
let tempPUAV2 := 1
endif
foreach each <- myself.GetActiveEffectCodes
if eval !(myself.IsNthActiveEffectApplied each["key"])
CONTINUE
endif
if eval !((GetSpellType (myself.GetNthAEMagicItem each["key"])) == 4)
CONTINUE
endif
let index := myself.GetNthAEAV each["key"]
if (av == 256) // this is the special case again
if (index < 0) || (index > 5)
CONTINUE
elseif (index == 0)
if eval !(MagicEffectUsesAttribute each["value"])
CONTINUE
endif
elseif (index == 1)
CONTINUE
endif
if(index == 4)
let tempPUAV2 -= myself.GetNthAEMagnitude each["key"]
else
let tempPUAV1 -= myself.GetNthAEMagnitude each["key"]
endif
else // standard query for ONE unaltered base value
if (index != av)
CONTINUE
endif
if (index == 0)
if eval !(MagicEffectUsesAttribute each["value"])
CONTINUE
endif
endif
let tempPUAV1 -= myself.GetNthAEMagnitude each["key"]
endif
Loop
;let each := ar_Null
SetFunctionValue (tempPUAV1 * tempPUAV2)
end
;
;1062
;
Unfortunately this function is used a lot during EGM modded gameplay, and RuntimeScriptProfiler states this function as the worst cycle eater.
Is it possible to implement a better solution based on a obse function, since I do not understand why this hasnt been done anyway?
This would help a lot.
Thank you for any help.