Start map directly via command line argument
~~Warsmash could load a map via --map=<name of built-in map>~~ or --map=<file path .w3x> or even as first command line argument if it’s a path to a w3x file. -loadfile is a thing, though it can only open files in the map directory and doesn’t seem to accept full paths. For built-in maps it could allow a shorter notation like Riverrun for (9)Riverrun.w3m or TwilightRuins/TFT/TwilightRuins for FrozenThrone/(8)TwilightRuins.w3x. Trying all folders, trying all possible map extensions and checking all possible '(number)` prefixes. If you find multiple, you can print their names and say that it’s ambiguous
For the built-in ones it would probably be handy to also have --list-maps or maybe even a --list-unscripted-maps, --list-supported-maps or something like to find working maps quicker. If you allow short notations, you could list both long and short name.
It could have more options to also select race etc and directly start playing the map. Or even support options that don’t work in UI (yet). Something like 0ad’s -autostart-<setting>= options maybe.
Fundamentally that could enable to start maps via double click in the long run.
Example for such arguments: https://docs.megaglest.org/index.php?title=MG/Command_line_options, https://manpages.debian.org/buster/0ad/0ad.6.en.html and https://springrts.com/wiki/Help:CommandLineArgs
Before mostly migrating to Linux, when I was playing Warsmash on a Windows computer I was able to use someone's disassembled version of World Editor that would launch the currently edited map on Warsmash using -loadfile in a manner that would almost exactly parrot how Warcraft 3 game works.
Is it possible that when you tried to use the loadfile argument with a full path, that your path was not enclosed in quotation marks and that it contained spaces which then resolved into independent command line arguments, causing the map not to be found?
It could have more options to also select race etc and directly start playing the map. Or even support options that don’t work in UI (yet). Something like 0ad’s -autostart-
= options maybe.
Perhaps in keeping with the style of Warsmash thus far, someone could have a look at if or how the World Editor already does this and use the same format of launch parameters if possible. At least for Replays, it was possible to launch them with a bunch of advanced settings from a UI similar to what you're saying.
that it contained spaces which then resolved into independent command line arguments, causing the map not to be found?
Sorry, I was dumb and tried to launch a map that doesn’t work.
warsmash -ini ~/Games/warsmash/warsmash.ini -loadfile ~/downloads/Simple\ Tower\ Defense\ V3.w3x -window
Works.
Oh nice, that even works with folders. (did smpq -x ~/downloads/Simple\ Tower\ Defense\ V3.w3x)