Difference between revisions of "GetSelf"
Updated to use Function template; fixed bad example; added note about implicit reference syntax
imported>Henning (Complete article.) |
imported>Cipscis (Updated to use Function template; fixed bad example; added note about implicit reference syntax) |
||
Line 1: | Line 1: | ||
{{Function | |||
|CSWikiPage = GetSelf | |||
|origin = GECK1 | |||
|summary = Returns the RefID of the calling reference. [[GetSelf]] is only useful when this information is accessed externally, or when the scripted reference's RefID needs to be passed as a parameter to a function like [[PushActorAway]] | |||
|alias = this | |||
|referenceType = Reference | |||
|example = ref rSelf | |||
set rSelf to GetSelf | |||
player.PushActorAway rSelf 5 | |||
}} | |||
==Notes== | |||
<ul> | |||
<li>Because reference functions can be called on the scripted reference implicitly by omitting explicit reference syntax, the following code structure should never be used: | |||
<pre>ref rSelf | |||
set rSelf to GetSelf | |||
rSelf.ReferenceFunction</pre> | |||
Instead, just use code like this: | |||
<pre>ReferenceFunction</pre> | |||
</li> | |||
</ul> | |||
[[Category:Functions]] | [[Category:Functions]] |