Talk:FindAllReferencesWithKeyword - ObjectReference

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search

Does not appear to catch items dropped by the player.--Twilight Sky (talk) 2016-08-20T15:57:11 (EDT)

Works as intended. I believe items dropped by the player, or items like mines are considered duplicates of the base object(FF IDs). In other words, temporarily objects. --Twilight Sky (talk) 2016-08-20T22:04:59 (EDT)

Using keyword formlists/arrays[edit source]

I've tested this enough times to the point of driving me nuts. I have to wonder why the creator limits his functions in such a way. In any case.. if you use a formlist or an array(yes you can use arrays, and they are far faster than formlists), despite the example showing it will grab references that match ANY of the keywords, it actually doesn't. I'll use terminals for example because these are what I've been working with. Say you have a keyword list(in my case an array, and have tested with formlists too) that contains the following keywords.. AnimFurnDeskTerminal, AnimFurnDeskTerminalNoChair, AnimFurnDeskTerminalWithChair, AnimFurnWallTerminal and you are in a room with a Wall terminal and 2 desk terminals, this function will grab only the wall terminal. The two desk terminals contain both the AnimFurnDeskTerminal AND the AnimFurnDeskTerminalNoChair. It appears to me that this function can't grab references that have multiple keywords in the list attached to the same form. If you were to only use ONE keyword for the search, this would grab both desk terminals. Thus if you want to grab ALL terminals, you'd need to call this function for every keyword separately, which is both inefficient and rather silly. As always, maybe I missed something while gradually losing my sanity, but I've arrived to this conclusion in my tests --Rasikko (talk) 2018-03-14T03:57:02 (EDT)

Alright so after a recent test, seeing that I had it backwards, this is how this function works.. If a form's list of assigned keywords matches at least two keywords in a list passed to the function, they will be include into the returned array. Again, I will use Terminals as an example. Say the passed in keyword list contains these keywords:
  • AnimFurnDeskTerminal
  • AnimFurnDeskTerminalNoChair
  • AnimFurnDeskTerminalWithChair
  • AnimFurnWallTerminal.

And you are in a room with three 'types' of terminals: 1 Wall terminal, 1 Desk Terminal, both which only has one keyword related to terminals, and 1 desk terminal that is the corded model. Only the corded model will be returned in an array because its keywords matches two keywords in the list, which is AnimFurnDeskTerminal and AnimFurnDeskTerminalNoChair.

But if you were to add FurnitureForce1rstPerson keyword to the list, all the terminals would be returned in the array, because all terminals have this keyword, and each one would have at least one other keyword that matches the ones in the list. From all this, it appears the minimum amount of keywords a form has that much match the keywords in a list passed to the function in order to be included into the array is two keywords. --Rasikko (talk) 2018-03-15T13:09:24 (EDT)