andreaskeller96 / cs2-import-scripts

Modified variant of the CS2 import scripts to run with python3
33 stars 3 forks source link

Failed to load file (invalid)! - pak01.vpk #4

Open creazy231 opened 8 months ago

creazy231 commented 8 months ago

Since latest update the script returns the following error:

c:\program files (x86)\steam\steamapps\common\counter-strike global offensive\csgo\pak01.vpk
Failed to load file (invalid)!
Error running:
>>>source1import -retail -nop4 -nop4sync -usebsp -src1gameinfodir "C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo" -src1contentdir "C:\Users\user\Documents\css_cs2\map" -s2addon "map" -game csgo maps\map.vmf
Aborting
stargazingv3 commented 8 months ago

copy csgo's pak01_dir.vpk and rename that to pak01.vpk per xen from https://discord.gg/eVcS8Gwg. It worked for me.

kubrv commented 8 months ago

work for you @creazy231 For me, copy and paste pak01_dir dont work!

image image

stargazingv3 commented 8 months ago

@kubrv

I was able to recreate your error by still keeping pak01_dir.vpk. If this matches your environment, you need to delete or just rename it to pak01.vpk, not keep both files. I tested this for both this python 3 script and Valve's python 2.7.14 scripts.

kubrv commented 8 months ago

now I have this error. Have an idea?

Error running:
>>>source1import -retail -nop4 -nop4sync -usebsp -src1gameinfodir "C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo" -src1contentdir "C:\mapscsgotocs2" -s2addon "port_test" -game csgo maps\de_inferno.vmf
Aborting

Command sended python import_map_community.py "C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo" "C:\mapscsgotocs2" "C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\game\csgo" port_test de_inferno -usebsp

stargazingv3 commented 8 months ago

now I have this error. Have an idea?

Error running:
>>>source1import -retail -nop4 -nop4sync -usebsp -src1gameinfodir "C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo" -src1contentdir "C:\mapscsgotocs2" -s2addon "port_test" -game csgo maps\de_inferno.vmf
Aborting

Command sended python import_map_community.py "C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo" "C:\mapscsgotocs2" "C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\game\csgo" port_test de_inferno -usebsp

Can you send the lines of output before the Error running line? Those contain the true error message.

kubrv commented 8 months ago

Sorry....

Microsoft Windows [Version 10.0.22631.2861]
(c) Microsoft Corporation. All rights reserved.

C:\cs2-import-scripts-main>python import_map_community.py "C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo" "C:\mapscsgotocs2" "C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\game\csgo" port_test de_inferno -usebsp
C:\cs2-import-scripts-main\import_map_community.py:330: SyntaxWarning: invalid escape sequence '\c'
  s2contentcsgo = s2gameaddon.replace( "game\csgo_addons", "content\csgo_addons" )
C:\cs2-import-scripts-main\import_map_community.py:330: SyntaxWarning: invalid escape sequence '\c'
  s2contentcsgo = s2gameaddon.replace( "game\csgo_addons", "content\csgo_addons" )
WARNING - this script will potentially overwrite imported content in your addon folders?
Enter to Continue, Esc to Quit
--------------------------------
- Running Command: source1import -retail -nop4 -nop4sync -usebsp -src1gameinfodir "C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo" -src1contentdir "C:\mapscsgotocs2" -s2addon "port_test" -game csgo maps\de_inferno.vmf
--------------------------------
'source1import' is not recognized as an internal or external command,
operable program or batch file.
Error running:
>>>source1import -retail -nop4 -nop4sync -usebsp -src1gameinfodir "C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo" -src1contentdir "C:\mapscsgotocs2" -s2addon "port_test" -game csgo maps\de_inferno.vmf
Aborting

C:\cs2-import-scripts-main>
stargazingv3 commented 8 months ago

You need to add C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\game\bin\win64 to your PATH environment, so the scripts can call and run the source1import.exe file within that folder. You will need to reopen your terminal and may need to restart your computer as well for the environment variables to update.

andreaskeller96 commented 8 months ago

No, the script handles the PATH environment variables on its own, so that shouldnt be the issue. Let me see if I can reproduce your issue.

stargazingv3 commented 8 months ago

@kubrv which scripts are you using? I checked and after removing C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\game\bin\win64 from my PATH, can't replicate this error using @andreaskeller96 's scripts. but can using Valve's.

andreaskeller96 commented 8 months ago

Im currently getting stuck at the pak01.vpk error, seems like valve broke the importer in a recent update. Renaming things does not fix it on my end. Maybe reverting to an older version of cs2 can work (like a beta branch in steam).

kubrv commented 8 months ago

We seem to have a problem!

Can @stargazingv3 convert the version of de_inferno from CSGO to CS2 for me? Please! The original map, just from the old engine running on CS2

stargazingv3 commented 8 months ago

Im currently getting stuck at the pak01.vpk error, seems like valve broke the importer in a recent update. Renaming things does not fix it on my end. Maybe reverting to an older version of cs2 can work (like a beta branch in steam).

The pak01_dir.vpk -> pak01.vpk isn't a cs2 issue, it's a csgo issue located in C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo, not \game\csgo. Which directory did you rename the files from?

stargazingv3 commented 8 months ago

We seem to have a problem!

Can @stargazingv3 convert the version of de_inferno from CSGO to CS2 for me? Please! The original map, just from the old engine running on CS2

Depends on what you want it for as there are other maps I'm working on porting, but there are already existing ports of inferno in the workshop like https://steamcommunity.com/sharedfiles/filedetails/?id=3070299727&searchtext=de_inferno.

kubrv commented 8 months ago

We seem to have a problem! Can @stargazingv3 convert the version of de_inferno from CSGO to CS2 for me? Please! The original map, just from the old engine running on CS2

Depends on what you want it for as there are other maps I'm working on porting, but there are already existing ports of inferno in the workshop like https://steamcommunity.com/sharedfiles/filedetails/?id=3070299727&searchtext=de_inferno.

He's broken. Don't let the game load, it crashes.. I reported this at the workshop to the creator. :(

Chenmengangzhi-888 commented 6 months ago

The following error may be solved by renaming the file vpk.signatures in "counter-strike global offensive\game\bin\win64" to something else (like vpk.signature.bak) and trying again. C:\Program Files (x86)\Steam\steamapps\common\counter-strike global offensive\csgo\pak01.vpk Failed to load file (invalid)! Error running:

source1import -retail -nop4 -nop4sync -usebsp -src1gameinfodir "C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo" -src1contentdir "C:\map_content\maps" -s2addon "s2addon_name" -game csgo maps\map_name.vmf

agaertner commented 3 months ago

This should fix the issue if you didn't mess with anything else:

Go to ..\Steam\steamapps\common\Counter-Strike Global Offensive\game\bin\win64 rename the file vpk.signatures to vpk.signatures.bak.

Rerun the import process. It fixed the issues for me.