Advertisement
Guest User

vpk.py

a guest
Jan 16th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. # User settings (don't use the \ character)
  2. target_folders = [ "materials", "media", "models", "particles", "resource", "scripts", "sound", "scenes" ]
  3. file_types = [ "vmt", "vtf", "mdl", "phy", "vtx", "vvd", "pcf", "vcd", "res", "bik", "txt", "nut", "wav", "mp3","dx90.vtx","dx80.vtx","dx90","dx80","ani"]
  4. vpk_path = "C:/Program Files (x86)/Steam/steamapps/common/Portal 2/bin/vpk.exe"
  5. vpk_path2 = "D:/SteamLibrary/steamapps/common/Left 4 Dead 2/bin/vpk.exe"
  6.  
  7.  
  8. # Script begins
  9. import os,subprocess,time
  10. from datetime import date
  11.  
  12.  
  13. print("Starting Destroyed Aperture VPK generator, please wait...")
  14. print("Destroyed Aperture VPK generator loaded, VPK files are now being created, hang tight!")
  15. print("------------------------------------------------------------------------")
  16. print("------------------------ Welcome aerond! -------------------------------")
  17. print("-------------- Your VPK files are now being created! -------------------")
  18. print("---------------------- Special thanks to: ------------------------------")
  19. print("---------------------- ------------------------------")
  20. print("----------------------- Anna (Lpfreaky90) ------------------------------")
  21. print("------------------------------------------------------------------------")
  22.  
  23. from os.path import join
  24. response_path = join(os.getcwd(),"da_packed_files.txt")
  25.  
  26. out = open(response_path,'w')
  27. len_cd = len(os.getcwd()) + 1
  28.  
  29. for user_folder in target_folders:
  30. for root, dirs, files in os.walk(join(os.getcwd(),user_folder)):
  31. for file in files:
  32. if len(file_types) and file.rsplit(".")[-1] in file_types:
  33. out.write(os.path.join(root[len_cd:].replace("/","\\"),file) + "\n")
  34. #print(os.path.join(copy_folder,file) + "\n")
  35.  
  36. out.close()
  37.  
  38. print ("TXT file for files that have been packed created!")
  39.  
  40. subprocess.call([vpk_path, "-M", "a", "pak01", "@" + response_path])
  41. subprocess.call([vpk_path2, "-M", "a", "pak01", "@" + response_path])
  42. input("VPK files were created! Press ENTER to quit!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement