Difference between revisions of "GetActorReference - ReferenceAlias"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Jlundin
 
imported>Thingy Person
 
(One intermediate revision by one other user not shown)
Line 8: Line 8:
<source lang="papyrus">
<source lang="papyrus">
Actor Function GetActorReference()
Actor Function GetActorReference()
return GetReference() as Actor
endFunction
Actor Function GetActorRef()
Actor Function GetActorRef()
return GetActorReference()
endFunction
</source>
</source>


Line 23: Line 27:
</source>
</source>


== Notes ==
*Under the hood, this is 'GetReference() As Actor' which is measurably faster.
== See Also ==
== See Also ==
*[[ReferenceAlias Script]]
*[[ReferenceAlias Script]]
*[[Actor Script]]
*[[Actor Script]]
*[[GetReference - ReferenceAlias]]
*[[GetReference - ReferenceAlias]]

Latest revision as of 17:17, 29 June 2013

Member of: ReferenceAlias Script

Attempts to retrieve the actor this alias is pointing at. If it has not been resolved to a reference, or the reference is not an Actor, it will return None.

Syntax[edit | edit source]

Actor Function GetActorReference()
	return GetReference() as Actor
endFunction
Actor Function GetActorRef()
	return GetActorReference()
endFunction

Parameters[edit | edit source]

None

Return Value[edit | edit source]

The Actor this alias is pointing at, or None if the alias has not been resolved or is not an Actor.

Examples[edit | edit source]

; Obtain the actor this alias points at
Actor theActor = MyAlias.GetActorReference()

Notes[edit | edit source]

  • Under the hood, this is 'GetReference() As Actor' which is measurably faster.

See Also[edit | edit source]