Batch to Create a mtp.cfg of All the Maps You Have.

Apr 18, 2019
5
4
The mtp.cfg file is what is used to enable pyrovision for maps. This batch file uses cmd and PowerShell commands to create a new mtp.cfg file in yer "tf/cfg" folder that will enable pyrovision for all the maps you currently have downloaded.

Create a new .bat file in yer "steamapps/common/Team Fortress 2" folder and then copy and paste the following into it then save and close it.

dir *.bsp /s /a-d > "pyrovision_temp.txt"
powershell -command "(Get-Content pyrovision_temp.txt) -replace ',', '' | Out-File -encoding ASCII pyrovision_temp.txt"
powershell (Get-Content pyrovision_temp.txt) -replace '(.*[PA]M.*[0-9]* )', ' """' | Out-File -encoding ASCII pyrovision_temp.txt
findstr /b .*.bsp "pyrovision_temp.txt" >> "pyrovision_temp2.txt"
del /s /q pyrovision_temp.txt
powershell (Get-Content pyrovision_temp2.txt) -replace '.bsp', '.bsp""" """1"""' | Out-File -encoding ASCII pyrovision_temp2.txt
type nul > "tf/cfg/mtp.cfg"
echo "VisionFilterShadersMapWhitelist" > "tf/cfg/mtp.cfg"
echo { >> "tf/cfg/mtp.cfg"
type pyrovision_temp2.txt >> "tf/cfg/mtp.cfg"
echo }>> "tf/cfg/mtp.cfg"
del /s /q pyrovision_temp2.txt
Then just run the .bat and wait for it to finish.
 
Last edited:

The Noble Idiot

L1: Registered
May 10, 2024
1
0
For anyone looking to use this, it doesn't work in its current state. The current (as of writing) version only ends up creating a corrupted text file. I still have an older version that catalogs all of the maps you have downloaded but doesn't include the .bsp suffix for the map names, so you'll have to manually add it unless you know how to code.

dir *.bsp /s /a-d > "pyrovision_temp.txt"

powershell -command "(Get-Content pyrovision_temp.txt) -replace ',', '' | Out-File -encoding ASCII pyrovision_temp.txt"

powershell (Get-Content pyrovision_temp.txt) -replace '(.[PA]M.[0-9]* )', ' """' | Out-File -encoding ASCII pyrovision_temp.txt

findstr /b .*.bsp "pyrovision_temp.txt" >> "pyrovision_temp2.txt"

del /s /q pyrovision_temp.txt

powershell (Get-Content pyrovision_temp2.txt) -replace '.bsp', '""" """1"""' | Out-File -encoding ASCII pyrovision_temp2.txt

type nul > "tf/cfg/mtp.cfg"
echo "VisionFilterShadersMapWhitelist" > "tf/cfg/mtp.cfg"
echo { >> "tf/cfg/mtp.cfg"

type pyrovision_temp2.txt >> "tf/cfg/mtp.cfg"
echo }>> "tf/cfg/mtp.cfg"

del /s /q pyrovision_temp2.txt