Darklocq Posted September 27, 2018 Share Posted September 27, 2018 (edited) If you get errors like "unable to locate script ActiveMagicEffect" and "unknown type objectreference", "unknown type actor", as if there is no game data present at all, poring over various forum threads provided the answer a little at a time. Example total error message here, for a very short script: Starting 1 compile threads for 1 files...Compiling "DrqMango_CallMangoScript"...C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\DrqMango_CallMangoScript.psc(0,0): unable to locate script ActiveMagicEffectC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\DrqMango_CallMangoScript.psc(3,25): unknown type objectreferenceC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\DrqMango_CallMangoScript.psc(4,25): unknown type objectreferenceC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\DrqMango_CallMangoScript.psc(6,26): unknown type actorC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\DrqMango_CallMangoScript.psc(6,42): unknown type actorC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\DrqMango_CallMangoScript.psc(8,15): objectreference is not a known user-defined typeNo output generated for DrqMango_CallMangoScript.psc, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on DrqMango_CallMangoScript.psc 1) Make sure that your paths in Skyrim\SkyrimEditor.ini are correct. Triple-check. Make sure the game runs, and the Creation Kit runs. If something's messed up in the INIs, the Papyrus Compiler or a third-party equivalent like Skyrim Script Compiler or GECK is also likely to fail. 2) Make sure that Skyrim\TESV_Papyrus_Flags.flg is present. If you don't have it, search your drive for it. if still not found, simply create one, since it's just a short text file: /* Format is as follows (whitespace is completely ignored, index must be between 0 and 31 inclusive): Flag <name> <index> // flag is allowed on all types or: Flag <name> <index> { <list of script, property, variable, or function> } // flag is allowed only on the specified types */ // List of flags for TESV - DO NOT EDIT // Flag hides the script or property from the game editor Flag Hidden 0 { Script Property } // Flag on an object designates it as the script the condition system will look at // Flag on a variable allows the script variable to be examined by the condition system Flag Conditional 1 { Script Variable } 3) Look in Skyrim\Data\ for a file called Scripts.rar (or Scripts.zip for Skyrim SE), provided as part of the CK install. Extract it into your Skyrim\Data\ folder. Or better yet, open it with WinRAR or 7Zip, and selectively drag the folders in it into your Skyrim\Data\ folder so you're damned sure they're going to the correct place and you're getting the ones you want. Let them merge. This RAR or ZIP archive contains the source as well as binary versions of the vanilla scripts, and you need those source files to compile. They are in the Scripts\source\ folder in the RAR or ZIP. It also contains a DialogueViews\ folder with XML files which might or might not be needed, depending on what you're doing, but which are not included in the game's BSA files, just like the Scripts\source\ files were missing. You don't need the compiled versions of the scripts, just the source (the compiled versions are already in the game's BSA files), plus the DialogueViews\ files. So, in my case, I dragged DialogViews\ from the RAR into \Skyrim\Data\, and Scripts\source\ from the RAR into \Skyrim\Data\Scripts\ and that was that. If you want to be thorough, you can use BSA Commander or the like to see what scripts are contained in Skyrim - Misc.bsa versus what's included as compiled scripts in Scripts.rar, but there's about 5000 of them, so I did not bother, and am not going to worry about it. (The reason to leave the BSA files in the BSAs when possible is that it's more efficient for the game (and the CK) to extract them from BSAs in RAM than to pull them from the hard drive. People have benchmarked this and proven it, and it's why this stuff is in BSA archives in the first place. This situation would be void if SSDs and the busses that control them actually reach RAM speed at some point.) 3a) If the extraction of Scripts.rar (or .zip) wants to overwrite something, that's up to you. The most likely scenario is that you have newer versions of a number of scripts in the Skyrim\Data\Scripts\ folder and its source\ subfolder that were provided by SKSE. If you let these be overwritten, you'll have to reinstall SKSE, or stuff will fail badly. In my case, I just didn't let it overwrite, only extract source files that were not already present, and I didn't extract the compiled versions at all. It really depends on how much you've already built up your game with mods whether you'll run into a file conflict like this. You may well have installed other mods than SKSE that provided updated script files, so not overwriting is probably the safest bet. 3b) If you do not have Scripts.rar (or .zip, for Skyrim SE), search your drive for it. If it's just gone, and you do not have core script source files like Skyrim\Data\Scripts\source\ObjectReference.psc in place already (presumably from previously extracting Scripts.rar), then you have to re-download the CK from Steam and have it do a fresh install, so you get that RAR or ZIP file. Honestly, it's completely ridiculous that Papyrus Compiler cannot understand that the referred-to vanilla script like ObjectReference.pex is in place, and instead requires the source version to be present (by way of comparison, imagine if every time you installed a new bit of Linux software you had to download the full source code of every single dependency and every dependency of that dependency!). But such is life; we just have to work with what we're given, in the only way it will actually work. 4) Restart the CK, just to be on the safe side. The CK seems very poor at realizing that a file is in place after already having decided it wasn't before, during the same session. 5) If you have multiple installs (e.g. a development install and a playing install), you'll need to install these source files into the other copy's Data\Scripts\source\ folder, if you expect to be able to do something like use Skyrim Script Compiler in that local copy. 6) If you use Mod Organizer, NMM, or Wrye Bash's BAIN, or some other mod manager, you can either install the RAR's contents manually and let these additional files be "unmanaged" by that app, or have the mod manager install the files from Scripts.rar (or .zip) as if it's a mod, though that may not be the safest option. Doing it the latter way will install the entire contents, much of which you do not need since the compiled scripts are just copies of what's in the BSA. More seriously, it may overwrite newer scripts (from SKSE, etc.), depending on the mod manager. (BAIN will not, being smarter than that; I don't know about MO, since I only use it for extracting FOMODs, and I manage my actual game with BAIN. NMM is generally excoriated, so I neither know nor care what it does.) The magic sauce here is the Scripts\source\ material (and maybe the DialogViews\ material, if you're working on that stuff). Most of what the CK does is BSA-aware; only Papyrus Compiler seems to have dain bramage. See this thread for a quick way to test whether you've overwritten SKSE scripts, which is the likely reason you're still getting errors if you followed my instructions here but still can't compile. I hope this saves someone(s) else a lot of hair-pulling in trying to get Papyrus Compiler to do the one simple thing it's designed to do but which it will not do out of the box. Edited June 12, 2019 by Darklocq Link to comment Share on other sites More sharing options...
Taedus Posted March 18, 2019 Share Posted March 18, 2019 How do you create a textfile that end with .flg? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted March 18, 2019 Share Posted March 18, 2019 How do you create a textfile that end with .flg?Change the extension either when saving or renaming the file. May need to set Windows to show extensions instead of hiding them which is default behavior. But I'd wait on creating one as the file is packed inside the Scripts.rar file for Skyrim and the Scripts.zip file for Skyrim Special Edition. Presumably the Fallout version(s) would be similar. Link to comment Share on other sites More sharing options...
b7ll Posted May 14, 2019 Share Posted May 14, 2019 This is exactly what I needed to get started - thank you Dark! Following your steps worked like a charm (and I'm using MO). Link to comment Share on other sites More sharing options...
Darklocq Posted May 14, 2019 Author Share Posted May 14, 2019 This is exactly what I needed to get started - thank you Dark! Following your steps worked like a charm (and I'm using MO). Glad it worked for you in MO. I don't actually use that as my main mod manager, just as a FOMOD extractor. (I use Wrye Bash for finer control and less hassles about "virtualized" directories; I recommend using Git, Bazaar, or some other version control system for that kind of setup, though.) Link to comment Share on other sites More sharing options...
qwertypol012 Posted May 15, 2019 Share Posted May 15, 2019 (edited) Didn't realize that someone just made a topic about this so i went ahead made my own topic asking about the problem i'm experiencing. I tried to compile some scripts and there's a single script which always failed no matter what. That script is indeed quite big (probably) with almost 3000 lines of code. My CK can't seem to be able to compile it.Here's the error message:DEFAULT: BSString::Set(): Could not allocate full amount of memory asked for with aiMaxLen I have tried all of your solutions and tried other solutions i got from steam forum and other places (i googled it), but unfortunately still to no avail. They worked for my other scripts (yeah i experienced some failures with other scripts too but following your guides and other guides fixed it), but not for this single big script. FYI, my CK installed in a laptop (not gaming one, only has 2gb ram) and i don't know whether it's caused by my laptop's low spec. Do you have any clue about this issue?Thanks in advance :smile: Edited May 15, 2019 by qwertypol012 Link to comment Share on other sites More sharing options...
IsharaMeradin Posted May 15, 2019 Share Posted May 15, 2019 Didn't realize that someone just made a topic about this so i went ahead made my own topic asking about the problem i'm experiencing. I tried to compile some scripts and there's a single script which always failed no matter what. That script is indeed quite big (probably) with almost 3000 lines of code. My CK can't seem to be able to compile it.Here's the error message:DEFAULT: BSString::Set(): Could not allocate full amount of memory asked for with aiMaxLen I have tried all of your solutions and tried other solutions i got from steam forum and other places (i googled it), but unfortunately still to no avail. They worked for my other scripts (yeah i experienced some failures with other scripts too but following your guides and other guides fixed it), but not for this single big script. FYI, my CK installed in a laptop (not gaming one, only has 2gb ram) and i don't know whether it's caused by my laptop's low spec. Do you have any clue about this issue?Thanks in advance :smile:Memory could be a concern. The CK does have a character limit in the script editor too. However, it is possible to compile longer scripts with the CK. Method 1:Go to the Gameplay drop down menu and select Compile Papyrus Scripts. After a bit of time it brings up a new window with EVERY accessible PSC file. Locate yours, check it and press the compile button. Method 2:Go to the Gameplay drop down menu and select Papyrus Script Manager.A new window appears.Use the filter to locate your file.Right click on its entry and select Compile. But if memory is truly the issue, you may need to utilize a third party tool to compile your scripts. https://www.creationkit.com/index.php?title=Category:Papyrus At the link please see the section on the right hand side labeled External Text Editors. The linked pages contain instructions on setting up each program to be capable of compiling papyrus scripts. If you go this route, you only need to use one. Tho if you mod both original Skyrim and SSE, you may wish to set up a different editor for each game. I know from first hand experience that it can be easy to forget to swap the instruction file that tells Sublime Text which game folders to utilize. Link to comment Share on other sites More sharing options...
qwertypol012 Posted May 16, 2019 Share Posted May 16, 2019 But if memory is truly the issue, you may need to utilize a third party tool to compile your scripts. https://www.creationkit.com/index.php?title=Category:Papyrus At the link please see the section on the right hand side labeled External Text Editors. The linked pages contain instructions on setting up each program to be capable of compiling papyrus scripts. If you go this route, you only need to use one. Tho if you mod both original Skyrim and SSE, you may wish to set up a different editor for each game. I know from first hand experience that it can be easy to forget to swap the instruction file that tells Sublime Text which game folders to utilize. It works!!! Thanks man, i'm really grateful hahaha :DHopefully it works fine in game :) For anyone who still got problems compiling scripts using CK, try this method. I'm using Notepad++ one :thumbsup: Link to comment Share on other sites More sharing options...
Grognaurd Posted October 9, 2019 Share Posted October 9, 2019 Thank you very much for your efforts. I am trying to learn scripting. I also do not want to screw anything up I have a "Fresh Steam install" and "Fresh Creation Kit install from Bethesda Launcher".I have launched Skyrim and I have launched the creation kit. The Creation kit extracted the scripts.zip. I have created a folder on my Desktop called "Modding"Within that folder I have a folder called "data"Inside that folder I have copied the folder "scripts" from the Steam/Beth Install. Also in the folder "Modding" I have copied the folder "Papyrus Compiler" from the Steam/Beth Install I launch Notepad++ and direct it to the copied papyrus compiler. Now, if I copy a script that is supposed to work into Notepad++, what do I do? I assume save the text code somewhere? Do I direct it to the new source folder I created? When I hit compile, will it tell me if it failed or if it worked? I am sorry for being such a noob Link to comment Share on other sites More sharing options...
Darklocq Posted October 14, 2019 Author Share Posted October 14, 2019 Grognaurd, I assume you saw the post above by IsharaMeradin about how to set up an external editor like Notepad++, and my own OP mentioned several alternative compilers. You're asking several things at once here (directly and indirectly), so I'll take them in order (and perhaps at excessive and rambling length – coffee is my skooma!): * I'm skeptical that a separate copy of Papyrus Compiler in a C:\Users\[Whatever]\Desktop\Modding\Data\ directory is going to function properly. I've never gotten Pap.Comp. to work except within a copy of the entire game (i.e. something like C:\User\[Whatever]\Desktop\Skyrim Copy for Modding\Data\, with the entire game setup included, not just the Data folder contents). But your mileage may vary. I also have noticed that the "Oldrim" and SSE versions of the Creation Kit are very separate animals, with different kinds of piracy checks; the SE stuff seems more "brittle" and more difficult to get it working in two directories (playing and development) at once on the same system. * I'm not using Notepad++ for Papyrus script editing myself, but Skyrim Script Compiler. However, yes, you would need to save the new/modified script somewhere, presumably the fully functional Data\Scripts\Source folder in which you're working (unless you want to save a bunch of potential tests to a temp directory, and then check them out in the compiler in series, but moving them one at a time into the "live" Source folder at whatever filename is expected there). My own tactic has been to make a backup copy of any script I'm editing, so I can revert to the original and start over if I mangle something. I also use a development copy of the entire game (independently runnable apart from my playing copy). And I have it all under version control, so I can revert in a more fine-grained manner if I want. Anyway, since you're using Notepad++, I would suggest reviewing the external editor setup material that IsharaMeradin mentioned. One thing I didn't mention in my OP is that I found out the hard way that it's much easier to use a "virgin" Steam/Bethesda install as the development copy, and a fresh copy under your user directory somewhere (off Desktop or whatever) as the playing copy. I had many headaches doing it the other way around. In the Steam dev copy, I never install anything I do not absolutely need to do the dev/testing I need to do, and then I remove even that after I'm done, so that I never accidentally create wacky local dependencies. Too many times I've download mods from noob modders which worked fine on their systems but which crap out on mine or anyone else's because of some missing hard-coded dependency they didn't even realize was there. Unless you have nearly no mods of any kind installed in your dev copy, it can be very difficult to remember if any given item, texture, model, character, or whatever is Bethesda's or from a modder. * As noted above, your new Source folder might or might not actually be viable, and this may depend on whether the CK has enough of the resources it expects for it to operate and to not think it's been pirated. A complete copy of the whole game seems to be the best way to avoid any problems in this regard. * "When I hit compile, will it tell me if it failed or if it worked?" Heh. That's for you to tell us. >;-) Link to comment Share on other sites More sharing options...
Recommended Posts