hwengine command line utility
The newest version of the Hedgewars engine, currently in SVN only, supports a new command line feature.
It is possible to start a replay of a game directly from the terminal issuing the standalone hwengine utility with very simple syntax. The replay files are usually contained in the configuration directory:
- %USERPROFILE%\.hedgewars in windows
- ~/.hedgewars in Linux
- ~/Library/Application Support/Hedgewars in Mac OS X
Standard Use
$ hwengine path_to_data_folder path_to_replay_file
the data folder is where you installed the game, or where you configured it when you compiled.
Advanced Use
it is possible to specify additional settings by adding one third argument (and only one)
- --set-video [screen width] [screen height] [color dept]
- --set-audio [volume] [enable music] [enable sounds]
- --set-other [language file] [full screen] [show FPS]
these options always require three additional configuaration and are mutually exclusive (that is, you can only set one of them, if you need to configure more, you have to use the l33t arguments below).
Very Advanced Use (l33t only)
(intentional non-explanation of the commands below, like any other l33t documentation)
- --set-multimedia [screen height] [screen width] [color dept] [volume] [enable music] [enable sounds] [language file] [full screen]
- --set-everything [screen height] [screen width] [color dept] [volume] [enable music] [enable sounds] [language file] [full screen] [show FPS] [alternate damage] [timer value] [reduced quality]
Some examples
let's see some GOOD examples
$ hwengine installpath/hedgewars/Data anywhere/replay.hwd
$ hwengine installpath/hedgewars/Data anywhere/replay.hwd --set-video 800 600 32
$ hwengine installpath/hedgewars/Data anywhere/replay.hwd --set-everything 1280 1024 32 128 1 1 en.txt 0 0 0 8 0
and some BAD examples
$ hwengine anywhere/replay.hwd
$ hwengine installpath/hedgewars/Data anywhere/replay.hwd --set-video 800 600
$ hwengine installpath/hedgewars/Data anywhere/replay.hwd --set-video 800 600 32 --set-audio 128 1 1
Post questions and doubts here in comments, as this page will be referenced when a wrong argument format is used!
bye
Koda
Some random thoughts:
You could use the (windows) installer to provide an (optional) "open" verb/command for replay files calling hwengine as described above. This would as well allow us to open replays just by clicking linked files in browser windows. Don't know about Linux/Unix/Mac but guess there are similar possibilities.
You used "%HOME%" for the windows path but (at least under Windows Vista) that variable is undefined by default and might confuse people. Use "%USERPROFILE%" instead as that one points to the right folder.
Also the "advanced" options are quite weird. Please try to dump the 1337 commands and instead allow us to use more than one of the others.
does not seem to work on my linux box (arch linux).
1. it tries to write to /usr/share/hedgewars/Data/debug0.txt and when it cannot (normally Data is not world writeable) it terminates with:
An unhandled exception occurred at $08065FB3 :
EInOutError : File not open
$08065FB3
An unhandled exception occurred at $08066259 :
EInOutError : File not open
$08066259
$08057F40
$0809D920
$0805B007
$08065FB3
2. when you allow write access to directory it hangs with 'Freeing progress surface...' message.
would be great if you could address these issue.
ciao, jose
this should be fixed in latest svn.
could you try to reproduce on your machine?
thanks
the fix is tested and now the error is no more.
also this page is deprecated, all new wiki pages should be done at our googlecode page.
updated version: http://code.google.com/p/hedgewars/wiki/CommandLineOptions