Create a Mod: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (→‎The Setup Sequence: Updated to Source 2006/7 from Ep1/OB)
(updated)
Line 1: Line 1:
{{otherlang2
{{otherlang2
| fr = Create_a_Mod:fr
| fr = Create_a_Mod:fr
| ru = Create_a_Mod:ru}}
| ru = Create_a_Mod:ru
}}


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.
{{toc-right}}


== The Setup Sequence ==
The '''Create a Mod''' wizard automates the process of creating and configuring a new mod. It:
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 "Source 2006" or "Source 2007". It's recommended you work with the Source 2007 engine as it is newer and still backwards compatible with most of the content from the Source 2006 engine.


=== Step 1. The Choice ===
* Creates a new mod under <code>steamapps\SourceMods\</code>
[[Image:sourcesdk1.JPG|thumb|250px|The Source SDK window]]
* Dumps the C++ source code to a location of your choosing
* Registers your mod with the SDK launcher


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.
You will need to restart Steam for a new mod to appear in your library.


[[Image:createamod1.JPG]]
== Engine branch ==


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.
Before starting a mod you need to choose which version of Source you will use. Change the SDK's engine version to the one you want.


=== Step 2. Directories & Mod Name ===
; [[Source 2006]]
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.
: A very outdated version that only exists it the SDK for backwards compatibility reasons. Don't choose it unless you really have to.
; [[Source 2007]]
: Slightly outdated, but the most recent HL2-compatible engine branch that provides source code. This is what most mods use.
; [[Source 2009]]
: The latest HL2-compatible build of Source, but without available source code. The wizard will break if you invoke it for 2009; you ''can'' make a content-only mod of a 2009 game, but you will have to [[#Creating a mod manually|create it manually]].
; [[Alien Swarm (engine branch)|Alien Swarm]] (via [[Alien Swarm SDK]])
: The oddball of the bunch. Alien Swarm is totally free to play and its SDK includes source code, but it's source code for a top-down shooter. It also lacks many of the HL2-compatible code's peripheral tools (including custom [[shader]] support) and cannot access HL2's content.


[[Image:createamod2-2.JPG]]
== The SDK wizard ==


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.   
=== Project type ===


[[Image:createamod3.JPG]]
: {{as}} ''This section does not apply to Alien Swarm.''


[[Image:createamod3-3.JPG]]
When you start the wizard you will have to choose which Visual Studio projects you want it to give you.


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


=== Step 3. Completion ===
; Half-Life 2 Single Player
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!
: Projects for [[Episode One]] (2006) or [[Episode Two|Two]] (2007).
; Half-Life 2 Multiplayer
: [[Half-Life 2: Deathmatch]].
; Multiplayer mod from template
: A specially-created SDK project that demonstrates how Valve implement common multiplayer features. You can configure some extra settings from the wizard.
; Source code only
: Dumps the code without creating an actual mod. This handy if you are only creating a [[server plugin]].


[[Image:createamod4.JPG]]
Whichever option you choose, you get the same source code files. You also get an "everything" solution which includes a collection of development tools.


=== Step 4. "Source Code Only" ===
=== Mod Information ===
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.


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.  
[[File:Create mod step2.png]]


[[Image:createamod3.JPG]]
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).


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. 
== Creating a mod manually ==


[[Image:createamod3-3.JPG]]
It's surprisingly simple:


Once complete, you will be informed of it and be prompted to click 'Next'. Do so now. Return to '''Step 3''' to continue.
# Create a folder under <code>steamapps\SourceMods\</code> ''(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.


== Additional Resources ==
To get the source code (or indeed any other files of Valve's that you want to modify) you will need to use [[GCFScape]] and access <code>sourcesdk.gcf\src_mod\</code>. Remember to change the custom build steps to point to your mod's folder.
To continue on and use the newly installed files, you will find the following resources and pages very useful:
 
* [[Books | Books about modding and mapping]]


[[Category:Modding]]
[[Category:Modding]]

Revision as of 05:03, 17 January 2011

Template:Otherlang2

The Create a Mod wizard automates the process of creating and configuring a new mod. It:

  • Creates a new mod under steamapps\SourceMods\
  • Dumps the C++ source code to a location of your choosing
  • Registers your mod with the SDK launcher

You will need to restart Steam for a new mod to appear in your library.

Engine branch

Before starting a mod you need to choose which version of Source you will use. Change the SDK's engine version to the one you want.

Source 2006
A very outdated version that only exists it the SDK for backwards compatibility reasons. Don't choose it unless you really have to.
Source 2007
Slightly outdated, but the most recent HL2-compatible engine branch that provides source code. This is what most mods use.
Source 2009
The latest HL2-compatible build of Source, but without available source code. The wizard will break if you invoke it for 2009; you can make a content-only mod of a 2009 game, but you will have to create it manually.
Alien Swarm (via Alien Swarm SDK)
The oddball of the bunch. Alien Swarm is totally free to play and its SDK includes source code, but it's source code for a top-down shooter. It also lacks many of the HL2-compatible code's peripheral tools (including custom shader support) and cannot access HL2's content.

The SDK wizard

Project type

Alien Swarm This section does not apply to Alien Swarm.

When you start the wizard you will have to choose which Visual Studio projects you want it to give you.

Create mod step1.png

Half-Life 2 Single Player
Projects for Episode One (2006) or Two (2007).
Half-Life 2 Multiplayer
Half-Life 2: Deathmatch.
Multiplayer mod from template
A specially-created SDK project that demonstrates how Valve implement common multiplayer features. You can configure some extra settings from the wizard.
Source code only
Dumps the code without creating an actual mod. This handy if you are only creating a server plugin.

Whichever option you choose, you get the same source code files. 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).

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) you will need to use GCFScape and access sourcesdk.gcf\src_mod\. Remember to change the custom build steps to point to your mod's folder.