Author Topic: [DONE][Suggestion] loading a saved game via command line  (Read 1837 times)

Offline aquatoid

  • Sergeant
  • **
  • Posts: 14
    • View Profile
[DONE][Suggestion] loading a saved game via command line
« on: June 17, 2024, 09:13:51 am »
(syntax)
AoW.exe "W:\Age of Wonders 1\Save\1111.acg"
OpenXcomEx.exe "W:\XCOM 1 - OpenXCOM Extended\user\xcom2\1111.sav"

here is an example i used to explain with another game
normally starting AoW.exe takes about 30 seconds to go through
a logo
loading screen
loading menu
loading icon
look for directories for a saved file if you collected many saved files
and needs a labor of maybe 15 clicks and 15 dragging a mouse

but AoW.exe "W:\Age of Wonders 1\Save\1111.acg" bypasses the non essential and loads all in 0.5 sec just by clicking a batch file by one click.

so, is there a way to do this OpenXcomEx.exe "W:\XCOM 1 - OpenXCOM Extended\user\xcom2\1111.sav" by any chance?
if not, would it possible to implement this type of syntax for a command line?

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9078
    • View Profile
Re: implementation of loading a savedgame file in a command line?
« Reply #1 on: June 17, 2024, 10:23:45 am »
you can run "OpenXcomEx.exe --cont" or "OpenXcomEx.exe --continue" to start OXCE and load the last save automatically

Offline aquatoid

  • Sergeant
  • **
  • Posts: 14
    • View Profile
Re: implementation of loading a savedgame file in a command line?
« Reply #2 on: June 17, 2024, 11:55:15 am »
>OpenXcomEx.exe --continue
was SO good. thanks. what other command lines are there?
i searched  "XCOM OpenXCOM Extended command lines" for 2 days in websites but i didnt find any

Offline psavola

  • Commander
  • *****
  • Posts: 827
    • View Profile
Re: implementation of loading a savedgame file in a command line?
« Reply #3 on: June 17, 2024, 05:26:01 pm »
Not much, you can see them here or usually with "-help": https://github.com/MeridianOXC/OpenXcom/blob/oxce-plus/src/Engine/Options.cpp#L604

Continue feature was commited by Yankes in Mar 2, 2024 with message "Add hidden option": https://github.com/MeridianOXC/OpenXcom/commit/ccca06b7b47663f31bc3f278e537c473348360d1 , so it might be intentional that it isn't that well documented (or known as of yet).

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9078
    • View Profile
Re: implementation of loading a savedgame file in a command line?
« Reply #4 on: June 17, 2024, 05:40:50 pm »
Continue feature was commited by Yankes in Mar 2, 2024 with message "Add hidden option": https://github.com/MeridianOXC/OpenXcom/commit/ccca06b7b47663f31bc3f278e537c473348360d1 , so it might be intentional that it isn't that well documented (or known as of yet).

Continue feature was implemented by Stoddard and submitted by me on Sept 30th 2018 with message "-cont/-continue command line arg to load the last saved game at start": https://github.com/MeridianOXC/OpenXcom/commit/1cb85343ceb764561173414a838d6b9158f5117c

It is mentioned in the changelog for OXCE 5.1: https://openxcom.org/forum/index.php?topic=6586.msg104491#msg104491

Offline psavola

  • Commander
  • *****
  • Posts: 827
    • View Profile
Re: implementation of loading a savedgame file in a command line?
« Reply #5 on: June 17, 2024, 09:42:06 pm »
My bad. I suppose the commit message I was looking at was the one documenting the feature in -help. OXCE 7.12 certainly doesn't yet mention it with -help.

Offline aquatoid

  • Sergeant
  • **
  • Posts: 14
    • View Profile
Re: implementation of loading a savedgame file in a command line?
« Reply #6 on: June 20, 2024, 05:37:38 am »
ECHO 1. very large UFO - lobsterman
ECHO 2. very large UFO - tasoth
ECHO 3. very large UFO - gilman
ECHO 4. very large UFO - mixed
echo.
ECHO 5. large UFO - lobsterman
ECHO 6. large UFO - tasoth
ECHO 7. large UFO - gilman
ECHO 8. large UFO - mixed
echo.
ECHO 9. large  UFO battleship - lobsterman
ECHO 0. medium UFO battleship - aquatoid
echo.
ECHO A. alien colony
ECHO B. alien activity
ECHO C. shipping routes
ECHO D. terror sites
ECHO E. tleth
echo.
SET VAR=DUMMY
SET /P VAR=INPUT:
IF /I %VAR%==DUMMY GOTO :EOF

IF /I %VAR%==1 (
start "" OpenXcomEx.exe --load "C:\very large UFO - lobsterman.sav"
)


after this i like to build a library as something like this

del /q "W:\XCOM 1 - OpenXCOM Extended\user\xcom2\*.sav"
"very large UFO - lobsterman.EXE" -OVERWRITE -TIMES=MODIFY
OpenXcomEx.exe --continue

a ZIP compressed file "very large UFO - lobsterman.EXE" contains maybe about 10 different saved files from 10 different games

maybe possible to implement of loading saved games further?

i already did this kind of things to my favorite games like
Age of Wonders 1 - collected 300 saved files
Jagged Alliance 2  - collected 500 saved files
Jagged Alliance 2 - Unfinished Business - 150 saved games
red alert 2
i think XCOM 1 - OpenXCOM Extended is a good candidate
« Last Edit: June 20, 2024, 05:54:06 am by aquatoid »

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9078
    • View Profile
Re: [DONE][Suggestion] loading a saved game via command line
« Reply #7 on: August 11, 2024, 05:53:43 pm »
Done.

Code: [Select]
OpenXcomEx.exe --load myfirstmission.sav