Difference between revisions of "GetParentCell - ObjectReference"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Jlundin
 
imported>DavidJCobb
(→‎Notes: note on anomaly with persistent/preplaced items; source is from 2013 so if anyone has more recent info, feel free to replace)
 
(One intermediate revision by one other user not shown)
Line 25: Line 25:


== Notes ==
== Notes ==
If the reference is in an unloaded exterior cell, this function will return None.
* If the reference is in an unloaded exterior cell, this function will return None.
* Non-respawning preplaced items can be "destroyed" if you take them, sell them, and wait for the merchant's inventory to reset. [https://afkmods.iguanadons.net/index.php?/topic/3717-skyrim-the-papyrus-function-getparentcell-and-what-may-happen-when-it-runs-on-a-persistent-reference/ Reportedly], when these references are destroyed, their parent cell is reset to their original spawn location.


== See Also ==
== See Also ==
*[[Cell Script]]
*[[ObjectReference Script]]
*[[ObjectReference Script]]

Latest revision as of 02:50, 20 March 2017

Member of: ObjectReference Script

Obtains the Cell this object is currently in.

Syntax[edit | edit source]

Cell Function GetParentCell() native

Parameters[edit | edit source]

None

Return Value[edit | edit source]

The Cell the object is currently in.

Examples[edit | edit source]

; Is this object and the player in the same cell?
if (PinkPony.GetParentCell() == Game.GetPlayer().GetParentCell())
  Debug.Trace("We are in the same cell with the pink pony")
endIf

Notes[edit | edit source]

  • If the reference is in an unloaded exterior cell, this function will return None.
  • Non-respawning preplaced items can be "destroyed" if you take them, sell them, and wait for the merchant's inventory to reset. Reportedly, when these references are destroyed, their parent cell is reset to their original spawn location.

See Also[edit | edit source]