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.
Re: Windows Headless 14.20 Doesn't Respect Mods
Posted: Sun Nov 20, 2016 12:47 pm
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
if you don't want to see server output, just remove /wait after start or don't use "start" command at all.
Re: Windows Headless 14.20 Doesn't Respect Mods
Posted: Sun Nov 20, 2016 1:25 pm
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.
Re: Windows Headless 14.20 Doesn't Respect Mods
Posted: Sun Nov 20, 2016 3:12 pm
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.
config-path=__PATH__system-write-data__/config
#This value specifies the way the aplication generates default values for path.read-data and path.write-data
#When set to true, it will use system directories (Users/Name/AppData/Roaming/Factorio on windows), this is set to true
#for the installer versions of Factorio, as people will usualy install it in program files, and the aplication can't write
#to program files by default (without UAC turned off), similar with osx/linux packages.
#When set to false (default value for zip package), it will use application root directory, this is usable to create self-sustainable
#Factorio directory that can be copied anywhere needed (on usb etc), also for people, who don't like to manipulate saves
#in the windows users directory structure (as me, kovarex).
#Note, that once the values in config are generated, this value has no effects (unless you delete config, or the path.read-data/path.write-data values)
use-system-read-write-data-directories=true
config-path=__PATH__executable__/../../config
#This value specifies the way the aplication generates default values for path.read-data and path.write-data
#When set to true, it will use system directories (Users/Name/AppData/Roaming/Factorio on windows), this is set to true
#for the installer versions of Factorio, as people will usualy install it in program files, and the aplication can't write
#to program files by default (without UAC turned off), similar with osx/linux packages.
#When set to false (default value for zip package), it will use application root directory, this is usable to create self-sustainable
#Factorio directory that can be copied anywhere needed (on usb etc), also for people, who don't like to manipulate saves
#in the windows users directory structure (as me, kovarex).
#Note, that once the values in config are generated, this value has no effects (unless you delete config, or the path.read-data/path.write-data values)
use-system-read-write-data-directories=false
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.
Re: Windows Headless 14.20 Doesn't Respect Mods
Posted: Mon Nov 21, 2016 7:20 pm
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? ^_^
Re: Windows Headless 14.20 Doesn't Respect Mods
Posted: Mon Nov 21, 2016 8:16 pm
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.
Re: Windows Headless 14.20 Doesn't Respect Mods
Posted: Mon Nov 21, 2016 9:06 pm
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.
Re: Windows Headless 14.20 Doesn't Respect Mods
Posted: Mon Nov 21, 2016 10:38 pm
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?
(only when running as server/headless) using the --port N (or --bind ADDRESS[:PORT]) console options of the factorio executable
Re: Windows Headless 14.20 Doesn't Respect Mods
Posted: Tue Nov 22, 2016 1:54 am
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. ^_^
Re: Windows Headless 14.20 Doesn't Respect Mods
Posted: Tue Nov 22, 2016 1:59 pm
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.