Obtain Mod .esp Name From a Form ID

Post » Sun Oct 27, 2013 12:52 pm

Trying to figure out how I would go about finding the .esp that a particular form comes from. So far I have been trying to calculate how this would work based on the formIDs. So thinking about mod order:

0x01000000 = 16777216 (int value)

0x02000000 = 33554432

0x03000000 = 50331548

...etc

So it seems that based on the first bit I should be able to determine load order, correct?--since each mod increments by an additional 16777216? Something like:

intFormID = testForm.getFormID()string targetMod = getModName(intFormID / 16777216)

However, I'm not sure if I did this absolutely right, and I'm also concerned by two other things I've heard - that the first bit supposedly gets weird for very high load order numbers (not sure if that's accurate), and also the whole negative formID debacle that's been discussed here recently (although I'd be getting this formID from a Quest, so I think that shouldn't be a concern for me, right?)

Perhaps there's also an easier way to do this. Thanks in advance for any feeback.

User avatar
Hairul Hafis
 
Posts: 3516
Joined: Mon Oct 29, 2007 12:22 am

Return to V - Skyrim