User Tools

Site Tools


arma3:batch-file-examples

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
arma3:batch-file-examples [2017-01-17 09:41]
snakeman created batch-file-example initial page.
arma3:batch-file-examples [2019-01-26 14:00] (current)
snakeman added resize paa command line header.
Line 6: Line 6:
 ====== PMC MoveObject Setup ====== ====== PMC MoveObject Setup ======
  
-Here we show you how to change paths into model P3D, material RVMAT and terrain ​PEW / WRP files using Mikero Tools MoveObject.+Here we show you how to change paths into model P3D, material RVMAT and terrain WRP files using [[arma3:​tools:​mikero-tools|Mikero Tools]] MoveObject.
  
 Main concept is these files. Main concept is these files.
Line 16: Line 16:
 _MASTER_paths.txt contains the moveobject replacement "​source destination"​ list (refer to moveobject documentation for proper format etc). _MASTER_paths.txt contains the moveobject replacement "​source destination"​ list (refer to moveobject documentation for proper format etc).
  
-_run_update_FILETYPE_list.bat is to update file type list, this basically depends on which directory you are, if you're doing models then you use P3D bat, if you do rvmat'​s in Data\ directory, then you use rvmat bat and you guessed it, if you do terrains then you use PEW / WRP bat.+_run_update_FILETYPE_list.bat is to update file type list, this basically depends on which directory you are, if you're doing models then you use P3D bat, if you do rvmat'​s in Data\ directory, then you use rvmat bat and you guessed it, if you do terrains then you use WRP bat.
  
-_run_moveobject_log.bat file creates text file log out of the p3d/rvmat/pew/wrp file content regarding textures, proxys etc. This log file is useful to track down what your file contains. Also note that often times it grows very large, so use [[:​editing_tools#​text_editing|proper text editor]] to open it and be very careful if you perform some search & replace etc operations to log file sized in 50+ megabytes.+_run_moveobject_log.bat file creates text file log out of the p3d/​rvmat/​wrp file content regarding textures, proxys etc. This log file is useful to track down what your file contains. Also note that often times it grows very large, so use [[:​editing_tools#​text_editing|proper text editor]] to open it and be very careful if you perform some search & replace etc operations to log file sized in 50+ megabytes.
  
 _run_moveobject.bat is the actual moveobject executing bat which runs the program using master paths text as config and after its done it runs log file creation. _run_moveobject.bat is the actual moveobject executing bat which runs the program using master paths text as config and after its done it runs log file creation.
Line 36: Line 36:
 @echo off @echo off
 for /F %%i in (_p3d_list.txt) do ( for /F %%i in (_p3d_list.txt) do (
-\tools\mikero\moveobject %%i _MASTER_paths.txt >>​_log.txt+moveobject %%i _MASTER_paths.txt >>​_log.txt
 ) )
 if exist *.old.p3d del *.old.p3d if exist *.old.p3d del *.old.p3d
Line 48: Line 48:
 @echo off @echo off
 del _log.txt del _log.txt
-for /F %%i in (_p3d_list.txt) do (\tools\mikero\moveobject -L "​%%i"​ >>​_log.txt)+for /F %%i in (_p3d_list.txt) do (moveobject -L "​%%i"​ >>​_log.txt)
 </​code>​ </​code>​
  
Line 57: Line 57:
  
 ===== RVMAT Files ===== ===== RVMAT Files =====
 +
 +2019-01-22 Updated for ArmA 3 and Mikeros latest tools with the -P "no pause" option.
  
 **_run_moveobject.bat** **_run_moveobject.bat**
Line 62: Line 64:
 @echo off @echo off
 for /F %%i in (_rvmat_list.txt) do ( for /F %%i in (_rvmat_list.txt) do (
-\tools\mikero\moveobject %%i _MASTER_paths.txt >>​_log.txt+moveobject ​-P %%i _MASTER_paths.txt >>​_log.txt
 ) )
-call _run_moveobject_log.bat 
 if exist *.old.rvmat del *.old.rvmat if exist *.old.rvmat del *.old.rvmat
 pause pause
Line 72: Line 73:
 **_run_moveobject_log.bat** **_run_moveobject_log.bat**
 <code dos> <code dos>
-@echo off +if exist _log.txt ​del _log.txt 
-del _log.txt +for /F %%i in (_rvmat_list.txt) do (moveobject ​-P -L "​%%i"​ >>​_log.txt)
-for /F %%i in (_rvmat_list.txt) do (\tools\mikero\moveobject -L "​%%i"​ >>​_log.txt)+
 </​code>​ </​code>​
  
Line 83: Line 83:
  
  
-===== PEW / WRP Files =====+===== WRP Files ===== 
 + 
 +2019-01-22 Updated for ArmA 3 and Mikeros latest tools with the -P "no pause" option.
  
 **_run_moveobject.bat** **_run_moveobject.bat**
 <code dos> <code dos>
 @echo off @echo off
-for /F %%i in (_pew_list.txt) do ( +for /F %%i in (_wrp_list.txt) do ( 
-\tools\mikero\moveobject %%i _MASTER_paths.txt >>​_log.txt+moveobject ​-P %%i _MASTER_paths.txt >>​_log.txt
 ) )
-if exist *.old.pew del *.old.pew+if exist *.old.wrp del *.old.wrp
 call _run_moveobject_log.bat call _run_moveobject_log.bat
 pause pause
Line 100: Line 102:
 <code dos> <code dos>
 if exist _log.txt del _log.txt if exist _log.txt del _log.txt
-for /F %%i in (_pew_list.txt) do (\tools\mikero\moveobject -L "​%%i"​ >>​_log.txt)+for /F %%i in (_wrp_list.txt) do (moveobject ​-P -L "​%%i"​ >>​_log.txt)
 </​code>​ </​code>​
  
-**_run_update_pew_list.bat**+**_run_update_wrp_list.bat**
 <code dos> <code dos>
-dir *.pew /o /b >_pew_list.txt+dir *.wrp /o /b >_wrp_list.txt
 </​code>​ </​code>​
- 
-Hopefully you already know how to switch from PEW to WRP file use. 
  
  
Line 165: Line 165:
 ====== ExtractPbo Addons Dir ====== ====== ExtractPbo Addons Dir ======
  
-**ExtractPbo whole arma2 expansion ​addon dir:**+**ExtractPbo whole arma2 expansion ​to p:\**
 <code dos> <code dos>
-for %%x in (\arma2\expansion\addons\*.pbo) do ( +extractpbo c:​\arma2\expansion\addons\ p:\ 
-\tools\mikero\extractpbo ​-F *.p3d %%x .+</​code>​ 
 + 
 +**ExtractPbo whole arma2 expansion configs only to p:\** 
 +<code dos> 
 +extractpbo -F config.bin c:​\arma2\expansion\addons\ p:\ 
 +</​code>​ 
 + 
 +**Old style with for loop:** 
 +<code dos> 
 +for %%x in (c:\arma2\expansion\addons\*.pbo) do ( 
 +extractpbo %%x p:\
 ) )
 </​code>​ </​code>​
Line 179: Line 189:
 @echo off @echo off
 md tmp md tmp
-for %%x in (*.bisurf) do (\tools\mikero\derapify %%x tmp\%%x)+for %%x in (*.bisurf) do (derapify %%x tmp\%%x)
 move tmp\*.bisurf . move tmp\*.bisurf .
-for %%x in (*.rvmat) do (\tools\mikero\derapify %%x tmp\%%x)+for %%x in (*.rvmat) do (derapify %%x tmp\%%x)
 move tmp\*.rvmat . move tmp\*.rvmat .
 rd tmp rd tmp
Line 209: Line 219:
  if ERRORLEVEL 1 goto err  if ERRORLEVEL 1 goto err
 ) )
 +rem move stuff to current dir and clean out temp dir.
 +move temp\*.tga .
 +rd temp
 pause pause
 </​code>​ </​code>​
