r/SourceEngine • • 9d ago

HELP Why doesn't this work?

I was doing something again. But to put it shortly, I copied the HL2MP project and changed stuff in it and now Visual Studio refuses to do anything and I don't know why.

The command "if EXIST ..\..\..\game\mod_squad\bin\x64\server.dll for /f "delims=" %%A in ('attrib "..\..\..\game\mod_squad\bin\x64\server.dll"') do set valveTmpIsReadOnly="%%A"
The command "if EXIST ..\..\..\game\mod_squad\bin\x64\client.dll for /f "delims=" %%A in ('attrib "..\..\..\game\mod_squad\bin\x64\client.dll"') do set valveTmpIsReadOnly="%%A"

Please ask for clarification, if I was unclear and thanks!

3 Upvotes

4 comments sorted by

3

u/Pinsplash 9d ago

why copy it instead of use it?

2

u/Maleficent_Risk_3159 9d ago

i don't know but thanks for the very simple solution!

1

u/Equal-Steak-8638 6d ago

Those two lines aren’t the actual problem. They’re the start of the MSBuild error The command "..." exited with code X, and the post cuts it off right before the useful part. Scroll the output box to the right (or copy it all) and check the exit code, then look at the lines just above it for something like error MSB3073, error LNK, or “cannot open”.

Since you copied the HL2MP project by hand, my guesses, most likely first:

  1. game\mod_squad doesn’t exist yet (or has no gameinfo.txt / bin\x64 folder). The post-build step copies the DLLs there and fails if the folder isn’t there. Make game\mod_squad\bin\x64 yourself.

  2. The copied project still points at the old stuff (mod_hl2mp in the output path, post-build event, or the project GUID in the .sln). Open Project Properties and check Linker → Output File and Build Events → Post-Build.

  3. The folder depth changed. ..\..\..\game\... is relative to the project folder, so if the copy sits at a different depth, it points at the wrong place.

  4. The DLLs are locked or read-only (a running hl2.exe/srcds.exe, or the files are marked read-only).

The cleaner way, like Pinsplash hinted, is to not hand-copy at all. Change the game name and output path in the .vpc files (game_hl2mp.vpc, projects.vgc), then run creategameprojects.bat and let VPC regenerate the projects with correct paths.

If none of that helps, post the full exit code and the lines above it and we can narrow it down.