Moving Mod And Source Files
The Source SDK sets up a mod that to be worked on the machine that the wizard ran on.
This setup includes creating configuration setups for the SDK Tool, Hammer, and in Visual Studio Visual Studio Solution files.
For any reason you need to move from one to computer to another, it becomes an issue to continue working.
This includes situations of just moving from one machine to the next (such as moving from an academic lab computer to a computer at home) as well as any source control situation.
The goal of this document is to explain each part that needs to move and how to reset the configuration settings to continue working.
Set the Working Directory for Your Source Files
The Create a Mod Wizard will ask you to provide or create a folder location.
This folder is your source directory. The SCR directory contains all of the source code for the mod.
The other folders created are for the raw and conversion files for maps, models, and textures.
These files are the team's work files, and are not given to users whom will play your mod.
This folder can be be moved at will, provided the information below is correct as well.
Set The Game Directory for Your Mod
The folder that is created under ...\Steam\steamapps\SourceMods for your mod is called the Game directory.
The name of this directory is the name that was supplied during the create a mod wizard.
This is the directory that is shared with other users whom will play your mod.
This directory holds other important directories, such as the ones for DLL and MAPS.
VS will copy the finished client and server DLL's to the following directory.
...Steam\steamapps\SourceMods\<GAME_DIR_NAME>\bin
The folder to where map bsp files will be copied to will be the following directory.
...Steam\steamapps\SourceMods\<GAME_DIR_NAME>\maps
Configure File Copying in Visual Studio Solution
> Properties on the Server and Client projects.
You will need to do this for both the Release and the Debug configuration; four times in all.
- Navigate to Configuration Properties > Build Events > Post-Build Event.
- Click on Command Line, then click on the ... button that appears on the right.
- Replace the contents of the new dialogue with the first code block below.
- Click on Outputs and paste in the second code block below.
Command Line
if exist "<YOUR MOD PATH>\bin\$(TargetFileName)" attrib -r "<YOUR MOD PATH>\bin\$(TargetFileName)" copy "$(TargetDir)"$(TargetFileName) "<YOUR MOD PATH>\bin\" if exist "<YOUR MOD PATH>\bin\$(TargetName).pdb" attrib -r "<YOUR MOD PATH>\bin\$(TargetName).pdb" if exist "$(TargetDir)"$(TargetName).pdb copy "$(TargetDir)"$(TargetName).pdb "<YOUR MOD PATH>\bin\"
Outputs
<YOUR MOD PATH>\bin\$(TargetFileName);<YOUR MOD PATH>\bin\$(TargetName).pdb
SDK Tool and Hammer Configurations
- For The Orange Box Mods, You have access to a Edit Game Configurations" in your SDK tool
- In the Window labled "Current Game Configurations", click on the Add button.
- Under Name, Enter in a name that makes sense for your mod.
- Under Directory, Enter the directory for your game directory under the sourcemods folder in steam, or use the Browse button to locate it.
- Hammer then needs to be manually setup. (Same for Hammer++)
- Run Hammer and open Tools->Options
- Follow the Mod information in the directions on the Hammer Manual Configuration page.