EPDGaffney Posted January 3, 2018 Share Posted January 3, 2018 (edited) EDIT: reviewed a response from Miguick and it turns out you only need the six-digit FormID, without the mod index, which I suppose is the point of naming the plug-in file when executing the function. Then I thought it wasn't working because it's in a separate script from another one and both use GetGameRestarted as a condition and the standard quest delay of 5. So my new question is, how performance intensive is it to bring that quest delay down very low on a script that uses GetGameRestarted? Probably need a new thread for that. -------------------------------------------------------------------------------------------------------------------------------- It mentions I need the hexadecimal FormID for the thing I want to reference. How does one get that from a mod and use it in a script like this? In my case, it's HonestHearts.esm, which as we all know has a mod index that varies from user to user and as such will alter the FormID of everything it adds depending on each individual's load order. I'm trying to reference NVDLC02AntivenomEffect and NVDLC02AntivenomEffectNoMessage for users that have Honest Hearts but not for people that don't. I've already tried with the EditorIDs and it had no effect, so on rereading I realised the wiki mentions the hexadecimal FormID and thought I'd try that. The FormID of NVDLC02AntivenomEffect is xx00F94A.The FormID of NVDLC02AntivenomEffectNoMessage is xx011300. Any help is very much appreciated. Edited January 3, 2018 by EPDGaffney Link to comment Share on other sites More sharing options...
JustChill Posted June 27, 2018 Share Posted June 27, 2018 Hi...I actually found your thread by googling for "GetFormFromMod" and I think I'll have to respond here, simply as you recommended that function to me.Recently as told in my "repair script thread", I am using patch scripts where I add forms from mods into Form Lists.Stupidly I used "BuildRef" for any single reference from the mod. It works pretty well, but it is torture to find the hex FormID, convert it to a decimal number as many issues can happen there. I am looking forward to use "GetFormFromMod" in future. Even if I believe that you answered your question already, the syntax is pretty simple of this one. ref rForm If IsModLoaded "HonestHearts.esm" set rForm to GetFormFromMod "HonestHearts.esm" "F94A" ;=> For the antivenom Endif My solution is way more complicated (dumb): ref rForm short sModIndex If IsModLoaded "HonestHearts.esm" Set sModIndex to GetModIndex "HonestHearts.esm" Set rForm to BuildRef sModIndex, 63818 ;=> This is the decimal value of "F94A" EndifI've used the second solution in all my 2 patch scripts now and had to verify any single entry.Took me the whole weekend as described. I personally recommend to use "GetFormFromMod" instead of "BuildRef" as it is way easier to include the FormID directly from the item, instead of building up a reference by converting the hex FormID into a decimal value. Most of the time was wasted in verifying if the decimal values were correct (could only do that ingame by calling the name of the FormIDs and checking if they fit or even appear as <no name> (which would indicate a bad FormID)) EDIT: reviewed a response from Miguick and it turns out you only need the six-digit FormID, without the mod index, which I suppose is the point of naming the plug-in file when executing the function.Yet, I am unsure if you really need 6 digits, if the first digits after the mod index are zeros. This is a direct quote from the wiki regarding the syntax: set rForm to GetFormFromMod "Some Plugin.esp" "AED" Maybe the example is wrong, but they don't use a full 6 digits FormID here.Even though the example is horrible as it only contains letters of hexadecimal system. Users who are unaware could get confused. Link to comment Share on other sites More sharing options...
EPDGaffney Posted June 27, 2018 Author Share Posted June 27, 2018 Yes, that's true. I really meant that the mod index was not intended to be included in the Form ID, not that it must be six digits. Link to comment Share on other sites More sharing options...
Recommended Posts