list of executable switches?

Discussion of all aspects of the game engine, including development of new and existing features.

Moderator: Forum Moderators

Post Reply
dagoi-koi
Posts: 15
Joined: October 30th, 2007, 4:55 am

list of executable switches?

Post by dagoi-koi »

Can someone point me to a list of the wesnoth executable switches?

So far I have found :
--nogui
--multiplayer
--controllerX=ai
--algorithmX=ai1.py

I am unsure how to select a map for the AI's to play on. Also, is there a way to report the faction of each team to stdout?

Thank you.
User avatar
Iris
Site Administrator
Posts: 6800
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Post by Iris »

By starting wesnoth with the "--help" switch:

Code: Select all

Battle for Wesnoth v1.3.9+svn
Started on Tue Oct 30 09:48:12 2007

usage: ./src/wesnoth/src/wesnoth [OPTIONS] [DATA-DIRECTORY]
  --bpp number                 sets BitsPerPixel value. Example: --bpp 32
  --compress INFILE OUTFILE    compresses a savefile (INFILE) that is in text WML
                               format into binary WML format (OUTFILE).
  -d, --debug                  shows extra debugging information and enables
                               additional command mode options in-game.
  --decompress INFILE OUTFILE  decompresses a savefile (INFILE) that is in binary
                               WML format into text WML format (OUTFILE).
  -f, --fullscreen             runs the game in full screen mode.
  --fps                        displays the number of frames per second the game
                               is currently running at, in a corner of the screen.
  -h, --help                   prints this message and exits.
  --load SAVEGAME              loads the file SAVEGAME from the standard save
                               game directory.
  --log-<level>="domain1,domain2,..."
                               sets the severity level of the debug domains.
                               "all" can be used to match any debug domain.
                               Available levels: error, warning, info, debug.
  --logdomains                 List defined log domains and exit.
  --nocache                    disables caching of game data.
  --validcache                 assume that cache is valid (dangerous)
  --nosound                    runs the game without sounds and music.
  --max-fps                    the maximum fps the game tries to run at the value
                               should be between the 1 and 1000, the default is 50.
  --path                       prints the name of the game data directory and exits.
  --python-api                 prints the runtime documentation for the python API.
  -r, --resolution XxY         sets the screen resolution. Example: -r 800x600
  -t, --test                   runs the game in a small test scenario.
  -v, --version                prints the game's version number and exits.
  -w, --windowed               runs the game in windowed mode.
  --no-delay                   run the game without any delays.
  --multiplayer                runs a multiplayer game. There are additional
                               options that can be used as explained below:
  --algorithm<number>=value    selects a non-standard algorithm to be used by the
                               AI controller for this side.
  --controller<number>=value   selects the controller for this side.
  --era=value                  selects the era to be played in by its id.
  --nogui                      runs the game without the GUI. Must appear before
                               --multiplayer to have the desired effect.
  --parm<number>=name:value    sets additional parameters for this side.
  --scenario=value             selects a multiplayer scenario. The default
                               scenario is "multiplayer_The_Freelands".
  --side<number>=value         selects a faction of the current era for this side
                               by id.
  --turns=value                sets the number of turns. The default is "50".
  --exit-at-end                exit Wesnoth at end of scenario.
shadowm@greycore:~>
Not sure about the other questions.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
dagoi-koi
Posts: 15
Joined: October 30th, 2007, 4:55 am

Post by dagoi-koi »

Ah. Can't do that with windows, or at least I don't know how.

Also the map name must be capitalized even on Windows.
Soliton
Site Administrator
Posts: 1732
Joined: April 5th, 2005, 3:25 pm
Location: #wesnoth-mp

Post by Soliton »

dagoi-koi wrote:Ah. Can't do that with windows, or at least I don't know how.
You can, it's just a bit awkward since the output is redirected to stdout/err.txt on windows.
dagoi-koi wrote: Also the map name must be capitalized even on Windows.
I'm not sure what you're trying to say here but the filesystems windows uses are usually case insensitive.

Anyway, here's an example command line to let two AIs play against each other:

Code: Select all

wesnoth --nogui --multiplayer --scenario=multiplayer_The_Freelands --controller1=ai --side1="Knalgan Alliance" --controller2=ai --side2="Knalgan Alliance" --algorithm2=python_ai --parm2=python_script:bruteforce.py
Linger mode seems to kick in at the end of the game so you probably have to manually kill it if you use the dev version.
"If gameplay requires it, they can be made to live on Venus." -- scott
User avatar
Noyga
Inactive Developer
Posts: 1790
Joined: September 26th, 2005, 5:56 pm
Location: France

