Talk:GetNthForm - ObjectReference

Active discussions

As of v 1.6.16, it appears that you no longer can get factions and the like by using this function. Jbezorg (talk) 2013-12-02T18:55:15 (EST)


Making use of this function to retrieve a random form from a leveled listEdit

Doing this requires a workaround with an AddItem operation on a dummy chest. For obvious reasons, something like <Form> = <LeveledItem> does not work here as it only results in <Form> pointing at <LeveledItem>.


Form Function GetRandomForm (LeveledItem SomeLeveledList, ObjectReference SomeChest)

	SomeChest.RemoveAllItems()
	SomeChest.AddItem (SomeLeveledList, 1)
	Int FormCount = SomeChest.GetNumItems()

	Return SomeChest.GetNthForm (RandomInt (0, FormCount - 1))

EndFunction

--Sclerocephalus (talk) 2015-04-15T05:54:55 (EDT)

Return to "GetNthForm - ObjectReference" page.