Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # User settings (don't use the \ character)
- target_folders = [ "materials", "media", "models", "particles", "resource", "scripts", "sound", "scenes" ]
- file_types = [ "vmt", "vtf", "mdl", "phy", "vtx", "vvd", "pcf", "vcd", "res", "bik", "txt", "nut", "wav", "mp3","dx90.vtx","dx80.vtx","dx90","dx80","ani"]
- vpk_path = "C:/Program Files (x86)/Steam/steamapps/common/Portal 2/bin/vpk.exe"
- vpk_path2 = "D:/SteamLibrary/steamapps/common/Left 4 Dead 2/bin/vpk.exe"
- # Script begins
- import os,subprocess,time
- from datetime import date
- print("Starting Destroyed Aperture VPK generator, please wait...")
- print("Destroyed Aperture VPK generator loaded, VPK files are now being created, hang tight!")
- print("------------------------------------------------------------------------")
- print("------------------------ Welcome aerond! -------------------------------")
- print("-------------- Your VPK files are now being created! -------------------")
- print("---------------------- Special thanks to: ------------------------------")
- print("---------------------- ------------------------------")
- print("----------------------- Anna (Lpfreaky90) ------------------------------")
- print("------------------------------------------------------------------------")
- from os.path import join
- response_path = join(os.getcwd(),"da_packed_files.txt")
- out = open(response_path,'w')
- len_cd = len(os.getcwd()) + 1
- for user_folder in target_folders:
- for root, dirs, files in os.walk(join(os.getcwd(),user_folder)):
- for file in files:
- if len(file_types) and file.rsplit(".")[-1] in file_types:
- out.write(os.path.join(root[len_cd:].replace("/","\\"),file) + "\n")
- #print(os.path.join(copy_folder,file) + "\n")
- out.close()
- print ("TXT file for files that have been packed created!")
- subprocess.call([vpk_path, "-M", "a", "pak01", "@" + response_path])
- subprocess.call([vpk_path2, "-M", "a", "pak01", "@" + response_path])
- input("VPK files were created! Press ENTER to quit!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement