Jump to content

(F4SE) Getting all Keywords on a Furniture


niston

Recommended Posts

I tried like so:

 

 


ObjectReference refFurniture = akActor.GetFurnitureReference()

InstanceData:Owner furnitureInstance = new InstanceData:Owner
furnitureInstance.Owner = refFurniture
Keyword[] instanceKeywords = InstanceData.GetKeywords(furnitureInstance)

 

... but failed. instanceKeywords is always none. I think it's because InstanceData only works on Armor.

 

So is there any other way to get all keywords on refFurniture into me array?

Link to comment
Share on other sites

Possibly, there should be InstanceData.GetKeywords(furnitureInstance.Owner), as GetKeywords expects "owner" as a param? (PS. Hm, "owner" as a member of "Owner"..., bit confusing naming), but i'm only looking into all that for the first time.

 

Actually, i'd like to ask another question, since Keywords array is concerned here. I've encountered, that keywords applied by QuestAlias are not recognized (found) by certain ground processes, have two examples: ModdedItemHasKeyword condition doesn't see them (not so, item can be scrapped, while having alias Unscrappable kw), and playerCanStimpak keyword has no effect, unless attached directly to an Actor instance by AddKeyword(). I only can see a single func for getting ref's keywords, there is no distinct "get hard-attached" and "get soft-attached" variations (i suppose GetKeywords(Form) extracts those from base form, not a Ref? not the case then). Doubt if smth can be done to fix (?), just curious then, if that's normal.

Edited by hereami
Link to comment
Share on other sites

I tried your suggestion hereami:

 

 

InstanceData:Owner furnitureInstance = new InstanceData:Owner
furnitureInstance.Owner = refFurniture
Keyword[] instanceKeywords = InstanceData.GetKeywords(furnitureInstance.Owner)

 

 

But the results are not promising...

 

 


type mismatch on parameter 1 - cannot pass a form to a instancedata#owner
Link to comment
Share on other sites

If you look at the source code you will see that:

struct Owner
	Form owner			; Can be owning Actor/Weapon/Armor
	int slotIndex		; If owning actor, slotIndex must be provided
EndStruct

 

I think it's because InstanceData only works on Armor.

 

It seems that it works for Actor/Weapon/Armor only.

Link to comment
Share on other sites

Right.

 

And I found that CommonArrayFunctions is non native. Meh :/

 

I will just use a while loop and getkeyword myself then and save the call to the CAF script.

 

The goal is matching the keywords on a furniture against an array of keywords (and to tell which keyword matched first).

 

Since the array of keywords is potentially going to have many more entries than the average furniture has got keywords, I was hoping to iterate over the keywords on the furniture, instead of over the array of keywords. Would have been quicker!

 

Deep inside, I kinda also had some very high hopes for F4SE to provide at least a way to get me an array of all keywords on the furniture, if not giving a native way to match them :smile:

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...