Difference between revisions of "GetMagnitude - ActiveMagicEffect"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Thor
(Note)
 
(One intermediate revision by one other user not shown)
Line 12: Line 12:


== Return Value ==
== Return Value ==
Returns the Magnitude of the Magic Effect
Returns the Magnitude of the Magic Effect.
 
It will compile but will not execute if the effect has no duration.
It will compile but will not execute if the effect has no duration.


Line 23: Line 24:


</source>
</source>
== Notes ==
Scripts sometimes unable to call this function, if the effect dispels in the same second it is casted - e.g. effects with no duration, or quickly casting/releasing a concentration type spell, that call this function from the OnEffectStart event. To prevent this, it's better to call GetMagnitude() before OnEffectStart - with OnInit event; in this case this function appear to be fail-safe.


== See Also ==
== See Also ==

Latest revision as of 06:21, 7 October 2023

SKSE Member of: ActiveMagicEffect Script

Returns the Magnitude of the Active Magic Effect.

Syntax[edit | edit source]

float Function GetMagnitude() native

Return Value[edit | edit source]

Returns the Magnitude of the Magic Effect.

It will compile but will not execute if the effect has no duration.

Examples[edit | edit source]

;Used self variable. Self was the script attached to this magic effect. 

Float Magnitude = self.GetMagnitude()
Debug.Trace("This magic effect has a strength value of" +Magnitude)

Notes[edit | edit source]

Scripts sometimes unable to call this function, if the effect dispels in the same second it is casted - e.g. effects with no duration, or quickly casting/releasing a concentration type spell, that call this function from the OnEffectStart event. To prevent this, it's better to call GetMagnitude() before OnEffectStart - with OnInit event; in this case this function appear to be fail-safe.

See Also[edit | edit source]