niston Posted January 6 Posted January 6 This is sort of the reverse of GetFormFromFile(). Gives back the plugin filename a reference comes from, or "RUNTIME" if it was created at runtime: String Function GetFileFromForm(ObjectReference queryForm) int formId = queryForm.GetFormID() int msByte = Math.RightShift(formId, 24) if (msByte == 0xff) ; runtime form return "RUNTIME" endif Game:PluginInfo[] pluginsList int pluginIndex = 0 if (msByte == 0xfe) ; light plugin pluginsList = Game.GetInstalledLightPlugins() pluginIndex = Math.LeftShift(formId, 8) pluginIndex = Math.RightShift(pluginIndex, 20) else ; regular plugin pluginsList = Game.GetInstalledPlugins() pluginIndex = msByte endIf return pluginsList[pluginIndex].name EndFunction In case anyone else needs it. Requires F4SE. 3
AndalayBay Posted January 6 Posted January 6 There are two mods for Oblivion that do something like this. Perhaps the same could be done for FO4. Oblivion mods: FormID Finder and RefScope.
niston Posted January 7 Author Posted January 7 10 hours ago, AndalayBay said: Perhaps the same could be done for FO4. There is this for console use https://www.nexusmods.com/fallout4/mods/26582
AndalayBay Posted January 7 Posted January 7 Yes, I found that - thanks. It's a huge improvement. The Oblivion versions are a little less intrusive as they don't require the console. Mind you Oblivion has console debugging so it might have more information readily available.
Recommended Posts