TryToGetValue - ReferenceAlias

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search

Member of: ReferenceAlias Script

This is a convenient way to get the actor value of an actor in an alias without calling GetActorReference() on it. It's mostly useful in cases where you have lots of aliases that may or may not be filled and you want to call SetValue() on them without having to test for an actor being present first.

Syntax[edit | edit source]

float Function TryToGetValue(ActorValue akAV)

Parameters[edit | edit source]

  • akAV: the Actor value you want to get

Return Value[edit | edit source]

The value of the actor value. If there is no actor in the alias this will be 0. However since actor values can also be 0 this is not a valid way to determine if there was an actor in the alias.

Examples[edit | edit source]

MyAlias.TryToGetValue(AggressionAV)

Notes[edit | edit source]

Even though GetValue works on references, this function only works with actors, and so will fail and return 0 if the alias contains a reference, but not an actor.

See Also[edit | edit source]