Script to find all Forms with a given type and keyword (KYWD

Post » Sun Dec 02, 2012 2:53 pm

In a papyrus script (or SKSE or DragonScript, if necessary), what's the easiest way to find all FormIDs of a certain type (say, ARMO) which have a certain keyword (say, KYWD 0006BBE3 "ArmorMaterialIron"?

I'm trying to extend a mod which modifies sets of items, but it currently does this by hardcoding Form ID Lists (FLSTs) of the appropriate items (i.e. IronArmors = Iron Cuirass, Iron Helmet, etc). I'm trying to find a way to make it automatically support mods that add new armors or weapons, so I thought maybe I can just search for the material keywords instead. I don't necessarily mind iterating every single armor and weapon, since I'll only have to do it once per session and then I can store the lists of FormIDs for later -- I just want to be able to do it in a script rather than hardcoded ID lists so that it can pick up any items added by other mods, even if their load order is later.

Thanks for any suggestions! I'm just getting into Skyrim modding so apologies if this is documented somewhere, I wasn't able to find it.
User avatar
Cat
 
Posts: 3451
Joined: Mon Dec 18, 2006 5:10 am

Return to V - Skyrim