Talk:FindClosestReferenceOfType - Game

From the CreationKit Wiki
Jump to navigation Jump to search

Example Doesn't Make Sense[edit source]

This isn't well documented, the example doesn't really make any sense. I want to go about finding the closest Flora reference, how would I go about doing that?

--Elec0 00:27, 16 February 2012 (EST)

The name is a bit misleading - it doesn't work like that. Instead, you tell this function what type of base form you're looking for, and it will look for the closest reference to that base form within the volume you specify. You can't search for "Flora", although you could search for the nearest "Lavender" reference.
-- Cipscis 02:04, 16 February 2012 (EST)
So the only way to find all flora, for example, is to add it to a list and use FindClosestReferenceOfAnyTypeInList?
--Elec0 13:52, 16 February 2012 (EST)
As far as I can tell, yes. Given that the list has to be pre-defined manually, this has obvious limitations. I expect that we'll have to wait for SKSE support before it's possible to iterate through all references of a certain type, as previous script extenders have made possible.
-- Cipscis 15:35, 16 February 2012 (EST)