Source SDK Guide

How to setup Source SDK Base 2013 Singleplayer Mod for Source SDK

How to setup Source SDK Base 2013 Singleplayer Mod

Overview

I know there are some simmilar tutorials over the internet, however I decided to create own one. I hope you will like it ;3

Downloading Requirements

Installing Source SDK Singleplayer Base 2013

Install Source SDK Base 2013 singleplayer from Steam->Library->Tools or from the link below:

steam://rungameid/243730 //paste this to your internet browser

Downloading Source Code for Source SDK Singleplayer Base 2013

Download the source code from Github[github.com] or download ZIP[github.com].

Installing Visual Studio

If you haven’t installed Visual Studio and Multibyte MFC Library download them from here:

Visual Studio 2013[go.microsoft.com]
Multibyte MFC Library[www.microsoft.com]

Installing Microsoft Speech SDK

Microsoft Speech SDK[www.microsoft.com]

Setting up your Source SDK Base 2013 Singleplayer

Installing Base

Extract your source-sdk-2013-master.zip somewhere on your desktop.
Now open it and take “sp” folder and move it to “C://” location, otherwise there might be problems with compiling,

Now rename it to your mod name, I’ll call it “Half-Life 2 Test Mod”

Implementing Microsoft Speech SDK to your Base

Go to your Microsoft Speech SDK’s installation directory, it should be in C:Program Files (x86)Microsoft Speech SDK 5.1.

Now open your folder on “C://” drive, go to “src/utils/” and create folder “sapi51”.

Now copy all files from Microsoft Speech SDK (Bin, Docs, IDL etc.) to “sapi51” like that:

Fixing some errors in Microsoft Speech SDK

Open your “sapi51” folder, and go to “include” folder. There should be file called “sphelper.h”. Open it with notepad++. Now we will be replacing some lines with fixed ones:

Change Line 769

const ulLenVendorPreferred = wcslen(pszVendorPreferred);

to:

const size_t ulLenVendorPreferred = wcslen(pszVendorPreferred);

Line 1418

static CoMemCopyWFEX(const WAVEFORMATEX * pSrc, WAVEFORMATEX ** ppCoMemWFEX)

to:

static long CoMemCopyWFEX(const WAVEFORMATEX * pSrc, WAVEFORMATEX ** ppCoMemWFEX)

Line 2368

const WCHAR * PropertyStringValue() const const WCHAR * PropertyStringValue() const { // Search for the first NULL and return pointer to the char past it. SPDBG_ASSERT(eEventId == SPEI_PROPERTY_STRING_CHANGE); for (const WCHAR * psz = (const WCHAR *)lParam; *psz; psz++) {} return psz + 1; }

to:

const WCHAR * PropertyStringValue() const { // Search for the first NULL and return pointer to the char past it. SPDBG_ASSERT(eEventId == SPEI_PROPERTY_STRING_CHANGE); const WCHAR * psz = (const WCHAR *)lParam; // moved this from for init for (; *psz; psz++) {} return psz + 1; }

Line 2560

SPPHONEID* pphoneId = dsPhoneId;

to:

SPPHONEID* pphoneId = (SPPHONEID*)((WCHAR *)dsPhoneId); // improper casting

Line 2634

pphoneId += wcslen(pphoneId) + 1;

to:

pphoneId += wcslen((const wchar_t *)pphoneId) + 1; // improper casting

Fixing Source SDK Singleplayer 2013 Base

Go to Library -> Tools and find Source SDK Singleplayer 2013 Base
Now right click on it, proporties, go to beta tab, and select “upcoming”.

Creating your mod.

Setting up folder structure.

Go to “<steam install directory>/steamapps/sourcemods/” and create your mod folder here.

Now to go steam “<steam install directory>/common/Source SDK Base 2013 Singleplayer/hl2” and copy all 4 folders to your mod folder like that:

Creating Missing Folders

Create all this folders in your mod folder:

  • bin
  • cfg
  • maps
  • materials
  • models
  • particles
  • sound

Including missing cfg’s

Download them from here[www.dropbox.com] and put to cfg folder.

Creating Gameinfo.txt

Create new .txt document inside your mod’s folder and call it “Gameinfo.txt”. Open it, paste and modify following code”

“GameInfo” { game “Half-Life 2: Test Mod” //Change This to your mod name title “Half-Life 2: Test Mod” type singleplayer_only developer “Your name here” developer_url “Your website link” manual “Link to manual” FileSystem { SteamAppId 243730 SearchPaths { game+mod+mod_write+default_write_path |gameinfo_path|. gamebin |gameinfo_path|bin //This will port all hl2 content etc. game_lv |all_source_engine_paths|hl2/hl2_lv.vpk game |all_source_engine_paths|hl2/hl2_english.vpk game |all_source_engine_paths|hl2/hl2_pak.vpk game |all_source_engine_paths|hl2/hl2_textures.vpk game |all_source_engine_paths|hl2/hl2_sound_vo_english.vpk game |all_source_engine_paths|hl2/hl2_sound_misc.vpk game |all_source_engine_paths|hl2/hl2_misc.vpk platform |all_source_engine_paths|platform/platform_misc.vpk game |all_source_engine_paths|hl2 platform |all_source_engine_paths|platform } } }

Now restart your steam! :3

Compiling your mod

Setting up compilers

Go to “C://” and open your mod folder, go to “src” and run “createallprojects.bat” and “creategameprojects.bat”.

Open “everything.sln” with visual studio and change “Debug mode” To “Release”. Do the same to “games.sln”.

Compiling your mod

Now right click on solution and select “Build Solution”.

Notes:

If you don’t want to build everything but only game, use “game.sln” instead of “everything.sln”
If you recive some weird errors just compile again.

Importing DLLs to your mod

Go to “C://<yourmodname>/game/mod_hl2/bin” and copy everything inside to “<steam directory>/steamapps/sourcemods/<your mod name>/bin”.

That’s all! Now you can run your mod from your game library. :3

SteamSolo.com