Line 220: Line 233:
  echo %%A  echo %%A
  ​pal2pace.exe "​%%A"​ "​%%A.tga"​  ​pal2pace.exe "​%%A"​ "​%%A.tga"​
 +</​code>​
 +
 +
 +====== PAA to TGA if tga doesnt exist ======
 +
 +This batch file converts all PAA textures into TGA format using pal2pace.exe if TGA file doesn'​t already exist in the directory. Remember to change the pal2pace path to one you are using.
 +
 +<code dos>
 +@echo off
 +dir /b *.paa >>​_paa_list.txt
 +MD temp
 +FOR /F "​tokens=1* delims=. " %%A in (_paa_list.txt) do (
 +if not exist %%A.tga "​C:​\program files (x86)\steamapps\common\Arma 3 Tools\TexView2\Pal2PacE"​ %%A.paa temp\%%A.tga
 +if ERRORLEVEL 1 goto MyError
 +)
 +rem del *.paa
 +del _paa_list.txt
 +move temp\*.tga .
 +rd temp
 +pause
 +exit
 +
 +:MyError
 +echo unknown error
 +pause
 +exit
 </​code>​ </​code>​
  
Line 264: Line 303:
 for /f "​tokens=2-4 delims=/ " %%a in ('date /T') do set day=%%b for /f "​tokens=2-4 delims=/ " %%a in ('date /T') do set day=%%b
 echo %year%-%month%-%day% echo %year%-%month%-%day%
 +</​code>​
 +
 +
 +====== Resize PAA Command Line ======
 +
 +Resize PAA file from command line.
 +
 +This does all PAA files to 128 x 128 resolution in the current directory:
 +<code dos>
 +for /R %CD% %%i in (*.paa) do (
 +echo %%i
 +"<​steam>​\steamapps\common\Arma 3 Tools\ImageToPAA\imagetopaa.exe"​ -size=128 %%i %%i
 +)
 +pause
 +exit
 </​code>​ </​code>​
arma3/batch-file-examples.1484646107.txt.gz · Last modified: 2017-01-17 09:41 by snakeman