1
Installation and Tools / Re: TQRespec: The respec tool for Titan Quest
« on: 09 June 2025, 16:48:05 »I'm mostly interested in converting DDS to TEX in a bulk.1. Download the latest TQRespec - https://github.com/epinter/tqrespec/tags (At this moment it is https://github.com/epinter/tqrespec/releases/tag/v1.1.0 (TQRespec-1.1.0.zip)).Spoiler for Video:
2. Unzip archive.
Further as in the video:
3. Create .bat file (with any name) in folder where texconverter-cli.exe and paste:4. Create .bat file (with any name) in folder where texconverter-cli.exe and paste:Spoiler for _DDS TO TEX.bat:@echo off
setlocal EnableDelayedExpansion
set "SkipIfAlreadyExist=0"
set "DeleteOriginalAfterConversion=1"
set "ShowSkipped=1"
set "ShowDeleted=1"
REM Check if texconverter-cli.exe is in the folder with the batch file
set "TexConverter=%~dp0%texconverter-cli.exe"
if not exist "%TexConverter%" (
echo "%TexConverter% does not exist!"
goto :EXIT
)
REM Check if the arguments have been passed
if "%~1"=="" (
echo Error: No arguments passed!
goto :EXIT
)
REM Processing each argument
for %%A in (%*) do (
if exist "%%A" (
REM If argument is folder
if exist "%%A\*" (
call :processFolder "%%A"
) else (
REM If argument is file
REM Check if .dds or .DDS extension
set "isDDS_file=0"
if "%%~xA" == ".dds" (
set "isDDS_file=1"
)
if "%%~xA" == ".DDS" (
set "isDDS_file=1"
)
if "!isDDS_file!" == "1" (
REM If TEX file already exist
if exist "%%~dpnA.tex" (
if "%SkipIfAlreadyExist%"=="1" (
if "%ShowSkipped%"=="1" (
echo "%%A" skipped.
)
) else (
REM Delete TEX that already exist
del /F /Q "%%~dpnA.tex"
if "%ShowDeleted%"=="1" (
echo "%%~dpnA.tex" DELETED.
)
REM Convert
"%TexConverter%" -i "%%A" -o "%%~dpnA.tex"
REM If the conversion was completed without errors,
REM and converted file exist (its possible, that texconverter-cli.exe will complete without errors but will not create a converted file),
REM and original file deletion is enabled
if !ERRORLEVEL!==0 if exist "%%~dpnA.tex" if "%DeleteOriginalAfterConversion%"=="1" (
del /F /Q "%%A"
if "%ShowDeleted%"=="1" (
echo "%%A" DELETED.
)
)
)
) else (
REM If TEX file not already exist, then just convert
"%TexConverter%" -i "%%A" -o "%%~dpnA.tex"
REM If the conversion was completed without errors,
REM and converted file exist (its possible, that texconverter-cli.exe will complete without errors but will not create a converted file),
REM and original file deletion is enabled
if !ERRORLEVEL!==0 if exist "%%~dpnA.tex" if "%DeleteOriginalAfterConversion%"=="1" (
del /F /Q "%%A"
if "%ShowDeleted%"=="1" (
echo "%%A" DELETED.
)
)
)
) else (
echo Error: %%A not have .dds extension!
)
)
) else (
echo Error: %%A not exist!
)
)
echo:
echo Done^!
goto :EXIT
:processFolder
REM For all DDS files in folder (with subfolders)
for /r "%1" %%F in (*.dds) do (
REM If TEX file already exist
if exist "%%~dpnF.tex" (
if "%SkipIfAlreadyExist%"=="1" (
if "%ShowSkipped%"=="1" (
echo "%%F" skipped.
)
) else (
REM Delete TEX that already exist
del /F /Q "%%~dpnF.tex"
if "%ShowDeleted%"=="1" (
echo "%%~dpnF.tex" DELETED.
)
REM Convert
"%TexConverter%" -i "%%F" -o "%%~dpnF.tex"
REM If the conversion was completed without errors,
REM and converted file exist (its possible, that texconverter-cli.exe will complete without errors but will not create a converted file),
REM and original file deletion is enabled
if !ERRORLEVEL!==0 if exist "%%~dpnF.tex" if "%DeleteOriginalAfterConversion%"=="1" (
del /F /Q "%%F"
if "%ShowDeleted%"=="1" (
echo "%%F" DELETED.
)
)
)
) else (
REM If TEX file not already exist, then just convert
"%TexConverter%" -i "%%F" -o "%%~dpnF.tex"
REM If the conversion was completed without errors,
REM and converted file exist (its possible, that texconverter-cli.exe will complete without errors but will not create a converted file),
REM and original file deletion is enabled
if !ERRORLEVEL!==0 if exist "%%~dpnF.tex" if "%DeleteOriginalAfterConversion%"=="1" (
del /F /Q "%%F"
if "%ShowDeleted%"=="1" (
echo "%%F" DELETED.
)
)
)
)
exit /b
:EXIT
endlocal
pauseNow you can convert DDS to TEX and TEX to DDS by drag&dropping the required files and/or folders onto the corresponding .bat file.Spoiler for _TEX TO DDS.bat:@echo off
setlocal EnableDelayedExpansion
set "SkipIfAlreadyExist=0"
set "DeleteOriginalAfterConversion=1"
set "ShowSkipped=1"
set "ShowDeleted=1"
REM Check if texconverter-cli.exe is in the folder with the batch file
set "TexConverter=%~dp0%texconverter-cli.exe"
if not exist "%TexConverter%" (
echo "%TexConverter% does not exist!"
goto :EXIT
)
REM Check if the arguments have been passed
if "%~1"=="" (
echo Error: No arguments passed!
goto :EXIT
)
REM Processing each argument
for %%A in (%*) do (
if exist "%%A" (
REM If argument is folder
if exist "%%A\*" (
call :processFolder "%%A"
) else (
REM If argument is file
REM Check if .tex or .TEX extension
set "isTEX_file=0"
if "%%~xA" == ".tex" (
set "isTEX_file=1"
)
if "%%~xA" == ".TEX" (
set "isTEX_file=1"
)
if "!isTEX_file!" == "1" (
REM If DDS file already exist
if exist "%%~dpnA.dds" (
if "%SkipIfAlreadyExist%"=="1" (
if "%ShowSkipped%"=="1" (
echo "%%A" skipped.
)
) else (
REM Delete DDS that already exist
del /F /Q "%%~dpnA.dds"
if "%ShowDeleted%"=="1" (
echo "%%~dpnA.dds" DELETED.
)
REM Convert
"%TexConverter%" -i "%%A" -o "%%~dpnA.dds"
REM If the conversion was completed without errors,
REM and converted file exist (its possible, that texconverter-cli.exe will complete without errors but will not create a converted file),
REM and original file deletion is enabled
if !ERRORLEVEL!==0 if exist "%%~dpnA.dds" if "%DeleteOriginalAfterConversion%"=="1" (
del /F /Q "%%A"
if "%ShowDeleted%"=="1" (
echo "%%A" DELETED.
)
)
)
) else (
REM If DDS file not already exist, then just convert
"%TexConverter%" -i "%%A" -o "%%~dpnA.dds"
REM If the conversion was completed without errors,
REM and converted file exist (its possible, that texconverter-cli.exe will complete without errors but will not create a converted file),
REM and original file deletion is enabled
if !ERRORLEVEL!==0 if exist "%%~dpnA.dds" if "%DeleteOriginalAfterConversion%"=="1" (
del /F /Q "%%A"
if "%ShowDeleted%"=="1" (
echo "%%A" DELETED.
)
)
)
) else (
echo Error: %%A not have .tex extension!
)
)
) else (
echo Error: %%A not exist!
)
)
echo:
echo Done^!
goto :EXIT
:processFolder
REM For all TEX files in folder (with subfolders)
for /r "%1" %%F in (*.tex) do (
REM If DDS file already exist
if exist "%%~dpnF.dds" (
if "%SkipIfAlreadyExist%"=="1" (
if "%ShowSkipped%"=="1" (
echo "%%F" skipped.
)
) else (
REM Delete DDS that already exist
del /F /Q "%%~dpnF.dds"
if "%ShowDeleted%"=="1" (
echo "%%~dpnF.dds" DELETED.
)
REM Convert
"%TexConverter%" -i "%%F" -o "%%~dpnF.dds"
REM If the conversion was completed without errors,
REM and converted file exist (its possible, that texconverter-cli.exe will complete without errors but will not create a converted file),
REM and original file deletion is enabled
if !ERRORLEVEL!==0 if exist "%%~dpnF.dds" if "%DeleteOriginalAfterConversion%"=="1" (
del /F /Q "%%F"
if "%ShowDeleted%"=="1" (
echo "%%F" DELETED.
)
)
)
) else (
REM If DDS file not already exist, then just convert
"%TexConverter%" -i "%%F" -o "%%~dpnF.dds"
REM If the conversion was completed without errors,
REM and converted file exist (its possible, that texconverter-cli.exe will complete without errors but will not create a converted file),
REM and original file deletion is enabled
if !ERRORLEVEL!==0 if exist "%%~dpnF.dds" if "%DeleteOriginalAfterConversion%"=="1" (
del /F /Q "%%F"
if "%ShowDeleted%"=="1" (
echo "%%F" DELETED.
)
)
)
)
exit /b
:EXIT
endlocal
pause
At the beginning of each .bat file there is:And you can change the "settings" at your discretion (changing from 0 to 1 or from 1 to 0).Spoiler for Settings:set "SkipIfAlreadyExist=0"
set "DeleteOriginalAfterConversion=1"
set "ShowSkipped=1"
set "ShowDeleted=1"Notes:Spoiler for Settings description:SkipIfAlreadyExist:
Set to 1: If during conversion (e.g. DDS to TEX) it is found that there is already a corresponding TEX file for such DDS, then simply ignore (skip) such file.
Set to 0: If during conversion (e.g. DDS to TEX) it is found that there is already a corresponding TEX file for such DDS, the TEX file will be first deleted and then converted again.
DeleteOriginalAfterConversion:
Set to 1: When the conversion is successful (only successful) (e.g. DDS to TEX) the original file is deleted (i.e. the DDS file will be deleted and only the converted TEX file will remain).
Set to 0: Never delete the original file after conversion.
ShowSkipped:
Set to 1: Messages will be shown about which files were skipped.
Set to 0: No messages will be shown about which files were skipped.
ShowDeleted:
Set to 1: Messages will be shown about which files were deleted.
Set to 0: No messages will be shown about which files were deleted.
1. You can drag&drop several folders/files onto a .bat file at the same time. And also both files and folders at the same time.
2. If you want to convert a folder, then files from other subfolders of this folder will always be converted.
3. Works correctly only if the file extension is .dds/.tex or .DDS/.TEX (i.e. if the extension is .Tex or .dDs, it will not work).
4. You can create a shortcut for the .bat file(s) and place them anywhere. Drag&drop on such a shortcut will also work.
Thanks @HekTo, a nice drag and drop way to convert.
