Difference between revisions of "SetNthEffectMagnitude - Spell"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Egocarib
(Note on persistence; form simplification)
imported>DavidJCobb
(→‎Notes: A friendly reminder about how to use this properly on persistent abilities that have already been applied to actors. Saw someone in one of the SKSE threads make this mistake.)
Line 15: Line 15:
== Notes ==
== 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.
*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.
*When an ability spell is first applied to an actor (such as the player), the spell's data is copied into a new ActiveMagicEffect instance; calling SetNthEffectMagnitude on the spell will not update that ActiveMagicEffect. For the magnitude change to affect actors that already have the spell, you must [[RemoveSpell - Actor|remove]] and [[AddSpell - Actor|re-add]] the spell.


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

Revision as of 01:07, 7 January 2015

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

Sets the magnitude of the specified effect.

Syntax

Function SetNthEffectMagnitude(int index, float value) native

Parameters

  • index: 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 maintenance function is one way to maintain them.
  • When an ability spell is first applied to an actor (such as the player), the spell's data is copied into a new ActiveMagicEffect instance; calling SetNthEffectMagnitude on the spell will not update that ActiveMagicEffect. For the magnitude change to affect actors that already have the spell, you must remove and re-add the spell.

See Also