Moving Mod And Source Files

From Valve Developer Community
Jump to: navigation, search
English (en)français (fr)русский (ru)
Edit

The Source 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 Hammer, and in Visual Studio 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.

Visual Studio 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

RMB > 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.

  1. Navigate to Configuration Properties > Build Events > Post-Build Event.
  2. Click on Command Line, then click on the ... button that appears on the right.
  3. Replace the contents of the new dialogue with the first code block below.
  4. Click on Outputs and paste in the second code block below.
Warning.pngWarning:Remember to fill in the actual target destination instead of <YOUR MOD PATH>.
Note.pngNote:The "<YOUR MOD PATH>" is the path of your "..\SteamApps\SourceMods\<Your Mod>" directory, and not the directory of your Visual Studio Project.

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
Warning.pngWarning:It is possible that you have a corrupted bin file instead a bin folder at your Steam mod path. If this occurs, delete it and recompile or create your mod project again.

SDK Tool and Hammer Configurations

For The Orange Box 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 Hammer then needs to be manually setup. (Same for Hammer++ Hammer++)
Run Hammer and open Tools->Options
Follow the Mod information in the directions on the Hammer Manual Configuration page.