GetNumRefs - Cell

From the CreationKit Wiki
Revision as of 09:49, 6 January 2020 by imported>Thynar
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

SKSE Member of: Cell Script

Returns the number of ObjectReferences in the Cell based on the FormType filter. (This function requires SKSE)

Syntax

int Function GetNumRefs(int formTypeFilter = 0) native

Parameters

  • formTypeFilter: FormType filter to return the number of a specific form type see GetType - Form for a list of FormTypes.

Return Value

Returns the number of ObjectReferences in the Cell based on the FormType filter.

Notes

  • Using a filter type of zero results in returning all object references in the cell.
  • If using a filter type make sure to use the same filter when retrieving the references.
  • If the cell that references are called from is not loaded, non-persistent references will not be called.

Examples

Function PickEveryFlowerInCell(Actor akFlowerPicker) Global
	Cell kCell = akFlowerPicker.GetParentCell()
	Int iIndex = kCell.GetNumRefs(39) ; kFlora = 39
	While iIndex
		iIndex -= 1
		kCell.GetNthRef(iIndex, 39).Activate(akFlowerPicker)
	EndWhile
EndFunction

See Also