Editing GetSelf

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 11: Line 11:
==Notes==
==Notes==
<ul>
<ul>
<li>While functions that take an implied reference can be cast without needing a variable or call to getself, like so:
<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>CIOS someSpell</pre>
<pre>ref rSelf
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:
<pre>
ref rSelf
set rSelf to GetSelf
set rSelf to GetSelf
rSelf.CIOS someSpell</pre>
rSelf.ReferenceFunction</pre>
Not only for CIOS, but for all "reference methods" that require a reference, like CIOS.
Instead, just use code like this:
<pre>ReferenceFunction</pre>
</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>[[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).

Please note that all contributions to the Fallout3 GECK Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see GECK:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Templates used on this page: