Difference between revisions of "ModActorValue"

Jump to navigation Jump to search
396 bytes added ,  03:24, 6 May 2006
Hope it's better understandable now.
imported>Doppelganger
(added forceactorvalue to the list of see-alsos.)
imported>JOG
(Hope it's better understandable now.)
==Description==
'''Syntax:'''
ModActorValue ''StatName value''
 
ModActorValue modifies the stat by the specified value, without affecting the base value of the stat.
 
A modification by ModActorValue can exceed the maximum of 100 when modifying skills and attributes, and the changed stat is always a temporary change marked red or green. The main use for Modactorvalue are curses or blessings that can't be dispelled and spells or magic items that can modify a skill/attribute beyond 100.
 
If you want to make a permanent change to an actor value in a script, do not use ModActorValue. You must either use SetActorValue or apply a magic spell that modifies the actor value you're interested in. A good way to do this is to create an Ability and use AddSpell to add it to your reference's spell list.
 
ModActorValue behaves differently if you're using it in a Script vs using it in the Console. When you (or the game) uses GetActorValue, you are getting a sum of the base actor value plus three modifiers: the Game Modifier, the Magic Modifier and the Script Modifier. If you use ModActorValue in a script, the Script Modifier is adjusted, and ONLY a script can adjust it back. In other words, if you have a script do
 
== Practice: ==
'''player.modav health 100'''▼
 
==== Background ====
 
When you (or the game) uses [[GetActorValue]], you are getting a sum of the base actor value plus three modifiers:
 
#'''Game Modifier''' used for "permanent" effects such as Damage and Restore.
#'''Magic Modifier''' used for used for "temporary", ''dispellable'' magic-effects such as Drain and Fortify.
#'''Script Modifier''' used for "temporary" ''non-dispellable'' scripted-effects like blessings and curses.
 
----
====Scripts====
 
If you use ModActorValue in a script, the '''Script Modifier''' is adjusted, and ONLY a script can adjust it back. In other words, if you have a script do
 
▲''' player.modav health 100'''
 
you are also responsible for doing
 
''' player.modav health -100'''
 
or that 100 points will *always* be in the Script modifier.
 
-----
The Game Modifier is used for "permanent" effects such as Damage and Restore, while the Magic Modifier is used for "temporary" effects such as Drain and Fortify. The Game Modifier will also not allow actor values to go above their base, while the Magic Modifier will. So if you use ModActorValue in the console, a negative value can be "corrected" with a Restore, while a positive value will only bring the Game Modifier up to a maximum of zero.
====Console====
 
ModActorValue behaves differently when you use it in the console. In the console, a negative value modifies the '''Magic Modifier''' and thus can be "corrected" with a Restore-Spell, while a positive value will only bring the '''Game Modifier''' up to a maximum of zero.
 
The reason for the difference is that ModActorValue in the console was used for testing purposes, while its use in scripts is for temporary effects that cannot be adjusted by using magic spells or internal game systems.
Anonymous user

Navigation menu