Difference between revisions of "ModActorValue"
Jump to navigation
Jump to search
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.
== 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
you are also responsible for doing
or that 100 points will *always* be in the Script modifier.
-----
====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.
| |||