Skip to content

Instantly share code, notes, and snippets.

@ColsterJ
Last active August 7, 2018 17:23
Show Gist options
  • Select an option

  • Save ColsterJ/2e2f2f4d8cf8694a02d8e33abbb24a9d to your computer and use it in GitHub Desktop.

Select an option

Save ColsterJ/2e2f2f4d8cf8694a02d8e33abbb24a9d to your computer and use it in GitHub Desktop.
:: Launch Menu for "Master Levels for Doom 2" for GZDoom users
:: Barebones Windows batch script by Colin Jones
::
:: Before using this, consider the nicer alternatives described here:
:: https://www.gog.com/forum/doom_series/doom_2_master_levels_gog_version_in_gzdoom
::
:: -You will need GZDoom installed somewhere (zdoom.org)
:: -You will need Master Levels for Doom 2 and Doom 2 itself from Steam, GOG.com or disc
:: -This .BAT file should be placed wherever the Master Levels' .WAD files are located
:: -Change DOOMPATH and MLPATH to wherever you have GZDoom and MLD2 installed
:: -Change MYSKILL to whichever skill level you prefer; now set to "Hey, Not Too Rough"
::
:: Once your paths are set correctly, just double-click MasterLevels.bat to play a level!
ECHO OFF
SET DOOMPATH=E:\games\GZDoom_2018
SET MLPATH=E:\games\GZDoom_2018\mods\MasterLevelsDoom2
SET MYSKILL=2
SETLOCAL EnableDelayedExpansion
CLS
:MENU
CLS
ECHO.
ECHO ...............................................
ECHO Launcher - Master Levels for Doom II
ECHO PRESS # to select WAD, or Alt+F4 to exit
ECHO ...............................................
ECHO.
:: Make an array of all WADs in the folder
ECHO Z: Random level!
ECHO.
SET count=0
FOR %%f IN (*.wad) DO (
SET /A count+=1
SET "file[!count!]=%%f"
ECHO ON
ECHO !count!: %%f
ECHO OFF
)
:PLAY
ECHO.
SET /P M=Type a number then press ENTER:
::Input validation
IF %M%==Z GOTO RANDOMIZER
IF %M%==z GOTO RANDOMIZER
IF %M% GTR %count% GOTO INVALID
IF %M% LSS 1 GOTO INVALID
:LOADER
::Make sure we load the right level, since some wads replace weird level numbers
SET WARP=1
IF !file[%M%]!==BLACKTWR.WAD SET WARP=25
IF !file[%M%]!==BLOODSEA.WAD SET WARP=7
IF !file[%M%]!==GERYON.WAD SET WARP=8
IF !file[%M%]!==MEPHISTO.WAD SET WARP=7
IF !file[%M%]!==MINOS.WAD SET WARP=5
IF !file[%M%]!==NESSUS.WAD SET WARP=7
::TEETH.WAD has two levels FYI, 31 and 32
IF !file[%M%]!==TEETH.WAD SET WARP=31
IF !file[%M%]!==VESPERAS.WAD SET WARP=9
IF !file[%M%]!==VIRGIL.WAD SET WARP=3
%DOOMPATH%\gzdoom.exe -iwad doom2 -file %MLPATH%\!file[%M%]! -warp %WARP% -skill %MYSKILL%
GOTO FINISHED
GOTO MENU
:RANDOMIZER
SET /A "M=(count*%random%)/32768+1"
GOTO LOADER
:FINISHED
ECHO.
ECHO.
ECHO Move ****!file[%M%]!**** to \Finished???
SET /P N=[Y/N then enter]
IF %N%==Y GOTO MOVEIT
IF %N%==y GOTO MOVEIT
IF %N%==N GOTO MENU
IF %N%==n GOTO MENU
GOTO MENU
:MOVEIT
MKDIR Finished
MOVE !file[%M%]! Finished\!file[%M%]!
GOTO MENU
:INVALID
CLS
ECHO Invalid selection: Please try again...
PAUSE
GOTO MENU
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment