niston Posted July 19, 2019 Share Posted July 19, 2019 I want, from a script attached to a workshop object, find the first (and only) other workshop object that has a certain keyword on it. How to do it? Link to comment Share on other sites More sharing options...
SKKmods Posted July 19, 2019 Share Posted July 19, 2019 (edited) Two appraches come to mind: a) If the item is likely to be within the active 10,000 game unit radius of the player (from uGridsToLoad) then run a FindAllReferencesWithKeyword() area scan. If there is only one this should be a cheap call. Note Sanctuary/Specatle build areas are wider than 20K. b) get the WorkshopREF via self.GetLinkedRef(WorkshopItemKeyword) then iterate the WorkshopREF.GetRefsLinkedToMe(WorkshopItemKeyword). This could be a bunch of processing. Edited July 19, 2019 by SKK50 Link to comment Share on other sites More sharing options...
niston Posted July 19, 2019 Author Share Posted July 19, 2019 I'm looking to avoid approach a) and will try b). Thanks SKK Link to comment Share on other sites More sharing options...
SKKmods Posted July 19, 2019 Share Posted July 19, 2019 (edited) No women, no children. actually there is cunning plan C which is to use a disposable quest reference conditional fill to do the work, they can scan any active worldspace and are extremely fast and efficient as its an engine function rather than script abstraction. Edited July 19, 2019 by SKK50 Link to comment Share on other sites More sharing options...
niston Posted July 20, 2019 Author Share Posted July 20, 2019 "Near Alias: Select another Reference Alias on this quest - the Story Manager will run the conditions only on any references linked to that alias's ref." Sounds great. Except where it says "(NOTE: Only linked refs with NO keyword are considered.)" at the end. Link to comment Share on other sites More sharing options...
SKKmods Posted July 20, 2019 Share Posted July 20, 2019 I would not use the near alias, I'd use Find matching reference closest to none and do the linked ref and keywords in the conditions box. There are a couple of base game quests that do this to pick owned Workshops without defense or recruitment beacons (or something like that). HasLinkedRef or IsLinkedTo plus HasKeyword and adding GetIsID or GetIsObjectType will speed up the search. Link to comment Share on other sites More sharing options...
Recommended Posts