ForceActorValue

From GECK
(Redirected from ForceAV)
Jump to: navigation, search


A function included in the GECK for Fallout 3.

Description

ForceActorValue modifies the current stat to the specified value (not to be confused with SetActorValue, which changes the BASE value of the stat).

Syntax

[help]
[ActorRefID].ForceActorValue ActorValue:statName Value:int 

Or:

[ActorRefID].ForceAV ActorValue:statName Value:int

Example

ForceActorValue Health 50 

The equivalent of:

Short modParameter
Set modParameter to ( 50 - GetActorValue Health )
ModActorValue Health, modParameter

Because the GetActorValue function returns the current state, including all effects, damage, and other ModActorValue numbers, ForceActorValue will produce different ModActorValue results at different times.

Note that like ModActorValue, when used in a script this change is permanent. See ModActorValue for discussion of how this works.

Notes

  • Should never be used on the player, as it will seriously screw up that actor value when combined with other mods or scripts that adjust it or depend on it.
  • Instead, use ModAV to adjust the stat to the required value. If several mods make changes to the same value at the same time, and one of them uses ForceAV the stat is likely to end up irrevocably altered. For example:
    • An actor has a starting Strength of 6.
    • Mod 1 records 6 as the starting strength, and uses ForceAV Strength 8 to increase their strength by 2.
    • Mod 2 uses ModAV Strength 2 to further increase their strength by 2, to 10.
    • Mod 1's effect ends, and it uses ForceAV Strength 6 to return the actor's strength to the recorded starting value of 6.
    • Mod 2's effect ends, and it uses ModAV Strength -2 to remove the 2 strength it added. This gives a total value of 4.
    • The actor now has Strength 4, and neither Mod 1 nor Mod 2 will fix it.
  • To undo the effects of this function, use UnforceAV
  • To understand how Actor Values are calculated, see ActorValue.

See Also