nakano15 Posted February 5, 2023 Share Posted February 5, 2023 (edited) Based on tutorials on the internet, it seems like it's simply install Skse and it's ready to script, but in the practice, the methods aren't being recognized here. I tried to use GetNumItems() and GetNthForm() methods from the ObjectReference of the container, and Papyrus is giving me the error "X is not a function or does not exist". Someone has any idea how to make Papyrus recognize Skse scripts?I reinstalled Skse but the issue still persists. MiscObject Property Gold Auto ReferenceAlias Property Darmarash Auto ObjectReference Property MerchLootChest Auto Function EmptyInventoryOnCaravan() int GoldAcquisition = 0 int NumItems = MerchLootChest.GetNumItems() While NumItems > 0 NumItems -= 1 Form item = MerchLootChest.GetNthForm(NumItems) int ItemCount = MerchLootChest.GetItemCount(item) GoldAcquisition += item.GetGoldValue() * ItemCount MerchLootChest.RemoveItem(item, ItemCount, true) EndWhile Actor D = Darmarash.GetActorRef() int DarmarashSellRate = D.GetAv("Speechcraft") GoldAcquisition = DarmarashSellRate * GoldAcquisition * 22 / 100 Game.GetPlayer().AddItem(Gold, GoldAcquisition) D.AddItem(Gold, GoldAcquisition / 10, false) EndFunction The code in question by the way. Edited February 5, 2023 by nakano15 Link to comment Share on other sites More sharing options...
IsharaMeradin Posted February 6, 2023 Share Posted February 6, 2023 For 32 bit Skyrim (i.e. LE) SKSE source scripts (PSC files) need to be placed in the "Data > Scripts > Source" folder but only after also copying over the DLC scripts found in their subfolders. Be sure to copy over in the same order as released (i.e. Dawnguard, Hearthfires, Dragonborn). For 64 bit Skyrim (i.e. SE & AE) SKSE source scripts (PSC files) need to be placed in the "Data > Source > Scripts" folder. DLC scripts are already pre-merged. Do note that some authors consider the change in source file location a "bug" and change their setup to use the 32 bit location (i.e. modify the location in their CreationKitCustom.INI file and then move all the base game and & DLC scripts). Alternatively, you can use a third party program such as Notepadd++ or SublimeText to do all your script compiling. These programs have ways to setup multiple folders as the source location. This can be helpful if you want to work with some mod added scripts but not mix them up with the base game & DLC scripts. Link to comment Share on other sites More sharing options...
nakano15 Posted February 7, 2023 Author Share Posted February 7, 2023 I guess I'll try the Notepad++ solution, since trying the first solution presented shows errors saying that creation kit can't allocate something. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted February 7, 2023 Share Posted February 7, 2023 I guess I'll try the Notepad++ solution, since trying the first solution presented shows errors saying that creation kit can't allocate something.This page may be informative with regards to Notepad++https://www.creationkit.com/index.php?title=Notepad%2B%2B_Setup Link to comment Share on other sites More sharing options...
nakano15 Posted February 7, 2023 Author Share Posted February 7, 2023 When setting up the Notepad++, I also had to change the script from ScriptCompile.bat, since it was very different from the script shown in the page.At least now I can compile on notepad++, but I'm having another issue that I'm also having with Papyrus.Placing the SKSE source scripts inside Data/Scripts/Source causes it to shower lots of errors on many different scripts when trying to compile my script. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted February 7, 2023 Share Posted February 7, 2023 Are you working with 32 bit Skyrim (i.e. Legendary Edition) or 64 bit Skyrim (i.e. Special Edition / Anniversary Edition)? I ask because if you are working with 32 bit Skyrim, "Data > Scripts > Source" is the place where the Creation Kit looks for the source files.If you are working with 64 bit Skyrim, "Data > Source > Scripts" is where it will look instead. Also there are two versions of the Creation Kit. A 32 bit version available from Steam in the 'Tools' section of your library. And a 64 bit version available for free purchase* in the software section of the Steam store. Be sure to use the correct version for your game. Should you still have issues after making sure that your Creation Kit and game versions are correct. I do not know what to do then. It is not a problem with your script** as I have used those functions with an object reference as well without any issues. They should compile without complaint. * probably need to own Special Edition or Anniversary Edition before this becomes available. ** I was able to take your script as-is and compile it with making only one single correction. The issue with your inability to compile has to be somewhere in your setup of the software and files. For your script to compile change the following line: int DarmarashSellRate = D.GetAv("Speechcraft")into int DarmarashSellRate = D.GetAv("Speechcraft") as IntThe reason for this change is that GetAV and GetActorValue return a float value rather than an integer value. Thus the result needs to be cast into integer if an integer is what you want to work with. Link to comment Share on other sites More sharing options...
nakano15 Posted February 8, 2023 Author Share Posted February 8, 2023 Sorry for not specifying. I'm using 32 bits Creation Kit, because I'm modding on Legendary Edition of Skyrim.The errors were happening because I took the script files from src folder, instead of the one from the installation files of SkSE.By the way, I managed to be able to compile the mod scripts, now that I moved the correct files to Scripts/Source folder. Thanks for the help. :) Link to comment Share on other sites More sharing options...
IsharaMeradin Posted February 8, 2023 Share Posted February 8, 2023 Glad you got it working. Good luck in your modding endeavors! Link to comment Share on other sites More sharing options...
Recommended Posts