diff --git a/binaries/data/mods/public/autostart/cmd_line_args.js b/binaries/data/mods/public/autostart/cmd_line_args.js index 5c07834500..279c53457f 100644 --- a/binaries/data/mods/public/autostart/cmd_line_args.js +++ b/binaries/data/mods/public/autostart/cmd_line_args.js @@ -5,7 +5,6 @@ * * -autostart="TYPEDIR/MAPNAME" enables autostart and sets MAPNAME; * TYPEDIR is skirmishes, scenarios, or random - * -autostart-biome=BIOME sets BIOME for a random map * -autostart-seed=SEED sets randomization seed value (default 0, use -1 for random) * -autostart-ai=PLAYER:AI sets the AI for PLAYER (e.g. 2:petra) * -autostart-aidiff=PLAYER:DIFF sets the DIFFiculty of PLAYER's AI @@ -48,6 +47,7 @@ * -autostart-players=NUMBER sets NUMBER of players on random map * (default 2) * -autostart-placement=PLACEMENT sets the placement type for a random map + * -autostart-biome=BIOME sets the biome for a random map * * Examples: * 1) "Bob" will host a 2 player game on the Arcadia map: @@ -73,9 +73,7 @@ function parseCmdLineArgs(settings, cmdLineArgs) }[mapType]); // eslint-disable-next-line dot-notation settings.map.selectMap("maps/" + cmdLineArgs['autostart']); - settings.mapSize.setSize(+(cmdLineArgs['autostart-size'] ?? 192)); - settings.biome.setBiome(cmdLineArgs['autostart-biome'] || "random"); - settings.playerPlacement.setValue(cmdLineArgs['autostart-placement']); + if ('autostart-visibility' in cmdLineArgs) { switch (cmdLineArgs['autostart-visibility']) @@ -110,7 +108,17 @@ function parseCmdLineArgs(settings, cmdLineArgs) } } - settings.playerCount.setNb(+(cmdLineArgs['autostart-players'] ?? 2)); + // Handle options specific to random maps + if (mapType === "random") + { + settings.mapSize.setSize(+(cmdLineArgs['autostart-size'] ?? 192)); + settings.biome.setBiome(cmdLineArgs['autostart-biome'] || "random"); + settings.playerPlacement.setValue(cmdLineArgs['autostart-placement']); + + // If not specified, random maps are generated for 2 players + if (cmdLineArgs['autostart-players']) + settings.playerCount.setNb(+cmdLineArgs['autostart-players']); + } const getPlayer = (key, i) => { if (!(('autostart-' + key) in cmdLineArgs)) diff --git a/binaries/system/readme.txt b/binaries/system/readme.txt index 120ba8ba6c..5b8c2d5700 100644 --- a/binaries/system/readme.txt +++ b/binaries/system/readme.txt @@ -8,7 +8,6 @@ Basic gameplay: Autostart: -autostart="TYPEDIR/MAPNAME" enables autostart and sets MAPNAME; TYPEDIR is skirmishes, scenarios, or random --autostart-biome=BIOME sets BIOME for a random map -autostart-seed=SEED sets randomization seed value (default 0, use -1 for random) -autostart-ai=PLAYER:AI sets the AI for PLAYER (e.g. 2:petra) -autostart-aidiff=PLAYER:DIFF sets the DIFFiculty of PLAYER's AI (default 3, 0: sandbox, 5: very hard) @@ -35,6 +34,7 @@ Multiplayer: -autostart-size=TILES sets random map size in TILES (default 192) -autostart-players=NUMBER sets NUMBER of players on random map (default 2) -autostart-placement=PLACEMENT sets the placement type for a random map +-autostart-biome=BIOME sets the biome for a random map Examples: 1) "Bob" will host a 2 player game on the Arcadia map: