Difference between revisions of "FindRandomReferenceOfAnyTypeInListFromRef - Game"
FindRandomReferenceOfAnyTypeInListFromRef - Game (edit)
Revision as of 08:11, 25 January 2013
, 08:11, 25 January 2013→Examples
imported>Tox2ik |
imported>Tox2ik |
||
Line 22: | Line 22: | ||
<source lang="papyrus"> | <source lang="papyrus"> | ||
import debug | import debug | ||
FormList property | FormList property lookForItems auto ; roughly 1500 entries (all enchanted armors) | ||
float distance = 2560.0 ; slightly longer than the carpet in The Great Porch of Dragonsreach | float distance = 2560.0 ; slightly longer than the carpet in The Great Porch of Dragonsreach | ||
int len = lookForItems.getSize() | int len = lookForItems.getSize() | ||
Line 48: | Line 48: | ||
trace("no items found. list: " +lookForItems+ ", list entries: " + len) | trace("no items found. list: " +lookForItems+ ", list entries: " + len) | ||
endif | endif | ||
</source> | |||
This example will look any enchanted armor that the lookForItems FormList has been filled with (in the CK). | |||
While the search distance and the length of the form list look ominously big, this example should find an | |||
item within a second if the player is within the specified distance of a qualifying item. The reason for | |||
iterating so many times is not really well founded, but it follows the example in critterBird.psc. | |||
== See Also == | == See Also == |