Difference between revisions of "GetNthRef - Cell"

Jump to navigation Jump to search
51 bytes added ,  08:51, 22 January 2013
→‎Examples: Reworked example (kCell.CellFunction() vs. Cell.CellFunction())
imported>PurpleLunchbox
(Created page with "Category:Scripting Category:Papyrus Category:SKSE '''SKSE Member of:''' Cell Script Returns the ObjectReference at the Nth index in the Cell based on the Form...")
 
imported>JustinOther
(→‎Examples: Reworked example (kCell.CellFunction() vs. Cell.CellFunction()))
Line 23: Line 23:


== Examples ==
== Examples ==
<source lang="papyrus">
<source lang="papyrus">Function PickEveryFlowerInCell(Actor akFlowerPicker) Global
int numFlora = Cell.GetNumRefs(39) ; kFlora = 39
Cell kCell = akFlowerPicker.GetParentCell()
int index = 0
Int iIndex = kCell.GetNumRefs(39) ; kFlora = 39
While index < numFlora
While iIndex
ObjectReference objRef = Cell.GetNthRef(index, 39)
iIndex -= 1
Debug.Trace("Flora Found in cell: " + objRef)
kCell.GetNthRef(iIndex, 39).Activate(akFlowerPicker)
index += 1
EndWhile
EndWhile
EndFunction</source>
</source>


== See Also ==
== See Also ==
Anonymous user

Navigation menu