There is a much more elegant solution - https://www.nexusmods.com/starfield/mods/689
You will need to rename SFSE files every time you update SFSE but it will also enable JediScriptHook.exe to load SFSE *THROUGH* steam, no need for this extra file.
Immediate retraction, as this method loads starfield as whatever you rename its file to e.g "starfieldOriginal.exe" Unsure if this messes with the script hook, will test further.
Tested this to make sure and everything works fine.
"C:\Program Files (x86)\SteamLibrary\steamapps\common\Starfield\sfse_loader.exe" -- %COMMAND% into your steam launch options, this way you don't even need to rename files. To do that: right click Starfield in your Steam Library and go to > Properties > General > Launch Options (make sure the file path is correct, also the quotation marks before and after it are required)
When Gorky07 says "%COMMAND%" he literally means "%COMMAND%" - don't be smart and try to replace it with anything. That is a magic keyword that when present in a steam launch option will tell steam to run the launch options *INSTEAD* of the game's executable rather than passing them as arguments to the executable.
In cases where you want Steam to run some other executable, but that executable barfs at any command line arguments it is given, I do this (probably not necessary in this case, but I worked this out for some other game and now do it everywhere I want something similar):
cmd /c "echo %command% && SFSE_JediHook_Launcher_Compatibility.bat" Also, @Gorky07 you shouldn't need the full path, if the substitute exe is in the game directory you can just specify it
I don't get it. When I click the bat file, it opens the game twice. It never kills either one, so I have to manually close one, and I think I'm sometimes closing the wrong one, which causes a bunch of mods to stop working.
The whole thing had been a pain to get working, even with all the methods in use. The only thing im trying to get working is that NPC Looting mod and even with the hook thing loaded, it doesn't load it in. I give up. Eventually someone will step in and give us the mod with SFSE
Edit: Actually not wrong mod! So I followed the instructions for MO2, the game launches but SLSE seems to be not running as none of the CCR mods I use appear in the console, as they normally would do. Also the "achievements disabled" popup appears.
Works when I launch the Jedi Script Hook manually after the game/SLSE launched. But the bat file doesn't seem to launch SFSE properly.
Did you rename the SFSEloader.exe or something. I had someone else that it didn't work for, and he renamed the file. The Batfile is calling out the EXEs by name and expecting them all to be in the same folder, so if the filename was changed or the file isn't in the same folder, it's not going to work.
I don't know then; it's pretty straight forward how it works. It's just a script that calls out to launch SFSE by filename and expects it to be in the same folder as the BAT and Starfield exe. The game is launching right? so it's finding and launching Script Hook I gather?
EDIT: Never mind, the bat throws an error if SFSEloader.exe is not found and just hangs waiting for Starfield.exe to show up in the Task manager, never does anything. I just tested it on my system by renaming SFSEloader, and it did nothing, the game never launched.
As far as I understand and I could be wrong, but SFSE has to load Starfield.exe or it won't hook properly. Luckily, that is not true for Jedi's Script Hook. It can look for the exe running and hook into then. So, the order of operation is, The BAT has to launch SFSE first, give it enough time to launch starfield exe, and then launch Jedi's Script Hook. Jedi's Script Hook will check and see if Starfield.exe is running already, the key is, the icon must already appear on the taskbar and the black screen at startup of Starfield must come up first, otherwise Jedi's Script Hook will not see it as running and try to launch a second copy, hence the timeout. Helpfully this helps clear up any confusions.
So I set it up so that Jedi's launches first because it can launch the Script Hook without launching Starfield.exe, then will wait for it to launch. SFSE doesnt have this option to hold for launch, so I made it fire second.
I tested this in game and my SFSE plugins and Jedi's Classic Loot were both working. I found launching SFSE first will produces 2 Starfield.exe windows, which was a bit unwieldy and could cause problems for lower end machines.
Weird, your script doesn't work for me, I get an error when loading my save that the ESP mods are missing, because the SFSE Plugin.txt enabler mod is not getting loaded. I will play with it more.
Oh wait, maybe I understand you now, there's a setting in the script Hook ini? If so, what did you set? i will go re-read the Script hook description, maybe I missed that.
So I looked again and it actually ISNT working as I intended. You are right and the SFSE scripts dont load.
Its weird cause if i load Jedi's so its waiting for Starfield.exe, then SFSE, one at a time, they work just fine, and the game only launches once. Ive set the mod hidden until I get it working 100%.
it would be nice if he could update it so there's a setting to turn on/off whether his script launches starfield.exe. If you could turn it off and just have the script hook launch first, it will sit and wait until the game launches after SFSE, so it would probably work your way then with say a 1 second timer after his hook starts just to have a small delay to avoid any unforeseen issues. The issue with starting his app first is it starts starfield before SFSE can. Like for example, I have opened his app, waited for Starfield to launch, killed it manually and then opened SFSE and that worked, because his script hook will stay open and in the CMD windows, say it's waiting for the game to launch.
@ECHO START StarfieldScriptHookLauncher.exe FOR /L %%i IN (1,1,100) DO ( (TASKLIST | FIND /I "starfield.exe") && GOTO :taskkill) :taskkill TASKKILL /F /IM starfield.exe timeout /t 1 /nobreak start sfse_loader.exe
This one launches Script Hook first, then waits for starfield.exe to launch and kills it, then waits 1 second and starts SFSE. This should be, in theory, better as it no longer depends on a timer that is likely system dependent.
I am not sure what you mean. No, I don't run either as Administrator. There's no need to... They don't launch at the same time, there's a 1 second timer. The BAT launches Script Hook launches first, then Script Hook tries to launch Starfield.exe. Then the Bat has a command to wait for Starfield.exe to show up in Task Manager and kill it. Next, the script has a 1 second delay and finally launches SFSE. All this time, Script Hook is loaded and running in the background waiting for Starfield.exe to show up. Finally, SFSE launches Starfield.exe, Script Hook sees it and it's all working. I guess if you are running a really old or slow CPU, the 1 second timer might not be enough, but the Script is working perfectly for me. I've ran it over 100 times already.
Some people may have trouble following this. So, I made a video going over it. Hopefully it helps more. The video will take a few hours to process on YouTube. Feel free to share. I care more about helping people get it working than credit.
Just download the .bat file attached to the mod and put that in the Main Game folder with Starfield.exe/SFSE/and Jedi's Script Hook. You don't need MO2. The BAT file is actually what launches both. If you don't want MO2, just double click the BAT file, or you can even right-click send to desktop to create a shortcut on your desktop. You can even change the icon of that shortcut to the Starfield Icon if you wanted. The MO2 stuff is just to make the BAT file work with MO2 but isn't required. Hope you understand what I mean.
33 comments
You will need to rename SFSE files every time you update SFSE but it will also enable JediScriptHook.exe to load SFSE *THROUGH* steam, no need for this extra file.
Immediate retraction, as this method loads starfield as whatever you rename its file to e.g "starfieldOriginal.exe"
Tested this to make sure and everything works fine.Unsure if this messes with the script hook, will test further.
"C:\Program Files (x86)\SteamLibrary\steamapps\common\Starfield\sfse_loader.exe" -- %COMMAND%
into your steam launch options, this way you don't even need to rename files.
To do that: right click Starfield in your Steam Library and go to > Properties > General > Launch Options
(make sure the file path is correct, also the quotation marks before and after it are required)
is it SFSE_JediHook_Launcher_Compatibility.bat or SFSE_JediHook_Launcher_Compatibility without .bat extension?
In cases where you want Steam to run some other executable, but that executable barfs at any command line arguments it is given, I do this (probably not necessary in this case, but I worked this out for some other game and now do it everywhere I want something similar):
cmd /c "echo %command% && SFSE_JediHook_Launcher_Compatibility.bat"
Also, @Gorky07 you shouldn't need the full path, if the substitute exe is in the game directory you can just specify it
Edit: Actually not wrong mod! So I followed the instructions for MO2, the game launches but SLSE seems to be not running as none of the CCR mods I use appear in the console, as they normally would do. Also the "achievements disabled" popup appears.
Works when I launch the Jedi Script Hook manually after the game/SLSE launched. But the bat file doesn't seem to launch SFSE properly.
EDIT: Never mind, the bat throws an error if SFSEloader.exe is not found and just hangs waiting for Starfield.exe to show up in the Task manager, never does anything. I just tested it on my system by renaming SFSEloader, and it did nothing, the game never launched.
@LeastDegenAzuraEnjoyer for visibility:
@ECHO
START StarfieldScriptHookLauncher.exe
FOR /L %%i IN (1,1,100) DO (
(TASKLIST | FIND /I "starfield.exe") && GOTO :taskkill)
:taskkill
TASKKILL /F /IM starfield.exe
timeout /t 1 /nobreak
start sfse_loader.exe
I tested this in game and my SFSE plugins and Jedi's Classic Loot were both working. I found launching SFSE first will produces 2 Starfield.exe windows, which was a bit unwieldy and could cause problems for lower end machines.
Hope that clears it up!
Its weird cause if i load Jedi's so its waiting for Starfield.exe, then SFSE, one at a time, they work just fine, and the game only launches once. Ive set the mod hidden until I get it working 100%.
@ECHO
START StarfieldScriptHookLauncher.exe
FOR /L %%i IN (1,1,100) DO (
(TASKLIST | FIND /I "starfield.exe") && GOTO :taskkill)
:taskkill
TASKKILL /F /IM starfield.exe
timeout /t 1 /nobreak
start sfse_loader.exe
This one launches Script Hook first, then waits for starfield.exe to launch and kills it, then waits 1 second and starts SFSE. This should be, in theory, better as it no longer depends on a timer that is likely system dependent.
Edit: seems like you just have to not run both starfield.exe and SFSE as administrator.
S.A.S.L - (Starfield Advanced Steam Launcher) - SFSE - MO2 - IntervalSave - One-Click Integration at Starfield Nexus - Mods and Community (nexusmods.com)
I have tried every single way and I either get sfse running without the bat file or the bat file but with no mod support. It's so odd