Author Topic: TQRespec: The respec tool for Titan Quest  (Read 92957 times)

0 Members and 1 Guest are viewing this topic.

Not Yet Rated!

Offline Medea Fleecestealer

  • Administrator
  • Full Member
  • *
  • Posts: 2500
  • Country: ch
  • Karma: +25/-0
  • Gender: Female
    • View Profile
    • Awards
  • Time Zone: +1
Re: TQRespec: The respec tool for Titan Quest
« Reply #30 on: 23 August 2023, 07:59:39 »
Modded characters are supported in TQVault if you select the mod in the configuration window.  This will allow you to reset both masteries so she would be able to choose new ones.  Attribute points would also be reset and she could change her skill points/health/energy as well.  Click on Enable Custom Maps and then choose the mod then also tick the enable character editing.  TQVault will tell you it needs to restart and once it's done that select the character and edit as needed.  Shew would then need to go ingame and make the new selections and distribute her points.

Not Yet Rated!

Offline epinter

  • Member
  • *
  • Topic Author
  • Posts: 46
  • Country: br
  • Karma: +5/-0
  • Gender: Male
    • View Profile
    • Awards
  • Time Zone: -3
Re: TQRespec: The respec tool for Titan Quest
« Reply #31 on: 01 June 2025, 04:01:33 »
Recent updates added features with more options to edit the characters (edit gold, add attributes/skill points, add portals, etc). Now Linux is fully supported. The version 1.0.3 added a feature to extract all game files, a map decompiler, and a TEX converter. For now, the extract and converter are command line tools, a readme can be found at https://github.com/epinter/tqrespec/blob/master/src/main/java/dev/pinter/tqextract/README.md
« Last Edit: 01 June 2025, 04:21:00 by epinter »

Not Yet Rated!

Offline Medea Fleecestealer

  • Administrator
  • Full Member
  • *
  • Posts: 2500
  • Country: ch
  • Karma: +25/-0
  • Gender: Female
    • View Profile
    • Awards
  • Time Zone: +1
Re: TQRespec: The respec tool for Titan Quest
« Reply #32 on: 01 June 2025, 07:44:02 »
Nice epinter.  Thanks for all your work on this and your other projects.  Much appreciated.   :)

Not Yet Rated!

Offline epinter

  • Member
  • *
  • Topic Author
  • Posts: 46
  • Country: br
  • Karma: +5/-0
  • Gender: Male
    • View Profile
    • Awards
  • Time Zone: -3
Re: TQRespec: The respec tool for Titan Quest
« Reply #33 on: 06 June 2025, 17:23:34 »
Nice epinter.  Thanks for all your work on this and your other projects.  Much appreciated.   :)

Thank you  :D
I always learn something when I contribute to the community with this kind of development.

Btw, I released another version, now with mod support.

Not Yet Rated!

Offline Medea Fleecestealer

  • Administrator
  • Full Member
  • *
  • Posts: 2500
  • Country: ch
  • Karma: +25/-0
  • Gender: Female
    • View Profile
    • Awards
  • Time Zone: +1
Re: TQRespec: The respec tool for Titan Quest
« Reply #34 on: 07 June 2025, 09:00:12 »
Oh, so it could be used with mods like Xmax?  What about Legion of Champions and Soulvizier?  Does it work with those type of mods too?

Not Yet Rated!

Offline epinter

  • Member
  • *
  • Topic Author
  • Posts: 46
  • Country: br
  • Karma: +5/-0
  • Gender: Male
    • View Profile
    • Awards
  • Time Zone: -3
Re: TQRespec: The respec tool for Titan Quest
« Reply #35 on: 07 June 2025, 19:00:03 »
Oh, so it could be used with mods like Xmax?  What about Legion of Champions and Soulvizier?  Does it work with those type of mods too?

Yes, it should work with any mod. The game database.arz is always loaded while software is running. When you select a mod, the ARZ from the mod is loaded over the one from the game, so the values considered are from the mod. When any mod selection is done, the current mod is unloaded and the values considered are from the game (or the mod if one is selected), the log contains messages with the modifiers loaded from database. Currently, the values used are the skill points modifier, attributes modifier, attributes increment and the skills. If you have a mod that changes the points per level, the  value from the mod will be used. While developing I used LoC 2024, the skills are listed properly.

Not Yet Rated!

Online nargil66

  • Forum Moderator
  • Full Member
  • *
  • Posts: 2653
  • Country: bg
  • Karma: +70/-1
  • Gender: Male
  • Mesh-Texturing Beautifier :)
    • View Profile
    • Awards
  • Time Zone: ?
