#4214: --savegame commandline option not working
-------------------------------------+-------------------------
        Reporter:  swenzel           |      Owner:
            Type:  bug               |     Status:  new
        Priority:  normal            |  Milestone:  unspecified
       Component:  Savegames         |    Version:  3.1.1
Operating System:  All/Non-Specific  |
-------------------------------------+-------------------------
\
\
 Trying to speed up code testing a bit I created a savegame to test the
 movment system.
 Now I wanted to load it from the commandline with `warzone2100
 --savegame=shuffle_test` however it seems as if this commandline option
 was not tested for a long time...

 Most important information first: '''the savegame loads fine when loaded
 from the regular loading screen.'''

 First error I get is that the savegame cannot be found.
   The reason for this is in line 567 of clpars.cpp
   {{{snprintf(saveGameName, sizeof(saveGameName), "%s/%s", SaveGamePath,
 token);}}}
   Here the path is (I guess) out of date.

   The result of this string formation is in my case
   `savegames//shuffle_test`
   but should be
   `savegames/skirmish/shuffle_test.gam`

   so either one should change --savegame's value here
 [http://developer.wz2100.net/wiki/CommandLineOptions]
   from 'NAME' to '{skirmish | campaign}/NAME.gam' and change `"%s/%s"` to
 `"%s%s"`
   or make a dynamic name lookup...
   the former is probably easier and also my solution :D
   With `warzone2100 --savegame=skirmish/shuffle_test.gam` the program now
 finds the savegame.

 Second error I get is that Nexus AI was not found.
   The reason for this is near main.cpp:1300

 {{{
         // Do the game mode specific initialisation.
         switch(GetGameMode())
         {
                 case GS_TITLE_SCREEN:
                         startTitleLoop();
                         break;
                 case GS_SAVEGAMELOAD:
                         initSaveGameLoad();
                         break;
                 case GS_NORMAL:
                         startGameLoop();
                         break;
                 default:
                         debug(LOG_ERROR, "Weirdy game status, I'm
 afraid!!");
                         break;
         }
 }}}

   For `GS_SAVEGAME` `startTitleLoop()` is not called
     therefore `frontendInitialize()` is not called
       therefore `readAIs()` is not called
       (who put that into the initializer of the __frontend__!?
       Actually this initializer seems to initialize far more than the
 frontend...
       maybe it's better to rename it?)

   So I put `startTitleLoop()` at the beginning of `initSaveGameLoad()` to
 have all this initialization stuff and also this problem is solved
   (same if I just put `readAIs()` there instead of `startTitleLoop()` but
 due to the other initialization stuff I prefer it otherwise)

 Current error (and probably not the last one) is a tougher one and (at the
 moment) I can't deal with it.
 {{{
 swen@swen-desktop-linux:~/git/warzone2100$ src/warzone2100
 --savegame=skirmish/shuffle_test.gam
 info    |03:28:00: [realmain:1143] Using
 /home/swen/.warzone2100-master/logs/WZlog-0921_152800.txt debug file
 error   |03:28:02: [sound_SetTrackVals:122] sound_SetTrackVals: track 0
 already set (filename: "beep1.ogg"
 error   |03:28:02: [sound_SetTrackVals:122] sound_SetTrackVals: track 1
 already set (filename: "beep2.ogg"
 error   |03:28:02: [sound_SetTrackVals:122] sound_SetTrackVals: track 2
 already set (filename: "beep4.ogg"
 error   |03:28:02: [sound_SetTrackVals:122] sound_SetTrackVals: track 3
 already set (filename: "beep5.ogg"
 error   |03:28:02: [sound_SetTrackVals:122] sound_SetTrackVals: track 4
 already set (filename: "beep6.ogg"
 error   |03:28:02: [sound_SetTrackVals:122] sound_SetTrackVals: track 5
 already set (filename: "beep7.ogg"
 error   |03:28:02: [sound_SetTrackVals:122] sound_SetTrackVals: track 6
 already set (filename: "beep8.ogg"
 error   |03:28:02: [sound_SetTrackVals:122] sound_SetTrackVals: track 7
 already set (filename: "beep9.ogg"
 error   |03:28:02: [sound_SetTrackVals:122] sound_SetTrackVals: track 8
 already set (filename: "gmeshtdn.ogg"
 40      ../sysdeps/unix/sysv/linux/waitpid.c: No such file or directory.
 Line number 0 out of range; netqueue.cpp has 279 lines.
 Line number 0 out of range; netqueue.cpp has 279 lines.
 Saved dump file to '/tmp/warzone2100.gdmp-fQms6N'
 If you create a bugreport regarding this crash, please include this file.
 Segmentation fault (core dumped)
 }}}

 I have also appended a patch containing my solutions for the first two
 problems.
\
\
\

--
Ticket URL: <http://developer.wz2100.net/ticket/4214>
Warzone 2100 Trac <http://developer.wz2100.net/>
The Warzone 2100 Project
------------------------------------------------------------------------------
Slashdot TV.  Video for Nerds.  Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
_______________________________________________
Warzone2100-project mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/warzone2100-project

Reply via email to