» Thu May 03, 2012 11:00 pm
Posted this over at your Nexus topic to the same question, but can't hurt to repeat it here:
As long as the item the NPC is wearing and you're checking for is from this same mod, you can use EditorID fine. EditorIDs from other plugins you just read up or something won't work. That's where FormID comes into play. However, as FormID is depending on the plugin's place in load order (1st two digits is hex for place in load order), this way using hardcoded FormIDs from other plugins will also hardcode the script to the one single load order and none else will work. In this case I think those fancy OBSE functions along the line of GetFormFromMod or what it's called come in handy. Though I haven't got around to use them myself, yet.
And I discourage usage of "GetEquippedObject 20" (20 for upper, lower, hand and foot slot combined) to this matter, as it will only return correct results as long as the item worn covers all 4 slots at once, no more and no less. Items not covering those 4 slots but some less, like only cuirass or robes, or even more slots than these will return a value I couldn't yet decipher the meaning of. It is not the EditorID/FormID of the item worn and it is not "0" (empty slot). "GetEquippedObject 20" doesn't help in identifying different "types" of armor at the same time, only those actually occupying all 4 slots at once.
Whereas "GetEquipmentSlotMask 4" (4 for upperbody) will return the EditorID/FormID of every item worn which "at least" occupies the upperbody slot. Works reliably with cuirasses, robes, fullbody armors and any arbitrary combination of slots as long as upperbody is occupied by it. This even covers slot-combinations impossible for "GetEquippedObject", as it covers all there can be. So that's my personal preference at any time.