JediStudley Posted September 14, 2020 Share Posted September 14, 2020 I'm trying to use functions on the quest of another mod and the cast is not working for me. I'm not sure what I'm doing wrong and any suggestions would be greatly appreciated! in my mod, I'm trying this line: (note "qFlowerGirlsSeduction" is a Quest property that is initialized to the quest FlowerGirlsSeduction in the other mod...which is a master to my mod)int seductionRank = (qFlowerGirlsSeduction as dxFlowerGirlSeduction).GetSeductionRank( target ) The error when saving the script in CK is: cannot convert to unknown type dxflowergirlseduction I was also trying to make the dependencies between the mods more flexible by using "GetFormFromFile()", but ran into the same problem. I'm sure it's something simple I'm just overlooking. Thanks! Link to comment Share on other sites More sharing options...
Balx2 Posted September 14, 2020 Share Posted September 14, 2020 Did you declare your properties? Quest Property FlowerGirlsSeduction Auto Const Int Property seductionRank Auto ConstNot sure if that's correct, someone with more knowledge can correct me. Link to comment Share on other sites More sharing options...
JediStudley Posted September 14, 2020 Author Share Posted September 14, 2020 The declaration for the quest property is done. The seductionRank is a local Int. The CK compiler does not recognize the type I'm casting to, "dxFlowerGirlSeduction". That's the name of the script which contains the function being called. Interestingly, I'm able to add the script with that name to my mod's quest! Link to comment Share on other sites More sharing options...
JediStudley Posted September 15, 2020 Author Share Posted September 15, 2020 Ok, made some headway! The 'other' mods in question use BSA archives for their scripts. Extracting the script files into that mod's directory (as loose files) allows the CK papyrus compiler to access them. Now the errors indicate files/mods that the other mod depends on, can not be found. Is there a limitation on the CK and do I need to use the papyrus compiler on the command line? Or is there something I'm missing because it seems incorrect that the scripts need to be extracted from the BSA... Link to comment Share on other sites More sharing options...
IsharaMeradin Posted September 16, 2020 Share Posted September 16, 2020 The CK needs the PSC files. You will have to extract them. More specifically, the compiler needs them. It does not matter if you compile with the CK, directly on the command line or with a third party tool like Sublime Text. The PSC files must be available to be read by the compiler. I would recommend using Sublime Text or other third party tool as those can be set up to utilize multiple directories and thus not need to have all PSC files into a single location and running the risk of potentially overwriting scripts in the wrong order. You'll have to follow the rabbit hole of required PSC files in order to get the one to compile. *******************************In answer to your initial post dxFlowerGirlSeduction dxFGS ;set this in the empty state with your properties dxFGS = qFlowerGirlsSeduction as dxFlowerGirlSeduction ;define it in your OnInit() event and in the outside chance of mid-game updating include it in a function triggered by an OnPlayerLoadGame event. ;at the very least define it prior to being used int seductionRank = dxFGS.GetSeductionRank(target) ;use it whenever you see fit throughout your script ;******************************* ;you can skip the property if that prevents having to have the mod as a parent master by doing the following dxFlowerGirlSeduction dxFGS ;set this in the empty state with your properties Quest dxFGSQuest = Game.GetFormFromFile(0x00123456,"Modname.esp") ;replace 123456 with the last 6 digits of the quests Editor ID number as seen in the CK or xEdit ;replace Modname.esp with the plugin and extension of the mod in question dxFGS = dxFGSQuest as dxFlowerGirlSeduction ;define it in your OnInit() event and in the outside chance of mid-game updating include it in a function triggered by an OnPlayerLoadGame event. ;at the very least define it prior to being used int seductionRank = dxFGS.GetSeductionRank(target) ;use it whenever you see fit throughout your script Link to comment Share on other sites More sharing options...
Recommended Posts