Code: Select all
@echo off
rem Ensure we have at least two parameters
if "%~1"=="" (
echo Error: You need to provide at least two parameters.
echo Usage: moddir [on|off] "Name"
exit /b
)
rem Parameters
set "pram1=%~1"
set "pram2=%~2"
rem Check if the second parameter is enclosed in quotes and strip them if so
set "name=%pram2%"
if "%name:~0,1%"=="\"" if "%name:~-1%"=="\"" (
set "name=%name:~1,-1%" rem Remove surrounding quotes only if they exist
)
rem Adjust sourcefile_cfg based on pram1 (on or off)
if /i "%pram1%"=="on" (
set "sourcefile_cfg=e:\Applications\Games\Doom\_ConfigData\Doom-mouseLook_ON.cfg"
) else if /i "%pram1%"=="off" (
set "sourcefile_cfg=e:\Applications\Games\Doom\_ConfigData\Doom-mouseLook_OFF.cfg"
) else (
echo Error: Invalid first parameter. It must be "on" or "off".
exit /b
)
rem Create target paths
set "sourcefile_ini=e:\Applications\Games\Doom\_ConfigData\_Default\_Default.ini"
set "target_dir=e:\Applications\Games\Doom\_ConfigData\%name%"
set "target_ini_File=e:\Applications\Games\Doom\_ConfigData\%name%\%name%.ini"
set "target_cfg_File=e:\Applications\Games\Doom\_ConfigData\%name%\%name%.cfg"
rem Create directory if it doesn't exist
if not exist "%target_dir%" (
mkdir "%target_dir%"
)
rem Copy and rename the INI file into the specified directory
if exist "%sourcefile_ini%" (
copy "%sourcefile_ini%" "%target_ini_File%"
) else (
echo Source file "%sourcefile_ini%" not found.
exit /b
)
rem Copy and rename the config file into the specified directory
if exist "%sourcefile_cfg%" (
copy "%sourcefile_cfg%" "%target_cfg_File%"
) else (
echo Source file "%sourcefile_cfg%" not found.
exit /b
)
rem Remove read-only attribute if set
attrib -r "%target_ini_File%"
attrib -r "%target_cfg_File%"
rem Replace line 384 (array index 347) in INI file using PowerShell
powershell -Command ^
"$content = Get-Content -Path '%target_ini_File%';" ^
"$content[26] = 'Path=%target_cfg_File%';" ^
"$content | Set-Content -Path '%target_ini_File%'"
echo Script completed successfully.
pause
In the "add engine" section I added the engine, but also set both the data and config dir to "e:\Applications\Games\Doom\_ConfigData\". Then in the Doomrunner "data directories" section, ticked all the 3 boxes. What this dose is make screenshots and save games go into my "_ConfigData" inside a subdir named the same as whatever profile I am running.
So the way this works is that on a raw install I setup a "base settings" ini file I called _Default.ini... this is just my personal keybindings, and the gfx and sound settings I use, it is read only so I do not screw it up. This ini file is copied into the new profile directory. This way doom is always "set up" and ready to go for any new profile, with most of my settings set.
I also run basically two separate CFG files... one has Mouse Look Disabled, and the other Enabled. Both these can not be set in the INI file but must be done with "dmflags 262144' added to the CFG file, or you need to go into options every time and set it in gameplay options.... so I have one cfg file called "Doom-mouseLook_OFF.cfg" and another called "Doom-mouseLook_ON.cfg" (which is just an empty file)
The batfile works like this... : moddir on "Name of Profile". [moddir.bat | pram1 = <on/off> | pram2 = "<name of profile>"]
- It will create a dub directory with the name of pram2 in the directory "_ConfigData" (in camel case and whitespaces)
- It will then copy either the on / off cfg file into the same dir depending on if pram1 is "on" or "off".
- It then copies my "default.ini" file into the dir
- It then renames the copied cfg and ini file to pram2.ext
- It then edits the ini file so that [Doom.AutoExec] path points to the new copied cfg file.
Now I end up with a Doomrunner profile that has its own INI file. Its own cfg file. It's own screenshots and its own saves, completely separated from the rest of my mods and any other profile.
Demo
https://www.youtube.com/watch?v=InK1wyoeQtU
So say I want to play a new megawad... i just type moddir off "Eviternity II"... go into DoomRunner and make a new profile called "Eviternity II", select the ini file from the drop down, add my mods and play, with mouse look off. Any settings or CFG changes I do are not completely localized to this one profile.
The batfile used my own paths, but you can replace them with anything you like... it should be trivial to get it working on any directory structure as long as both the data and config dirs in the engine options, inside doomrunner are set to the same dir.
This is a great idea... I was just playing with "Smooth Doom (MBF21) v6.1"... it is released as a bunch of small modules and patches... so to run the full mod is like 9 mods!Major Cooke wrote: ↑Sat Feb 15, 2025 12:35 pm This probably goes outside the scope of this launcher, and likely may have already been talked about, but in case if it hasn't yet... It'd be nice if we could create "packs" of mods (i.e. if I make a pack called AEons of Death, it'd have AEoD.pk3 and AEoDdat.pk3), with the ability to reposition the packs much like regular mods.
You can save packs and they're simply just .DRP files (Doom Runner Pack) which are simply text files that have the directory of each file/folder/custom command line inside. This would allow for loading/saving pack files into presets for quick and easy positioning of files to load.