Factorio on CP

Having problems with the panel? Have questions? Post here!
Post Reply
Lumpster
Posts: 3
Joined: Wed Mar 10, 2021 4:37 am

Factorio on CP

Post by Lumpster »

Hi i'm running a windows server trying to run Factorio through the control panel. I can run a bat file on the server and the server starts up as it should but if i close that down and then proceed to launch the server from the CP it crashes and does'nt show any logs. The CP will start the server if i just use --start-server but does not load the save game file.

the bat file is this

start /wait e:\factorio\bin\x64\factorio.exe --start-server-load-latest --server-settings e:\factorio\data\server-settings.json

if i use --start-server-load-latest --server-settings e:\factorio\data\server-settings.json

the server does not start if flickers factorio in the processes for 1 sec then disappears.

i do get logs if i use the bat file directly.

the CP is pointed at the factorio.exe
Masher
Site Admin
Posts: 3612
Joined: Thu Apr 20, 2006 2:54 pm
Location: America's Heartland
Contact:

Re: Factorio on CP

Post by Masher »

I'll see what I can figure out and let you know.
Masher
-----------
Please do not PM me unless asked to! We are a small company. If you have an issue or question it would be best to post it in the forums where it can help others in the future.

NEW Join our Discord!
Masher
Site Admin
Posts: 3612
Joined: Thu Apr 20, 2006 2:54 pm
Location: America's Heartland
Contact:

Re: Factorio on CP

Post by Masher »

So factorio uses the user's profile to save/load map data. Since the panel runs as a different user than when you run the server via the batch file, you have a couple of options.

Make a junction link to your 'batch file' user's factorio profile data. This will allow you to continue using batch file and or panel and both will use the same data. You may have to remove c:\Windows\system32\config\systemprofile\AppData\Roaming\Factorio first.

Code: Select all

mklink /J c:\Windows\system32\config\systemprofile\AppData\Roaming\Factorio c:\Users\<your username>\AppData\Roaming\Factorio
Or copy your current factorio profile to the panel user's profile path: c:\Windows\system32\config\systemprofile\AppData\Roaming\Factorio

This would allow the panel and batch file to be independent of each other

Also you want to set the root, server working directory, and exe as follows:
Server root: <actual folder with server i.e. e:\servers\factorio>
Working directory: %Root%
Server exe: %Root%\bin\x64\factorio.exe

%Root% is a variable and the panel will replace the %Root% variable with the value you set in Server root setting. It seems to work for me (I did the junction method). Let me know how it works out for you.
Masher
-----------
Please do not PM me unless asked to! We are a small company. If you have an issue or question it would be best to post it in the forums where it can help others in the future.

NEW Join our Discord!
Masher
Site Admin
Posts: 3612
Joined: Thu Apr 20, 2006 2:54 pm
Location: America's Heartland
Contact:

Re: Factorio on CP

Post by Masher »

Appears you can also do this, although I've not tested it.

https://wiki.factorio.com/Application_d ... _directory
Masher
-----------
Please do not PM me unless asked to! We are a small company. If you have an issue or question it would be best to post it in the forums where it can help others in the future.

NEW Join our Discord!
Lumpster
Posts: 3
Joined: Wed Mar 10, 2021 4:37 am

Re: Factorio on CP

Post by Lumpster »

Hi first of all many thanks it worked and the method i choose was

Or copy your current factorio profile to the panel user's profile path: c:\Windows\system32\config\systemprofile\AppData\Roaming\Factorio

This would allow the panel and batch file to be independent of each other

Also you want to set the root, server working directory, and exe as follows:
Server root: <actual folder with server i.e. e:\servers\factorio>
Working directory: %Root%
Server exe: %Root%\bin\x64\factorio.exe

with the command line as it should be

--start-server-load-latest --server-settings e:\factorio\data\server-settings.json
Post Reply