Windows Headless 14.20 Doesn't Respect Mods

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
Post Reply
johnmegacycle
Inserter
Inserter
Posts: 22
Joined: Tue Jul 26, 2016 1:35 am
Contact:

Windows Headless 14.20 Doesn't Respect Mods

Post by johnmegacycle »

Good Day,
I created a StartFactorio.bat, with the following info:

C:\Games\Factorio\bin\x64\Factorio.exe --start-server C:\Games\Factorio\MultiplayerBobs.zip

I've also filled the Mods folder with several mods that I'd like to use. When I run the above batch file, the server is loaded, including the mods, everything works great. When I try to run this bat file from either Task Scheduler or create a service for it via NSSM the mods aren't being loaded, even though the server comes up just fine.
This is running on Windows Server 2012 and Factorio (14.20) is running in a headless manner.

User avatar
mexmer
Filter Inserter
Filter Inserter
Posts: 869
Joined: Wed Aug 03, 2016 2:00 pm
Contact:

Re: Windows Headless 14.20 Doesn't Respect Mods

Post by mexmer »

do you have properly set working directory?
i would suggest using batch file for that
my factorioserver.cmd (which is placed in d:\games\factorio)
looks like this

Code: Select all

cd %~dp0
start /wait .\bin\x64\factorio.exe --server-settings "data/server-settings.json" --start-server "saves/bobs.zip" --autosave-interval 5 --autosave-slots 5 --latency-ms 200 --port 34150
works as shortcut, service and from scheduler.

if you don't want to see server output, just remove /wait after start or don't use "start" command at all.

posila
Factorio Staff
Factorio Staff
Posts: 5202
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Windows Headless 14.20 Doesn't Respect Mods

Post by posila »

johnmegacycle wrote:When I try to run this bat file from either Task Scheduler or create a service for it via NSSM the mods aren't being loaded, even though the server comes up just fine.
Where are mods located? If they are in C:\Games\Factorio\mods then I don't have an idea why it wouldn't work. If they are in %APPDATA%\Factorio\mods, then probably Factorio is executed under different user when ran as service, therefore has different path to %APPDATA%

Either way you can add parameter --mods-directory <path_to_mods_directory> and have full control over where you want to have mods stored.

User avatar
mexmer
Filter Inserter
Filter Inserter
Posts: 869
Joined: Wed Aug 03, 2016 2:00 pm
Contact:

Re: Windows Headless 14.20 Doesn't Respect Mods

Post by mexmer »

posila wrote:
johnmegacycle wrote:When I try to run this bat file from either Task Scheduler or create a service for it via NSSM the mods aren't being loaded, even though the server comes up just fine.
Where are mods located? If they are in C:\Games\Factorio\mods then I don't have an idea why it wouldn't work. If they are in %APPDATA%\Factorio\mods, then probably Factorio is executed under different user when ran as service, therefore has different path to %APPDATA%

Either way you can add parameter --mods-directory <path_to_mods_directory> and have full control over where you want to have mods stored.
i thought game is lookig for config-path.cfg which is in "root" of game folder, and there is specified location of datafiles.

if you use "installer" version it points to profile directory, while in zipped version it points to folders inside "root" of game folder.
installer config
zip config
anyways, for running headless is better to use zipped version, and not installer version, since you can have it "anywhere" and better control where it read/writes. especially when using as service it's better, since you don't need to use user account with R/W profile.

johnmegacycle
Inserter
Inserter
Posts: 22
Joined: Tue Jul 26, 2016 1:35 am
Contact:

Re: Windows Headless 14.20 Doesn't Respect Mods

Post by johnmegacycle »

Thank you both very much for your time. I'll be able to test this out later tonight. Also, by using the zipped version and not the installer, I should be able to host two Headless servers at the same time on the same machine. I'll just have to specify different ports. Am I on the right path? ^_^

User avatar
mexmer
Filter Inserter
Filter Inserter
Posts: 869
Joined: Wed Aug 03, 2016 2:00 pm
Contact:

Re: Windows Headless 14.20 Doesn't Respect Mods

Post by mexmer »

johnmegacycle wrote:Thank you both very much for your time. I'll be able to test this out later tonight. Also, by using the zipped version and not the installer, I should be able to host two Headless servers at the same time on the same machine. I'll just have to specify different ports. Am I on the right path? ^_^
that will be not enough, either you will need to have 2 installations, or you will need also modify datapath and eventually also mod path, so each instance will save log file to different folder and have own mod config. i suggest having 2 complete folders, since you might also want separate mod configurations and so on. so it's better to separate them completely.
my server has different port, because game doesn't want to connect otherwise if run on same machine as server (i think it uses port for receiving reply packets from server), but multiple instance will indeed need different port each one.

johnmegacycle
Inserter
Inserter
Posts: 22
Joined: Tue Jul 26, 2016 1:35 am
Contact:

Re: Windows Headless 14.20 Doesn't Respect Mods

Post by johnmegacycle »

Right, sorry, I replied a bit hastily. With the zip version, two different folders, two different everything. I'm on the same page. How do you specify port that is being listened to? Also, I'm assuming if I connect via (server ip) without the port as in (server ip:port) then the default port is used, even though there are two instances on that physical server. The user must specify the port if they want to connect to a different instance.

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Windows Headless 14.20 Doesn't Respect Mods

Post by daniel34 »

johnmegacycle wrote:With the zip version, two different folders, two different everything. I'm on the same page. How do you specify port that is being listened to?
  • In the config\config.ini file:

    Code: Select all

    [other]
    port=34197
  • (only when running as server/headless) using the --port N (or --bind ADDRESS[:PORT]) console options of the factorio executable
quick links: log file | graphical issues | wiki

johnmegacycle
Inserter
Inserter
Posts: 22
Joined: Tue Jul 26, 2016 1:35 am
Contact:

Re: Windows Headless 14.20 Doesn't Respect Mods

Post by johnmegacycle »

You guys have been amazing and that looks like that was it.
My bat file needed some small tweaking, but the straight zip and not the installer was my issue.
I"ll do more tweaking for ports and such later, but the mods loaded right up and I'm good to go.
Task scheduler and NSSM work like a charm. ^_^

johnmegacycle
Inserter
Inserter
Posts: 22
Joined: Tue Jul 26, 2016 1:35 am
Contact:

Re: Windows Headless 14.20 Doesn't Respect Mods

Post by johnmegacycle »

johnmegacycle wrote:You guys have been amazing and that looks like that was it.
My bat file needed some small tweaking, but the straight zip and not the installer was my issue.
I"ll do more tweaking for ports and such later, but the mods loaded right up and I'm good to go.
Task scheduler and NSSM work like a charm. ^_^
I'm sorry, I really need to stop replying using my phone.
The installer was the issue. The straight zip worked great.

Post Reply

Return to “Technical Help”