GetSelfAlt

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


A function added by the New Vegas Script Extender version 6.2.8.

Description

Returns the calling reference, or a null form if there is none.

Only useful when this information is accessed externally, or when the scripted reference needs to be passed as a parameter to a function like PushActorAway

Unlike GetSelf, this will always return the calling reference, even if it happens to be a non-Persistent Item. If that check is not needed, then this is a strictly faster version of that function.

Syntax

[help]
GetSelfAlt 

Or:

ThisAlt

Example

ref rSelf
let rSelf := GetSelfAlt
player.PushActorAway rSelf 5 

Notes

While functions that take an implied reference can be cast without needing a variable or call to GetSelfAlt, like so:

CIOS someSpell

Doing so may not be clear, and makes the code less portable if moved to a different script that does not support the implied reference. For this reason, modders should prefer the more expressive syntax:

ref rSelf
let rSelf := GetSelfAlt
rSelf.CIOS someSpell

Not only for CIOS, but for all "reference methods" that require a reference, like CIOS.

See Also