Re: TQRespec: The respec tool for Titan Quest
« Reply #36 on: 09 June 2025, 01:07:44 »
Thank you for including mod support, also for the portal unlock feature.
Btw, how to use the tex converter tool? Do I need a command prompt to do it? I'm mostly interested in converting DDS to TEX in a bulk.

Not Yet Rated!

Offline HekTo

  • TQ Titans
  • Hero Member
  • *
  • Posts: 57
  • Country: ua
  • Karma: +4/-0
    • View Profile
    • Awards
  • Time Zone: +3
Re: TQRespec: The respec tool for Titan Quest
« Reply #37 on: 09 June 2025, 16:06:11 »
I'm mostly interested in converting DDS to TEX in a bulk.
Spoiler for Video:
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)).
2. Unzip archive.
Further as in the video:
3. 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=%~dp0texconverter-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
pause
4. Create .bat file (with any name) in folder where texconverter-cli.exe and paste:
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=%~dp0texconverter-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
Now you can convert DDS to TEX and TEX to DDS by drag&dropping the required files and/or folders onto the corresponding .bat file.
At the beginning of each .bat file there is:
Spoiler for Settings:
set "SkipIfAlreadyExist=0"
set "DeleteOriginalAfterConversion=1"

set "ShowSkipped=1"
set "ShowDeleted=1"
And you can change the "settings" at your discretion (changing from 0 to 1 or from 1 to 0).
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.
Notes:
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.
« Last Edit: 09 June 2025, 16:54:02 by HekTo »

Not Yet Rated!

Offline epinter

  • Member
  • *
  • Topic Author
  • Posts: 46
  • Country: br
  • Karma: +5/-0
  • Gender: Male
    • View Profile
    • Awards
  • Time Zone: -3
Re: TQRespec: The respec tool for Titan Quest
« Reply #38 on: 09 June 2025, 16:47:17 »
Thank you for including mod support, also for the portal unlock feature.
Btw, how to use the tex converter tool? Do I need a command prompt to do it? I'm mostly interested in converting DDS to TEX in a bulk.

It is a command line tool, you can use command prompt or powershell to run. The tex converter is simple to use, just run:
texconverter-cli.exe -i x:/tmp/TIGERMAN01.TEX -o x:/tmp/tigerman.dds"

I didn't create a feature to convert a directory with textures. I will try to do something, but for now, you can use a powershell script, like this:
Code: [Select]
Get-ChildItem -Path "x:/tmp/extracted/Resources" -Recurse -Include '*dds' | ForEach-Object {
    $outFile = $_.FullName -replace '\.dds','.tex'
    & "x:/tmp/TQRespec/texconverter-cli.exe" -i $_.FullName -o $outFile
}

You can put this inside a file with extension ".ps1", this code will enter every subdirectory inside "x:/tmp/extracted/Resources" and run convert every .dds found to .tex. If you never use powershell to run scripts, maybe you will need to enable scripts execution.

Thanks for your work, I played LoC 2024 a bit, it's a huge work.  :)
« Last Edit: 09 June 2025, 16:56:56 by epinter »

Not Yet Rated!

Offline epinter

  • Member
  • *
  • Topic Author
  • Posts: 46
  • Country: br
  • Karma: +5/-0
  • Gender: Male
    • View Profile
    • Awards
  • Time Zone: -3
Re: TQRespec: The respec tool for Titan Quest
« Reply #39 on: 09 June 2025, 16:48:05 »
I'm mostly interested in converting DDS to TEX in a bulk.
Spoiler for Video:
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)).
2. Unzip archive.
Further as in the video:
3. 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
pause
4. Create .bat file (with any name) in folder where texconverter-cli.exe and paste:
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
Now you can convert DDS to TEX and TEX to DDS by drag&dropping the required files and/or folders onto the corresponding .bat file.
At the beginning of each .bat file there is:
Spoiler for Settings:
set "SkipIfAlreadyExist=0"
set "DeleteOriginalAfterConversion=1"

set "ShowSkipped=1"
set "ShowDeleted=1"
And you can change the "settings" at your discretion (changing from 0 to 1 or from 1 to 0).
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.
Notes:
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. :)

Not Yet Rated!

Online nargil66

  • Forum Moderator
  • Full Member
  • *
  • Posts: 2653
  • Country: bg
  • Karma: +70/-1
  • Gender: Male
  • Mesh-Texturing Beautifier :)
    • View Profile
    • Awards
  • Time Zone: ?
Re: TQRespec: The respec tool for Titan Quest
« Reply #40 on: 09 June 2025, 18:47:48 »
Perfect, thank you both :D I'll try your method tonight @HekTo !

Tags:
 


SimplePortal 2.3.7 © 2008-2025, SimplePortal