This article's documentation is for the "GoldSrc" engine. Click here for more information.
This article's documentation is for anything that uses the Source engine. Click here for more information.

Create a Mod: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
(Moved SDK wizard to the bottom)
 
(67 intermediate revisions by 34 users not shown)
Line 1: Line 1:
{{otherlang2
{{LanguageBar}}
| fr = Create_a_Mod:fr
{{gldsrc topicon}}
| ru = Create_a_Mod:ru}}
{{Source topicon}}
{{TabsBar}}


The 'Create a Mod' button is accessible through the [[Source SDK]] software available through STEAM to all owners of Half-Life 2 or another primary Source engine product.  This button does exactly as the name implies, it allows you to create a modification of the Half-Life 2 game or of the Source engine itself.  This is only a stepping stone application really and the hard work that generally goes into a successful modification is still left up to you.  This button will generate the basic framework for you to work with, allowing you to dabble in the code, the models and the worlds of Half-Life 2 to create your own interesting world.


== The Setup Sequence ==
{{toc-right}}
Before following the steps below you need to select which version of the Source engine you want to work with. The first drop down box in the Source SDK window allows you to do this. Pick either "Episode 1" or "Orange Box". It's recommended you work with the Orange Box engine as it is newer and still backwards compatible with most of the content from the Episode 1 engine.


=== Step 1. The Choice ===
[[Image:sourcesdk1.JPG|thumb|250px|The Source SDK window]]


After double clicking ''Create a Mod'' from within the Source SDK application, you will be presented with four options.  You can either modify [[Half-Life_2|Half-Life 2 Single Player]], [[Half-Life_2_Deathmatch|Half-Life 2 Multiplayer]], Start a mod from scratch or utilize the [[Installing_and_Debugging_the_Source_Code|Source Code]] only.  The screen on which these options are presented looks as follows. 


[[Image:createamod1.JPG]]
== Engine branch ==
Before starting a [[mod]], you need to choose which version (or ''branch'') of Source you will use.
; {{src13|4}}
: '''This branch is recommended for most users.''' This is the newest version of the Source SDK. The code is available on GitHub.
:* To make a singleplayer mod, see: [[Setting up Source SDK 2013 Singleplayer]].
:* To make a multiplayer mod, see: [[Setting_up_Source_SDK_Base_2013_Multiplayer|Setting up Source SDK 2013 Multiplayer]] (specifically uses the {{Team Fortress 2 branch|3}}, which is a slightly incompatible version of Source 2013).


The following steps will depend on which option you select.  If you selected '''Modify Half-Life 2 Single Player''', '''Modify Half-Life 2 Multiplayer''' or '''Start a mod from scratch (advanced users only)''', go to step 2.  If you selected '''Source code only (advanced users only)''', go to step 4.


=== Step 2. Directories & Mod Name ===
=== Legacy branches ===
At this screen you will be prompted to enter the directory you would like to install the mod as well as the mods name. The first box will contain all of the source files that you will use to construct your mod project.  This name can be anything you like, but lets start it simple and enter the title "C:\mymod-source". Into the mod name line enter "My Mod". Click next when you are ready.
{{warning|These are older versions of the Source SDK, which you should avoid using, if at all possible.}}
These branches are set up using an older tool simply called "Source SDK", which is available on Steam. Documentation for using this tool is at the bottom of this page, under ''' The SDK wizard '''.
; {{src06|4}}
: '''Outdated''' - Original {{episodic|4}} mod. Only included for backwards compatibility reasons.
; {{src07|4}}
: '''Outdated''' - Original {{orangebox|4}} mod. Only included for backwards compatibility reasons.
; {{src09|4}}
: '''Outdated''' - Updated [[Orange Box]] mod. You '''cannot make a mod for {{src09|4}}''' due to lack of SDK Base for this branch. However, you ''can'' make a content-only mod of a 2009 game by following [[#Creating a mod manually|Creating a Mod manually]].
; {{asw|4}} (via [[Alien Swarm SDK]])
: The oddball of the bunch. Alien Swarm is totally free to play, also has newer features from {{l4dbranch|1}}, and its SDK includes source code, but it's source code is for a top-down shooter. It also lacks many of the HL2-compatible code's peripheral tools and cannot access HL2's content. This branch is not cross-platform (Mac/Linux) friendly.


[[Image:createamod2-2.JPG]]
{{Note|If you wish to compile on one of the engine branches, use the following Visual Studio version: Source 2006 is Visual Studio 2005, Source 2007 is Visual Studio 2005/2010, Alien Swarm engine branch is Visual Studio 2010 & Source 2013 is Visual Studio 2013.)}}


The Source SDK will now copy the needed Half-Life 2 code, maps, models, and other materials into your own development folder. This may take several minutes to complete so please be patient.  
{{Note|For compiling on Linux: Use GCC 4.2.x (or earlier) compiler for Source 2007 or earlier, GCC 4.6-4.8 or GCC 5.0 (and later) for Source 2013 is Visual Studio 2013. GCC does not support Alien Swarm engine branch.}}


[[Image:createamod3.JPG]]
{{Note|At this time, {{csgo|4|nt=1}} and {{tf2|4|nt=1}} are the only Valve-made Source Engine titles with 64-bit support, and CS:GO is only 64-bit on MacOS and Linux. (By extension, this means that only mods based on CS:GO and TF2 will be able to work on macOS Catalina and later, as these lack 32-bit support.)}}


[[Image:createamod3-3.JPG]]
{{warning|Your ''Engine Version'' in the [[Source SDK]] must match the Engine branch of your mod! Failing to do this will result in Source SDK tools being unable to load required resources.}}
== Creating a mod manually ==
It's surprisingly simple:


Once complete, you will be informed of it and be prompted to click 'Next'. Do so now.
# Create a folder under {{Path|steamapps\SourceMods\}} ''(A mod can actually reside anywhere, but placing it here allows Steam to detect and launch it.)''
# Create a [[gameinfo.txt]] in the folder. You now have a mod!
# Open the SDK launcher and switch to the relevant engine branch.
# Choose "Edit Game Configurations" and click "Add". Enter your mod's name and folder.


=== Step 3.  Completion ===
To get the source code (or indeed any other files of Valve's that you want to modify), visit GitHub's [https://github.com/ValveSoftware/source-sdk-2013 Source SDK 2013] page.
Complete the setup by selecting to '''Open readme file''' and click finish. Your files are now ready to be used for your next great modification: so get modding!


[[Image:createamod4.JPG]]
For earlier versions of Source SDK (2006, 2007), you will need to use [[GCFScape]] and access <code>depot_211_dir.vpk</code> in the <code>Steam\SteamApps\common\SourceSDK\vpks</code> folder. Remember to change the custom build steps to point to your mod's folder.


=== Step 4. "Source Code Only" ===
== Utilities ==
This installation is different from the previous three only in the fact that there is a difference between editing the Source code for an end result of a modification and editing the Source code simply for self-experience and exploration purposes. '''Source code only (advanced users only)''' will not give you the tools needed to compile the code into modification format and this is useful for people making server-modifications for Counter-Strike who wish to have it run alongside another mod, rather than a new mod all together.
[[File:XBLAH's Modding Tool - Create a mod v2.5.0.png.png|thumb|392px|{{xblahmt|4}} - Creating a mod]]
;{{Xblahmt|4}}
:Creating a bare-bones {{src|4}} mod usually requires more than just creating a [[gameinfo.txt]]. Mods based on {{src|4}} games can be created with the {{Xblahmt|4}} using an intuitive interface, that creates all the required files and directories. {{mapbase|4}} mods are also supported. [[XBLAH's_Modding_Tool/Docs/Game/New_Mod|See more]].[[Category:Modding]]


At the first screen you will be prompted to enter the directory you would like to install the source code. The location will contain all of the source code files for whatever use you intend for them. This name can be anything you like, but lets keep it simple and enter the title <code>"C:\myproject-source"</code>. Notice that you are not prompted for a 'SourceMods' modification directory. This is the key difference between this installation and the other three choices.  
== The SDK wizard ==
{{obsolete|type=tool}}
=== Overview ===
The '''Create a Mod''' wizard automates the process of creating a Source mod. It:


[[Image:createamod3.JPG]]
* Creates a new mod under {{Path|steamapps\SourceMods\}}
* Installs a copy of the source code, with associated Visual Studio Project File
* Creates a Game Configuration for your mod in the [[Source SDK]]


The Source SDK will now copy the needed source code into your own development folder. This may take several minutes to complete so please be patient. 
{{Note|You will need to restart Steam for a new mod to appear in your library.}}
=== Project type ===
: {{HL2}} '''This section only applies to Half-Life 2 Mods!'''


[[Image:createamod3-3.JPG]]
When you start the wizard, you will have to choose which project to work with.


Once complete, you will be informed of it and be prompted to click 'Next'. Do so now. Return to '''Step 3''' to continue.
[[File:Create mod step1.png]]


== Additional Resources ==
; Half-Life 2 Single Player
To continue on and use the newly installed files, you will find the following resources and pages very useful:
: Projects for {{hl2ep1}} or {{hl2ep2}}. If you do not own {{hl2ep1}}/{{hl2ep2}} this option will be greyed out.
; Half-Life 2 Multiplayer
: Projects for ''{{hl2dm|1}}''. This option is only available if you own ''{{hl2dm|1}}''; otherwise it will be greyed out.
; Multiplayer mod from template
: A specially-created SDK project that allows you to configure settings such as if your mod is team based, or if you have abilities such as sprinting and prone. This option does '''not''' require ''{{hl2dm|1}}''.
; Source code only
: Dumps the code without creating an actual mod. This option is handy if you are just creating a [[server plugin]].


* [[Books | Books about modding and mapping]]
Whichever option you choose, you get the same actual source code files (even if you didn't own one or another game). You also get an "everything" solution which includes a collection of development tools.


[[Category:Modding]]
=== Mod Information ===
[[File:Create mod step2.png]]
 
The first option on this page is where you want the source code extracted to. The second is the name you want to use, which also defines the output folder for your compiled content (does not appear if you chose source code only).

Latest revision as of 08:36, 6 July 2025

English (en)Español (es)Français (fr)Magyar (hu)Русский (ru)Українська (uk)中文 (zh)Translate (Translate)

edit



Engine branch

Before starting a mod, you need to choose which version (or branch) of Source you will use.

Source 2013 Source 2013
This branch is recommended for most users. This is the newest version of the Source SDK. The code is available on GitHub.


Legacy branches

Warning.pngWarning:These are older versions of the Source SDK, which you should avoid using, if at all possible.

These branches are set up using an older tool simply called "Source SDK", which is available on Steam. Documentation for using this tool is at the bottom of this page, under The SDK wizard .

Source 2006 Source 2006
Outdated - Original Half-Life 2: Episode One Half-Life 2: Episode One mod. Only included for backwards compatibility reasons.
Source 2007 Source 2007
Outdated - Original Orange Box branch Orange Box branch mod. Only included for backwards compatibility reasons.
Source 2009 Source 2009
Outdated - Updated Orange Box mod. You cannot make a mod for Source 2009 Source 2009 due to lack of SDK Base for this branch. However, you can make a content-only mod of a 2009 game by following Creating a Mod manually.
Alien Swarm Alien Swarm (via Alien Swarm SDK)
The oddball of the bunch. Alien Swarm is totally free to play, also has newer features from Left 4 Dead engine branch, and its SDK includes source code, but it's source code is for a top-down shooter. It also lacks many of the HL2-compatible code's peripheral tools and cannot access HL2's content. This branch is not cross-platform (Mac/Linux) friendly.
Note.pngNote:If you wish to compile on one of the engine branches, use the following Visual Studio version: Source 2006 is Visual Studio 2005, Source 2007 is Visual Studio 2005/2010, Alien Swarm engine branch is Visual Studio 2010 & Source 2013 is Visual Studio 2013.)
Note.pngNote:For compiling on Linux: Use GCC 4.2.x (or earlier) compiler for Source 2007 or earlier, GCC 4.6-4.8 or GCC 5.0 (and later) for Source 2013 is Visual Studio 2013. GCC does not support Alien Swarm engine branch.
Note.pngNote:At this time, Counter-Strike: Global Offensive CS:GO and Team Fortress 2 Team Fortress 2 are the only Valve-made Source Engine titles with 64-bit support, and CS:GO is only 64-bit on MacOS and Linux. (By extension, this means that only mods based on CS:GO and TF2 will be able to work on macOS Catalina and later, as these lack 32-bit support.)
Warning.pngWarning:Your Engine Version in the Source SDK must match the Engine branch of your mod! Failing to do this will result in Source SDK tools being unable to load required resources.

Creating a mod manually

It's surprisingly simple:

  1. Create a folder under 🖿steamapps\SourceMods\ (A mod can actually reside anywhere, but placing it here allows Steam to detect and launch it.)
  2. Create a gameinfo.txt in the folder. You now have a mod!
  3. Open the SDK launcher and switch to the relevant engine branch.
  4. Choose "Edit Game Configurations" and click "Add". Enter your mod's name and folder.

To get the source code (or indeed any other files of Valve's that you want to modify), visit GitHub's Source SDK 2013 page.

For earlier versions of Source SDK (2006, 2007), you will need to use GCFScape and access depot_211_dir.vpk in the Steam\SteamApps\common\SourceSDK\vpks folder. Remember to change the custom build steps to point to your mod's folder.

Utilities

XBLAH's Modding Tool XBLAH's Modding Tool - Creating a mod
XBLAH's Modding Tool XBLAH's Modding Tool
Creating a bare-bones Source Source mod usually requires more than just creating a gameinfo.txt. Mods based on Source Source games can be created with the XBLAH's Modding Tool XBLAH's Modding Tool using an intuitive interface, that creates all the required files and directories. Mapbase Mapbase mods are also supported. See more.

The SDK wizard

Obsolete-notext.png
This tool is obsolete. Its use is discouraged. It may only exist/function in older engine branches.

Overview

The Create a Mod wizard automates the process of creating a Source mod. It:

  • Creates a new mod under 🖿steamapps\SourceMods\
  • Installs a copy of the source code, with associated Visual Studio Project File
  • Creates a Game Configuration for your mod in the Source SDK
Note.pngNote:You will need to restart Steam for a new mod to appear in your library.

Project type

Half-Life 2 This section only applies to Half-Life 2 Mods!

When you start the wizard, you will have to choose which project to work with.

Create mod step1.png

Half-Life 2 Single Player
Projects for Half-Life 2: Episode One or Half-Life 2: Episode Two. If you do not own Half-Life 2: Episode One/Half-Life 2: Episode Two this option will be greyed out.
Half-Life 2 Multiplayer
Projects for Half-Life 2: Deathmatch. This option is only available if you own Half-Life 2: Deathmatch; otherwise it will be greyed out.
Multiplayer mod from template
A specially-created SDK project that allows you to configure settings such as if your mod is team based, or if you have abilities such as sprinting and prone. This option does not require Half-Life 2: Deathmatch.
Source code only
Dumps the code without creating an actual mod. This option is handy if you are just creating a server plugin.

Whichever option you choose, you get the same actual source code files (even if you didn't own one or another game). You also get an "everything" solution which includes a collection of development tools.

Mod Information

Create mod step2.png

The first option on this page is where you want the source code extracted to. The second is the name you want to use, which also defines the output folder for your compiled content (does not appear if you chose source code only).