JetSteele Posted January 19, 2015 Share Posted January 19, 2015 So I am making a compatibility patch between my mod Supernatural and Moonlight Tales to allow players that use that mod too while using my mod. Now I need to access a Moonlight Tales script from my mod using GetFormFromFile fuction. I set it up properly but I get a CK error saying that the script is not a user defined type. The quest itself that runs the script however is accepted by this function. Do I ignore the error as if you have moonlight tales running it will correct itself (meaning that the script will launch properly even though CK states otherwise)? I'll test the patch after I finish making it but I just wanted to know if it will work or not? Sorry for the noob question, its my first compatibility patch I'm making so I wanted to make sure everything will be fine. Link to comment Share on other sites More sharing options...
Mattiewagg Posted January 19, 2015 Share Posted January 19, 2015 Shouldn't you just make your patch dependent on Moonlight Tales by making it an esm (open Wrye Bash, right click Moonlight Tales>Esmify, open CK and made edits and your patch dependent on both your mod as an esm, esmified the same way, and the esm of Moonlight Tales. When done, right click and espify the two mods used as patch masters) and you can also just use the scripts from that mod in your mod. Just install Moonlight Tales and if it's a bsa unpack it into your directory. You can now choose scripts and use them from your scripts just as if Moonlight Tales would be there, since it's assumed the player has installed Moonlight Tales if they're using your patch. Sorry if that made no sense, I'm tired. :P Link to comment Share on other sites More sharing options...
JetSteele Posted January 19, 2015 Author Share Posted January 19, 2015 I could do that but then I would have to make the patch every time I need to update my mod; I'm kinda lazy and don't want to do that every time :tongue: , doing it with GetFormFromFile means that it just needs to be done once. Sure its longer process since I need to get all of the FormID's but I don't need to patch my mod more than once unless Brevi (from Moonlight Tales) decides to re-number his ID's; the patch is good forever :smile: . So yeah, I could do that but it doubles my work load when releasing for no reason. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted January 19, 2015 Share Posted January 19, 2015 You cannot access a script by using GetFormFromFile. Instead you obtain the object the script is attached to, in this case a quest, and then dynamically obtain the script from it. Something like Function SomeFunction() Quest SomeQuest = Game.GetFormFromFile(0x00123456,"SomeMod.esp") as Quest SomeQuestScript SQS = SomeQuest as SomeQuestScript SQS.SomeFunctionOnSomeQuestScript() EndFunctionI should note that, I have not used this method of obtaining a script to use properties or functions. But it should work. See here. And if you aren't actually needing to use functions or properties from the other mod's script. Then you don't need to mess with trying to access it for your patch to work. Link to comment Share on other sites More sharing options...
JetSteele Posted January 19, 2015 Author Share Posted January 19, 2015 thanks for the info :) Link to comment Share on other sites More sharing options...
smashly Posted January 19, 2015 Share Posted January 19, 2015 (edited) Couldn't you also use:Quest.GetQuest(string editorId)http://www.creationkit.com/GetQuest_-_Quest Quests do not have to be running to be collected.This can be a good alternative to using GetFormFromFile to return quests, or to check for a certain plugin to be present, as authors rarely change editor ids.I've tried it myself as opposed to Game.GetFormFromFile() as I don't need to know the file name or the FormID, I just look for the quest by the editor string, if it's not there then the plugin isn't loaded. Edited January 19, 2015 by smashly Link to comment Share on other sites More sharing options...
Arthmoor Posted January 19, 2015 Share Posted January 19, 2015 That's an SKSE-only command though. If your mod otherwise does not require SKSE, making people need it because of that would be kind of silly. Authors may actually change IDs more than they'd be inclined to change a form ID though. Out of all the years I've been in the community I've only ever seen two people do that. One of them was me, because I was trying to align forms in Oblivion mods so they could be merged safely. The other was someone else doing more or less the same thing with his mod. It's not a practice I'd recommend for Skyrim mods. Link to comment Share on other sites More sharing options...
JetSteele Posted January 19, 2015 Author Share Posted January 19, 2015 I agree with Arthmoor, ID's are changed from time to time; hell I do it also. So using the GetQuest wouldn't be my best option. However people don't always reorder FormID's so therefore its my best bet. I'll finish off the patch (almost done) and see if its a CK error that corrects itself once you get in game or not...I'll let you guys know. Link to comment Share on other sites More sharing options...
Recommended Posts