Difference between revisions of "SetNthEffectMagnitude - Spell"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>CraftySentinel
(Created SetNthEffectMagnitude - Spell)
 
imported>DavidJCobb
(→‎Notes: Clarified last edit. Hopefully.)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__ __NOEDITSECTION__
__NOTOC__
'''Source:''' [[:Category:SKSE|SKSE]] 1.06.14
'''SKSE Member of:''' [[Ingredient Script]], [[Potion Script]], [[Scroll Script]], [[Spell Script]]


'''Member of:''' [[Ingredient Script]], [[Potion Script]], [[Scroll Script]], [[Spell Script]]
Sets the magnitude of the specified effect.
 
Sets the magnitude of the specified effect


== Syntax ==
== Syntax ==
Line 11: Line 9:
</source>
</source>


==== Parameters ====
== Parameters ==
 
*index: The index of the Magic Effect to change.
''index''
*value: The Magnitude to set the Magic Effect to.
::The index of the Magic Effect to change.
 
''value''
::The Magnitude to set the Magic Effect to.


== Notes ==
*Changes made by this function will not persist across game reloads. Using a [[Complete_Example_Scripts#Maintenance.2Fupdate_code_which_runs_once_per_save_load_and_shows_a_message_when_a_mod_is_updated_or_first_loaded|maintenance function]] is one way to maintain them.
*If you use SetNthEffectMagnitude to change the magnitude(s) of an ability spell that has already been added to an actor, the actor will not receive those changes. This is because of how magic effects work: when the actor first received the ability, new [[ActiveMagicEffect Script|ActiveMagicEffect]] instances were created on that actor based on data ''copied from'' the spell's defined magic effects. To update those ActiveMagicEffects, you have to replace them: you must [[RemoveSpell - Actor|remove]] and [[AddSpell - Actor|re-add]] the ability spell to the actor.


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

Latest revision as of 01:11, 7 January 2015

SKSE Member of: Ingredient Script, Potion Script, Scroll Script, Spell Script

Sets the magnitude of the specified effect.

Syntax[edit | edit source]

Function SetNthEffectMagnitude(int index, float value) native

Parameters[edit | edit source]

  • index: The index of the Magic Effect to change.
  • value: The Magnitude to set the Magic Effect to.

Notes[edit | edit source]

  • Changes made by this function will not persist across game reloads. Using a maintenance function is one way to maintain them.
  • If you use SetNthEffectMagnitude to change the magnitude(s) of an ability spell that has already been added to an actor, the actor will not receive those changes. This is because of how magic effects work: when the actor first received the ability, new ActiveMagicEffect instances were created on that actor based on data copied from the spell's defined magic effects. To update those ActiveMagicEffects, you have to replace them: you must remove and re-add the ability spell to the actor.

See Also[edit | edit source]