Post by Noyga »

dagoi-koi wrote:Ah. Can't do that with windows, or at least I don't know how.

Also the map name must be capitalized even on Windows.
You could test this from a command shell (btw i don't know if Wesnoth is in the search path).
To invoke a command shell tou can do launch "cmd" from the excute dialog.
"Ooh, man, my mage had a 30% chance to miss, but he still managed to hit! Awesome!" ;) -- xtifr
dagoi-koi
Posts: 15
Joined: October 30th, 2007, 4:55 am

Post by dagoi-koi »

Thanks for all the help! I now have it working.
elricz
Posts: 194
Joined: September 7th, 2006, 8:19 pm
Location: Imrryr
Contact:

Post by elricz »

If you do it in Windows from the command line, the output will be on the contents of the stdout.txt file, on the same directory as the Wesnoth executable.
User avatar
Iris
Site Administrator
Posts: 6800
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Post by Iris »

Noyga wrote:btw i don't know if Wesnoth is in the search path.
Windows usually keeps programs isolated in their directories, so that they are not in PATH unless the user manually adds their directories to PATH. Note that Windows' path search is not recursive (i.e., if C:\Foo is in PATH, typing willy won't launch C:\Foo\Bar\Willy.exe unless you add C:\Foo\Bar to PATH too).
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
VS
Translator
Posts: 187
Joined: November 27th, 2005, 10:07 am

Post by VS »

There is a way to add entry like "promt here" to folders. I enabled / installed / hacked it so long back that I don't remember how I did it, but that shouldn't matter. Once you get it working, just right click folder - open prompt - and it starts in the folder. Life without this would be so dull :P

Some reference:
Google search "windows context menu on folder prompt here"
First good find from that search
elricz
Posts: 194
Joined: September 7th, 2006, 8:19 pm
Location: Imrryr
Contact:

Post by elricz »

VS wrote:There is a way to add entry like "promt here" to folders. I enabled / installed / hacked it so long back that I don't remember how I did it, but that shouldn't matter. Once you get it working, just right click folder - open prompt - and it starts in the folder. Life without this would be so dull :P

Some reference:
Google search "windows context menu on folder prompt here"
First good find from that search
The one I use is cmdhere, the great thing about it is it is just a registry hack!
User avatar
Iris
Site Administrator
Posts: 6800
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Post by Iris »

elricz wrote:The one I use is cmdhere, the great thing about it is it is just a registry hack!
XP's powertoys (pub. by Microsoft) had a cmdlinehere applet or something. It was composed of a DLL, besides the registry hack.

It is not very comfortable because you have to use your mouse to get there.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
dagoi-koi
Posts: 15
Joined: October 30th, 2007, 4:55 am

Post by dagoi-koi »

Code: Select all

wesnoth --nogui --multiplayer --scenario=multiplayer_The_Freelands --controller1=ai --side1="Knalgan Alliance" --controller2=ai --side2="Knalgan Alliance" --algorithm2=python_ai --parm2=python_script:bruteforce.py
I tried using the above on Windows XP and it doesn't work. Following is the stderr.txt.

Code: Select all

Battle for Wesnoth v1.2.7
Started on Sat Nov 03 12:22:10 2007

started game: 0
Checking video mode: 1024x746x32...
32
setting mode to 1024x746x32
locale could not be determined; defaulting to system locale
WARNING: setlocale() failed for .
set locale to 
found valid cache at 'C:/Program Files/Wesnoth/userdata/cache/game.cfg-cache-v1.2.7-MEDIUM-MULTIPLAYER-NORMAL' using it
loadscreen: filesystem counter = 125
loadscreen: binarywml counter = 22100
loadscreen: setconfig counter = 221
loadscreen: parser counter = 229
started music
4095
counted sides: 1
counted sides: 2
Could not find side '"Knalgan' for side 2
exiting with code 0
It chokes on the space in Knalgan Alliance. Used 'Undead' in its place and it works fine. Can someone confirm this error?
VS
Translator
Posts: 187
Joined: November 27th, 2005, 10:07 am

Post by VS »

Heh, you put the parameter as

Code: Select all

--side1="Knalgan Alliance"
when parameters are just some stuff on cmdline with no more structure than space-separated list. If you enclose it correctly - the whole parameter - it will work without any problems.

Code: Select all

"-side1=Knalgan Alliance"
Post Reply