Compiling Scripts - Mod Organiser / Creation Kit / Sublime Text 3
~~~~~~~~~~~~
This post has been revised 2016-02-05 to be less [slightly] angsty since I have slept since the original posting of 2014-12-03.
~~~~~~~~~~~~
Problems this post should help you fix.
-
Problem: Sublime Text 3 cannot be used with MO.
-
Solution: Yes, it can work.
-
Problem: Compiling scripts with Sublime Text causes .pex files to go into the OVERWRITE directory instead of the directory the script came from. This means you have to move shit back into its mod folder manually every time you compile, which can be quite often while greenfielding.
-
Solution: Scripts can be copied into their specific mod folder automatically for you after compiling.
~~~~~~~~~~~~
Below is the original post, somewhat revised but mostly original.
~~~~~~~~~~~~
It is almost 6am, I have spent all day dicking with MO, I am hungry, tired, and pissed off. This has been a major pain in the ass. Using MO you cannot right click > compile any more, and the author of Mod Organiser seems to have no plans to fix it has made a thing to fix it, but it isn't really working well. The resulting output still ends up in your overwrite directory instead of where I want it to be (with the mod it came from). Last thing I want to do is add another series of clicks and drags every time I build (which can be like 20 times an hour).
Something about 32-bit 64-bit and not building a 64bit MO. I don't know. I don't care anymore. Here is the bullshit I had to go through to get to modding again with MO.
The current SublimePapyrus only works right with Sublime 2, and I want to use 3.
Get this shit.
- Mod Organiser.
- Sublime Text 3 - 32 BIT VERSION. 64BIT VERSION WONT WORK.
- Get my hacked PapyrusCompiler.exe
This is what I did to it:
This is what I did to it: corflags.exe papyruscompiler.exe /force /32bitreq+
This tells windows to run this little shit in 32bit mode I guess. If you don't do this, PapyrusCompiler can't see the magic MO clusterfuck. corflags.exe comes in the Windows SDK and explaining how to install that, find it, find the right copy of the 10 corflags.exe it comes with, and use it, was a giant ass NOPE.
Do this shit.
1) Install MO. Get your game working. Get your saves loading. All that crap. This is the part that took me all day honestly.
2) Find your Papyrus Compiler directory in your Skyrim directory, make a backup copy of your PapyrusCompiler.exe and then put mine in that folder replacing the old one.
3a) Close all instances of ST3.
3b) Add sublime text as an executable to MO.
4) Launch Sublime through MO.
5) Sublime Text > Tools > Build Systems > New Build System. It will open a new file. Paste this crap into it.
{ "shell":true, "cmd": [ "%YOUR-SKYRIM-PATH%\\Papyrus Compiler\\PapyrusCompiler.exe", "${file}", "-f=%YOUR-SKYRIM-PATH%\\Data\\scripts\\Source\\TESV_Papyrus_Flags.flg", "-i=%YOUR-SKYRIM-PATH%\\Data\\scripts", "-o=%HOME%", "-asmonly", "&&", "chdir","%HOME%","&&", "%YOUR-SKYRIM-PATH%\\Papyrus Compiler\\PapyrusAssembler.exe", "${file_base_name}", "&&", "del","${file_base_name}.pas","&&", "move","${file_base_name}.pex","${file_path/Source//i}" ]}
Figuring out this lovely chain of retardedness has been the last 5 hours of my life. The spoiler contains why.
If you let PapyrusCompiler.exe run as normal, your pex file ends up in the MO Override directory and not your output directory. I have no fucking clue why BECAUSE THE GOD DAMN PAS FILE STAYS WHERE IT IS SUPPOSE TO BE. So here I tell it to dump it to a directory far away from MO's magic bullshit, run PapyrusAssembler.exe on it manually, then move that pex file into where we actually wanted the damn thing.
5) See the %YOUR-SKYRIM-PATH%? Delete all of them and put in your path to Skyrim. It appears in that code 4 times, so guess how many places you have to edit it. For example, I would replace it with C:\\Games\\Steam\\steamapps\\common\\Skyrim. See how I double backslashed every directory. DO THAT.
DONT FUCK WITH ANYTHING ELSE IN THIS CODE I FIGURED OUT. LIKE THAT %HOME% IS AN EPIC HACK.
Your Skyrim has probably has Program Files (x86) in it if you let Steam default itself.
6) Save that file as MyPapyrus.sublime-build in the directory it defaults to. It should be a directory within sublime where it stores its settings and crap. For me that was C:\Program Files\Sublime Text 3\Data\Packages\User as I am running the portable version.
7) Sublime Text > Tools > Build Systems > MyPapyrus. Make sure that your new build is checkmarked.
8) Open a script, make sure your script is the active tab. Sublime Text > Tools > Build or hit CTRL+B or F7. You will get a pane at the bottom of Sublime with the output. It should say something like this.
Starting 1 compile threads for 1 files...
Compiling "sgo_QuestController"...
Compilation succeeded.
Batch compile of 1 files finished. 1 succeeded, 0 failed.
Starting assembly of sgo_QuestController
0 error(s), 0 warning(s)
Assembly succeeded
1 file(s) moved.
[Finished in 7.1s]
If it spews errors about not finding scripts like Quest or whatever your script depends on, you fucked up the build file, or you fucked up adding Sublime to MO, or you fucked up launching Sublime with MO. Hell, you could have even just fucked up installing the mods with MO, including forgetting something like SKSE or SKYUI SDK, or forgot to checkbox one of the mods that includes the scripts you need, or needing to extract files from BSA (like Sexlab Aroused). So many things.
Want to run Skyrim with Sublime and Creation Kit open to actually test? Unlock MO again and launch Skyrim.
No matter what, right click > compile in CK will no longer ever work as long as you use MO. Something about a bag of dicks or something. Whatever. Just do this. And remember to always close all ST3 instances and then re-launch it via MO when you plan to mod.
3 Comments
Recommended Comments