[dismiss]
This wiki is a copy of the original Oblivion CS wiki created and maintained by the UESP.net. See CSwiki:Copy Notice for more info.
Difference between revisions of "GetParentCell"
Jump to navigation
Jump to search
imported>DragoonWraith (updating example with a better one) |
imported>QQuix (added a note) |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 2: | Line 2: | ||
'''Syntax:''' | '''Syntax:''' | ||
GetParentCell | (parentCell:ref) reference.GetParentCell | ||
Must be called on a reference. Returns the cell containing the reference. | Must be called on a reference. Returns the cell containing the reference. | ||
==Example== | ==Example== | ||
if (player.GetParentCell == SigilStoneRef.GetParentCell) | |||
Returns true if the player is in the same cell as the SigilStoneRef (However, [[GetInSameCell]] is a bit faster than GetParentCell, so you would use that instead.) | |||
scn CellChangedScript | scn CellChangedScript | ||
float fQuestDelayTime | float fQuestDelayTime | ||
ref CellLastFrame | ref CellLastFrame | ||
Begin GameMode | Begin GameMode | ||
set fQuestDelayTime to 0.0001 | set fQuestDelayTime to 0.0001 | ||
if ( CellLastFrame != player.GetParentCell ) | if ( CellLastFrame != player.GetParentCell ) | ||
Line 23: | Line 21: | ||
set CellChanged to 0 | set CellChanged to 0 | ||
endif | endif | ||
End | End | ||
Line 29: | Line 26: | ||
==Notes== | ==Notes== | ||
*If the reference has been moved to a different call with SetPos, this function returns the original cell of the reference. In this case, move the reference to itself (e.g. MyRef.MoveTo MyRef) before GetParentCell to force an update and get the correct parent cell. | |||
*In the commands.txt of OBSE v0004, this function was called '''GetPlayerCell'''. | *In the commands.txt of OBSE v0004, this function was called '''GetPlayerCell'''. | ||
[[Category: OBSE Functions]] | ==See Also== | ||
* [[GetInCell]] | |||
* [[GetInCellParam]] | |||
* [[GetInSameCell]] | |||
* [[GetInWorldspace]] | |||
<!--[[Category: OBSE Functions]] | |||
[[Category: OBSE Miscellaneous Functions]] | [[Category: OBSE Miscellaneous Functions]] | ||
[[Category: OBSE Reference Functions]] | [[Category: OBSE Reference Functions]]--> | ||
[[Category: Functions]] | |||
[[Category: Functions (OBSE)]] | |||
[[Category: Miscellaneous Functions]] | |||
[[Category: Miscellaneous Functions (OBSE)]] | |||
[[Category: Record Variable Functions]] | |||
[[Category: Record Variable Functions (OBSE)]] |
Latest revision as of 06:47, 5 January 2014
A command for Oblivion Script Extender
Syntax:
(parentCell:ref) reference.GetParentCell
Must be called on a reference. Returns the cell containing the reference.
Example[edit | edit source]
if (player.GetParentCell == SigilStoneRef.GetParentCell)
Returns true if the player is in the same cell as the SigilStoneRef (However, GetInSameCell is a bit faster than GetParentCell, so you would use that instead.)
scn CellChangedScript float fQuestDelayTime ref CellLastFrame Begin GameMode set fQuestDelayTime to 0.0001 if ( CellLastFrame != player.GetParentCell ) set CellChanged to 1 set CellLastFrame to player.GetParentCell else set CellChanged to 0 endif End
This script mimics the CellChanged function from Morrowind. CellChanged would be a global short variable.
Notes[edit | edit source]
- If the reference has been moved to a different call with SetPos, this function returns the original cell of the reference. In this case, move the reference to itself (e.g. MyRef.MoveTo MyRef) before GetParentCell to force an update and get the correct parent cell.
- In the commands.txt of OBSE v0004, this function was called GetPlayerCell.