python-sc2 icon indicating copy to clipboard operation
python-sc2 copied to clipboard

Allow passing in sc2_version to all legacy host and launch methods

Open dysonreturns opened this issue 1 year ago • 0 comments

When launching SC2 in latest version, the minimap isn't clickable and buttons are greyed out for most users. This behaviour started happening sometime during 5.0.x. Everyone should be able to opt into launching v4.10.

Sharpy is currently held back, because the old launch methods (bot vs ai, bot vs bot) do not all allow passing in sc2_version.

To demonstrate what this change does, if we were to update the example like bot_vs_bot.py where you play against yourself/custom scripted enemy:


 result: list[Result] = run_game(
        maps.get("AcropolisAIE"),
        [
            Bot(Race.Protoss, WarpGateBot()),
            Bot(Race.Zerg, ZergRushBot()),
        ],
        realtime=False,
        game_time_limit=2,
        save_replay_as="Example.SC2Replay",
        sc2_version="4.10"
    )
    logger.info(f"Result: {result}")

The added sc2_version param will now propagate through the legacy host- and join- commands. This obviously works for single-player (bot vs ai) too.

It is safe and does not interfere with the new launcher (run_multiple_games and GameMatch). Omitting it launches the latest version as per usual.

dysonreturns avatar Jan 17 '25 20:01 dysonreturns