"Enter" on main menu to continue game
Moderator: ickputzdirwech
-
- Filter Inserter
- Posts: 261
- Joined: Tue Jan 29, 2019 4:00 am
- Contact:
Re: "Enter" on main menu to continue game
There's a command-line option so you don't even have to see the startup menu:
--load-game FILE
...of course, that requires you to know the name of your file. If you tend to use new or incrementing names a lot when saving, you'd have to modify your shortcut frequently.
https://wiki.factorio.com/Command_line_parameters
--load-game FILE
...of course, that requires you to know the name of your file. If you tend to use new or incrementing names a lot when saving, you'd have to modify your shortcut frequently.
https://wiki.factorio.com/Command_line_parameters
- brunzenstein
- Smart Inserter
- Posts: 1115
- Joined: Tue Mar 01, 2016 2:27 pm
- Contact:
Re: "Enter" on main menu to continue game
That's dope. I guess I would settle for a --continue-previous-game optionKyralessa wrote: ↑Tue Apr 21, 2020 10:19 am There's a command-line option so you don't even have to see the startup menu:
--load-game FILE
...of course, that requires you to know the name of your file. If you tend to use new or incrementing names a lot when saving, you'd have to modify your shortcut frequently.
https://wiki.factorio.com/Command_line_parameters
- 5thHorseman
- Smart Inserter
- Posts: 1193
- Joined: Fri Jun 10, 2016 11:21 pm
- Contact:
Re: "Enter" on main menu to continue game
Naw just do a listing of the files in your script, ordered by date, and allow the user to pick one by number. Or even allow "enter" to pick the first one.
I think I'm going to write this for myself actually.
- 5thHorseman
- Smart Inserter
- Posts: 1193
- Joined: Fri Jun 10, 2016 11:21 pm
- Contact:
Re: "Enter" on main menu to continue game
This batch file will run factorio with your newest save. You need to replace "#######################" with the correct path to your Factorio install.
And here's an ugly and uncommented batch file that assumes you have the gnu utilities for Windows installed (or at least grep, sed, and head) and lets you pick one of 10 options, 1-9 are your 9 newest saves, and 0 is to run Factorio with no save. You need to replace "#######################" with the correct path to your Factorio install.
Here's an untested version that should work with only gnu "head" installed, which is a much less daunting thing than installing all of the gnu utilities. You need to replace "#######################" with the correct path to your Factorio install.
For both, you may or may not want that "exit" at the end. I did, which of course means the popd's aren't really all that necessary.
Code: Select all
@echo off
pushd ##################\saves
dir *.zip /od /b > saves.txt
for /f %%i in (saves.txt) do set _game=%%i
pushd ##################\bin\x64
Factorio.exe --load-game %_game%
popd
popd
Code: Select all
@echo off
pushd #######################\saves
dir *.zip /o-d /b | head -9 > recent.txt
echo 0 - No save file (just run the game)
grep -n . recent.txt|sed "s/:/ - /"
choice /c 1234567890
set _choice=%errorlevel%
if %_choice%==10 goto :justrun
head -%_choice% recent.txt > choice.txt
for /f %%i in (choice.txt) do set _game=%%i
pushd #######################\bin\x64
Factorio.exe --load-game %_game%
goto :done
:justrun
pushd #######################\bin\x64
Factorio.exe
:done
popd
popd
exit
Code: Select all
@echo off
pushd #######################\saves
dir *.zip /o-d /b | head -9 > recent.txt
echo [0]No save file (just run the game)
find /n "." recent.txt
choice /c 1234567890
set _choice=%errorlevel%
if %_choice%==10 goto :justrun
head -%_choice% recent.txt > choice.txt
for /f %%i in (choice.txt) do set _game=%%i
pushd #######################\bin\x64
Factorio.exe --load-game %_game%
goto :done
:justrun
pushd #######################\bin\x64
Factorio.exe
:done
popd
popd
exit
- CheeseMcBurger
- Long Handed Inserter
- Posts: 87
- Joined: Sun May 19, 2019 9:57 pm
- Contact: