Difference between revisions of "SetNthEffectItemMagnitude"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Haama
(Created)
 
imported>Candlemaster
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
SetNthEffectItemMagnitude - sets the magnitude of the specified effect item
A command for [[:Category:Oblivion Script Extender|Oblivion Script Extender]]
        (nothing) SetNthEffectItemMagnitude nuMagnitude:long magicItem:ref whichEffect:short
 
        (nothing) SetNthEIMagnitude nuMagnitude:long magicItem:ref whichEffect:short
'''Syntax:'''
(nothing) SetNthEffectItemMagnitude nuMagnitude:long magicItem:ref whichEffect:short
 
(nothing) SetNthEIMagnitude nuMagnitude:long magicItem:ref whichEffect:short
 
Sets the magnitude of the specified effect item.
 
==Notes==
* If you use a non-integar number (float; i.e., 2.5), the resulting magnitude will be the nearest whole number less than that number. For instance, if you set magnitude to 2.6 then the resulting magnitude will be 2.
* You can set the magnitude of a spell to a negative number. The spell will have the opposite effect. For example, if you set a '''Damage Health''' spell to -10 (Duration 1), and cast it on the player, the player will gain 10 health. Unlike the above, a fraction will be rounded up (i.e., -2.6 will be -2).
** Only '''Damage Health''' has been tested so far, so results may vary.
**Frost Damage is confirmed to heal when set to a reversed magnitude, but note that an unmodified Frost Damage magnitude returns a negative number from [[GetNthEffectItemMagnitude]], so setting it to a negative value will still deal damage.  To make a Frost Damage effect heal, you must set it to a <b>positive</b> magnitude.  This is believed to be true for Fire Damage and Shock Damage as well (untested).
* You can set the magnitude of any magic item, even if it normally doesn't have a magnitude and it's grayed out in the CS. This magnitude won't do anything or even appear in-game, but you can retrieve it with [[GetNthEffectItemMagnitude]], making it a good way to store integer data.
* (Unconfirmed, but likely) Using this function on a non-cloned spell (any spells from Oblivion.esm or mods) will change the magnitude of the spell, but only until the player re-loads their game. The most likely explanation is that Oblivion retrieves the spell's data from the mod/Oblivion.esm when loading, while cloned spells' data come from the save file itself.
* (At least for some effects) If the altered spell is already on an actor, it will take a frame or two for the new magnitude to take effect on that actor.


==See Also==
==See Also==
Line 11: Line 25:
[[Category:Magic Functions]]
[[Category:Magic Functions]]
[[Category:Magic Functions (OBSE)]]
[[Category:Magic Functions (OBSE)]]
[[Category:Magic Functions - Effect Item (OBSE)]]

Latest revision as of 07:32, 14 May 2010

A command for Oblivion Script Extender

Syntax:

(nothing) SetNthEffectItemMagnitude nuMagnitude:long magicItem:ref whichEffect:short
(nothing) SetNthEIMagnitude nuMagnitude:long magicItem:ref whichEffect:short

Sets the magnitude of the specified effect item.

Notes[edit | edit source]

  • If you use a non-integar number (float; i.e., 2.5), the resulting magnitude will be the nearest whole number less than that number. For instance, if you set magnitude to 2.6 then the resulting magnitude will be 2.
  • You can set the magnitude of a spell to a negative number. The spell will have the opposite effect. For example, if you set a Damage Health spell to -10 (Duration 1), and cast it on the player, the player will gain 10 health. Unlike the above, a fraction will be rounded up (i.e., -2.6 will be -2).
    • Only Damage Health has been tested so far, so results may vary.
    • Frost Damage is confirmed to heal when set to a reversed magnitude, but note that an unmodified Frost Damage magnitude returns a negative number from GetNthEffectItemMagnitude, so setting it to a negative value will still deal damage. To make a Frost Damage effect heal, you must set it to a positive magnitude. This is believed to be true for Fire Damage and Shock Damage as well (untested).
  • You can set the magnitude of any magic item, even if it normally doesn't have a magnitude and it's grayed out in the CS. This magnitude won't do anything or even appear in-game, but you can retrieve it with GetNthEffectItemMagnitude, making it a good way to store integer data.
  • (Unconfirmed, but likely) Using this function on a non-cloned spell (any spells from Oblivion.esm or mods) will change the magnitude of the spell, but only until the player re-loads their game. The most likely explanation is that Oblivion retrieves the spell's data from the mod/Oblivion.esm when loading, while cloned spells' data come from the save file itself.
  • (At least for some effects) If the altered spell is already on an actor, it will take a frame or two for the new magnitude to take effect on that actor.

See Also[edit | edit source]