Difference between revisions of "GetSelf"
Jump to navigation
Jump to search
imported>Cipscis (Changed syntax to show implicit reference syntax, as GetSelf should only ever be called implicitly; Added note about inventory items and GECK warning message, not too sure about how clear it is though) |
imported>Cipscis (Further testing of GetSelf reveals that it returns 0 when called on references saved in the save game (i.e. those with formIDs starting with "ff"). Thanks to HugePinball for pointing this out.) |
||
Line 18: | Line 18: | ||
<pre>ReferenceFunction</pre> | <pre>ReferenceFunction</pre> | ||
</li> | </li> | ||
<li> | <li>[[GetSelf]] will return 0 if called on a reference that has been created dynamically (for example, created via [[PlaceAtMe]], or dropped from an inventory into the game world). | ||
</li> | </li> | ||
</ul> | </ul> |
Revision as of 17:29, 17 February 2010
< [[::Category:Functions|Category:Functions]]
Link to TES4 Construction Set Wiki: GetSelf.
A function included in the GECK version 1.1.0.36.
Description
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
Syntax
GetSelf
Or:
this
Example
ref rSelf set rSelf to GetSelf player.PushActorAway rSelf 5
Notes
- Because reference functions can be called on the scripted reference implicitly by omitting explicit reference syntax, the following code structure should never be used:
ref rSelf set rSelf to GetSelf rSelf.ReferenceFunction
Instead, just use code like this:
ReferenceFunction
- GetSelf will return 0 if called on a reference that has been created dynamically (for example, created via PlaceAtMe, or dropped from an inventory into the game world).