AspectUnk / s2-swapping

Swapping files loaded by Source 2
Apache License 2.0
17 stars 1 forks source link

CS2 crashes after swapping files #1

Closed krazzarkov closed 7 months ago

krazzarkov commented 8 months ago

Hey @AspectUnk, thanks for building this tool! I am currently trying to use it to modify the inspect.vts_c file that CS2 uses for the Panaroma UI. My goal is to modify the Panaroma UI so that inspecting weapons prevents automatic rotation.

Unfortunately, after swapping the file, my CS2 instantly crashes and forces validation of all game files on Steam.

I looked through the crash logs in the generated .mdmp file and it seems that CS2 marks my modified inspect.vts_c file as corrupt which is what causes the game to crash and force revalidation of files.

.mdmp output:

300(3.743025):  ***** Parsing error on panorama\layout\mainmenu.xml:  Failed to add include for file: s2r://panorama/scripts/inspect.vts_c
299(3.742779):  Sending Steam API content notification
298(3.412228):  Calling Steam to write a minidump for the assert
297(3.409683):  C:\buildworker\csgo_rel_win64\build\src\filesystem\basefilesystem.cpp (7048) : Assertion Failed in function CBaseFileSystem::MarkContentCorrupt():
false
Content being marked corrupt.  bMissingFilesOnly = false, pFile specified as 'NULL', reason: 'Error loading resource "panorama/scripts/inspect.vts" (Invalid header version: 48575 != 12)
'
296(3.409589):  WARNING: Local content might be corrupt or missing files
295(3.409584):  Error loading resource "panorama/scripts/inspect.vts" (Invalid header version: 48575 != 12)
294(3.361731):  **** Panel EmbeddedHudWeaponSelection has fill-parent-flow for height, but isn't in a flowing down or up layout

cs2_swapping console output:

waiting filesystem_stdio.dll module... loaded.
Fontconfig warning: line 86: saw string, expected number
Fontconfig warning: "C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\game\csgo\panorama\fonts\../../../core/panorama/fonts/conf.d/41-repl-os-win.conf", line 148: Having multiple values in <test> isn't supported and may not work as expected
Fontconfig warning: "C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\game\csgo\panorama\fonts\../../../core/panorama/fonts/conf.d/41-repl-os-win.conf", line 160: Having multiple values in <test> isn't supported and may not work as expected
file panorama/scripts/inspect.vts_c
└─ swapped to panorama/scripts/inspect.vts_c

I used Source 2 Viewer to export the inspect.vts_c file from game/csgo/pak01_dir.vpk/panorama/scripts/inspect.vts_c. I then made some small changes the rotate limit of the _InitGlovesScene function and saved it.

After that I created a \game\bin\win64\swapping\panorama\scripts folder and added the modified inspect file.

I am using Xenos Injector 64 bit, using manual launch for the process cs2.exe with the cs2_swapping.dll file as the image. I am also running the game with -insecure enabled.

Any help or guidance would be greatly appreciated. Apologies if I missed an obvious step or did something stupid, I am very new to injecting DLLs into games.

AspectUnk commented 8 months ago

Hello! When you export a file, it is decompiled. After any changes, you need to compile it again (simply renaming it with the postfix “_c” is not enough). There are no tools for this in CS2, but you can use the Half Life Alyx tools for this

tsxlts commented 3 months ago

@krazzarkov ,Hello, I need to remove the text from the weapon inspection page. How should I modify the file.

tsxlts commented 3 months ago

Can you tell me specifically how to compile the vts_c file @AspectUnk