Difference between revisions of "GetSelf"

Jump to navigation Jump to search
485 bytes removed ,  17:29, 17 February 2010
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.
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>If [[GetSelf]] is called in a script that is attached to an inventory item, the GECK will show a warning message when the data file is loaded.  This warning can only be ignored if you can guarantee that the return value of [[GetSelf]] will not be used if it is called while the scripted item is in an inventory.  This is due to the fact that inventory items do not have regular RefIDs.  Rather, they are assigned RefIDs for the duration of a script execution so that reference functions may be called on them from their script, but these RefIDs are not permanent so attempting to use one of them will likely result in a script halt or other unintended behavior.
<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>
Anonymous user

Navigation menu