Difference between revisions of "Making Your Portal Mod"

From Valve Developer Community
Jump to: navigation, search
 
m (Create a Map List: about the confirm: yes, that is accurate.)
 
(40 intermediate revisions by 15 users not shown)
Line 1: Line 1:
'''Here you will learn how to set up your own Portal modification.'''
+
{{otherlang2
 +
|ru=Making Your Portal Mod:ru
 +
}}
  
== Getting started ==
+
This article will discuss how to create a ''Portal'' content mod, from scratch. Part
 +
of the reason for creating the mod from scratch is that Valve does not provide a
 +
specific SDK or mod template for Portal. Another reason is that creating the mod
 +
from scratch is not difficult and is of general interest to Source SDK
 +
developers that would like to learn more about how everything works. So, let's
 +
get started.
  
First, to start, get GCF Scape.
+
{{note|Portal modification is different from some of the other Source-based games in that the source code to build the <code>client.dll</code> and <code>server.dll</code> files is not provided by Valve. However, a modder can still modify anything that isn't built directly into the game, which includes scenes, scripts, sounds, textures, and models, to name a few.}}
Download here: http://nemesis.thewavelength.net/index.php?p=26
 
  
== Creating Necessary Folders ==
+
==Prerequisites==
 +
To follow along with this article, you will need a copy of Portal and the Source
 +
SDK, installed on Steam.
  
In windows, navigate to Steam\SteamApps\Sourcemods\ and create a folder for your mod. for this tutorial i'm going to use the name "MyPortalMod", but you will of course call it whatever you want.''' Note, this name isn't the name of the mod that appears in the Steam games list, this is just the mods directory folder name.
+
==Creating the Mod==
'''
+
Creating the mod consists of creating a game folder and filling it with
Inside your new mod folder, create the following folders named:
+
configuration files and mod-related content. Let's assume we are creating a mod
'''Required folders:'''
+
named "My Portal Mod", and that <code>[Steam Root]</code> is Steam's
 +
installed path on your machine. (e.g. <code>C:\Program Files (x86)\Steam</code>)
 +
===Create the Game Folder===
 +
Navigate to your <code>SourceMods</code> directory and create a folder named
 +
"MyPortalMod".
  
    * cfg
+
In this new directory, create a file called <code>GameInfo.txt</code>.
    * resource
 
    * maps
 
  
'''optional folders'''
+
Edit the contents of <code>GameInfo.txt</code> so that they look similar to the
 +
following snippet. For details about the structure of this file, see
 +
[[Gameinfo.txt]]. {{note| This page has been edited after the SteamPipe update}}
  
    * materials -- This is if you want to add custom materials to your mod
+
<source>
    * models -- This is if you want to add custom models to your mod
 
    * sounds -- This is if you want to add custom sounds to your mod
 
    * scripts -- This is if you want to add custom scripts to your mod (also required for custom scenes)
 
    * scenes -- This is if you want to add custom scenes to your mod (if so, you will need the '''scripts''' folder)
 
 
 
 
 
== Extract Necessary Files ==
 
 
 
Navigate to Steam\SteamApps\ and open '''portal content.gcf''' with GCFScape. in GCFScape, expand the "portal" folder. now we need to extract some files. The easy way to do this is to drag and drop, so navigate back to Steam\SteamApps\SourceMods\MyPortalMod.
 
 
 
From the '''portal content.gcf''' folder:
 
 
 
Extract "GameInfo.txt" and "maplist.txt" into your mod folder.
 
 
 
While still in the '''portal content.gcf''' go into the "cfg" folder and extract '''chapter1.cfg''' into your mods '''cfg''' folder.
 
 
 
While still in the '''portal content.gcf''' go into the '''resource''' folder and extract '''portal_english.txt''' into your mods '''resource''' folder.
 
you can close GCFScape now.
 
 
 
 
 
== Edit files ==
 
 
 
Note: some of these files are in formats that windows doesn't recognize at first, but all of them can be safely opened and edited with notepad.
 
 
 
In your main mod folder, open GameInfo.txt. it will look like this:
 
Code:
 
 
"GameInfo"
 
"GameInfo"
 
{
 
{
  game     "Portal"
+
game "My Portal Mod"
  title       "Portal"
+
        title "My Portal Mod"
  type     singleplayer_only
+
type singleplayer_only
  nodifficulty   1
+
nodifficulty 1
  hasportals   1
+
hasportals 1
  FileSystem
+
nocrosshair 1
  {
+
nomodels 1
      SteamAppId            400      // This will mount all the GCFs we need (240=CS:S, 220=HL2).
+
     
      ToolsAppId            211      // Tools will load this (ie: source SDK caches) to get things like materials\debug, materials\editor, etc.
+
developer " Name "
     
+
developer_url " Link "
      //
+
manual " - "
      // The code that loads this file automatically does a few things here:
+
icon "resource/icon"
      //
 
      // 1. For each "Game" search path, it adds a "GameBin" path, in <dir>\bin
 
      // 2. For each "Game" search path, it adds another "Game" path in front of it with _<langage> at the end.
 
      //    For example: c:\hl2\cstrike on a french machine would get a c:\hl2\cstrike_french path added to it.
 
      // 3. For the first "Game" search path, it adds a search path called "MOD".
 
      // 4. For the first "Game" search path, it adds a search path called "DEFAULT_WRITE_PATH".
 
      //
 
  
      //
+
FileSystem
      // Search paths are relative to the base directory, which is where hl2.exe is found.
+
{
      //
+
SteamAppId 400
      // |gameinfo_path| points at the directory where gameinfo.txt is.
+
ToolsAppId 211
      // We always want to mount that directory relative to gameinfo.txt, so
 
      // people can mount stuff in c:\mymod, and the main game resources are in
 
      // someplace like c:\program files\valve\steam\steamapps\half-life 2.
 
      //
 
      SearchPaths
 
      {
 
        Game            |gameinfo_path|.
 
        Game            portal
 
        Game            hl2
 
      }
 
  }
 
}
 
  
 +
SearchPaths
 +
{
 +
game+mod |gameinfo_path|.
 +
platform |gameinfo_path|.
  
you can replace that file with the following, but you should be sure you have at least some understanding of what these changes mean.
+
// We search VPK files before ordinary folders, because most files will be found in
 +
// VPK and we can avoid making thousands of file system calls to attempt to open files
 +
// in folders where they don't exist.  (Searching a VPK is much faster than making an operating
 +
// system call.)
 +
game_lv portal/portal_lv.vpk
 +
game+mod portal/portal_sound_vo_english.vpk
 +
game+mod portal/portal_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
  
Code:
+
// Now search loose files.  We'll set the directory containing the gameinfo.txt file
"GameInfo"
+
// as the first "mod" search path (after any user customizations).  This is also the one
{
+
// that's used when writing to the "mod" path.
  game      "MyPortalMod"
+
mod+mod_write+default_write_path |gameinfo_path|.
  title      "MyPortalMod"
 
  type      singleplayer_only
 
  "icon"      "icon"
 
  
  nodifficulty  1
+
// Add the Portal directory as a game search path.  This is also where where writes
  hasportals  1
+
// to the "game" path go.
 +
game+game_write portal
  
  FileSystem
+
// Where the game's binaries are
  {
+
gamebin portal/bin
      SteamAppId            400
 
      ToolsAppId            211     
 
  
      SearchPaths
+
// Last, mount in shared HL2 loose files
      {
+
game |all_source_engine_paths|hl2
        Game            |gameinfo_path|.
+
platform |all_source_engine_paths|platform
        Game            portal
+
}
        Game            hl2
+
}
      }
 
  }
 
 
}
 
}
 +
</source>
  
'''
+
Restarting Steam at this point will create an entry in the game Library for the
These lines:'''
+
mod. Deleting the game folder we created or removing the
 +
<code>GameInfo.txt</code> file will remove the entry.
  
game      "MyPortalMod"
+
===Configure the Mod===
title      "MyPortalMod"
+
====Initial Setup====
Tell Steam and the Source engine what the name of this mod is.
+
Let's add some standard folders to the game directory that will hold our mod's
'''
+
configuration files and content. Add the following folders to your game  
This line:'''
+
directory:
type      singleplayer_only
+
* <code>cfg</code>
should be self explanatory. It defines what type of game this is. Since portal is single player at least for the moment, we will leave this alone.
+
* <code>resource</code>
'''
+
* <code>maps</code>.
This line:'''
 
"icon"      "icon"
 
Tells steam where the icon for this mod is located. we don't have an icon yet, but if you made one, it must be a uncompressed TGA format 16x16 image, and must be called '''icon''' and it must be placed in your mods main directory, then steam would know where to look for it. sometimes this can be a little bit troublesome, as sometimes steam needs to be restarted several times before it notices that the icon is present.
 
  
Everything after those lines i left the same except i deleted all of the comments. (comments are ignored by steam anyway).
+
While we're at it, let's add the following optional folders, for custom content
 +
like models and sounds:
 +
* <code>materials</code>
 +
* <code>models</code>
 +
* <code>scenes</code>
 +
* <code>scripts</code>
 +
* <code>sound</code>
  
Next, in the mods main folder, open the file '''maplist.txt''' it will look like this:
+
====Create a Map List====
 +
In your game directory, create a file called <code>maplist.txt</code>. In it, we
 +
will list all of the mod's map names (excluding the <code>.bsp</code>
 +
extension). This file allows the game to pre-cache the first .125 milliseconds
 +
of sound for a map, which is enough time to load the remainder.
  
Code:
+
The following is a sample <code>maplist.txt</code> for a mod with two maps,
background1
+
named <code>myportalmod_map_00.bsp</code> and
background2
+
<code>myportalmod_map_01.bsp</code>.
testchmb_a_00
 
testchmb_a_01
 
testchmb_a_02
 
testchmb_a_03
 
testchmb_a_04
 
testchmb_a_05
 
testchmb_a_06
 
testchmb_a_07
 
testchmb_a_08
 
testchmb_a_09
 
testchmb_a_10
 
testchmb_a_11
 
testchmb_a_13
 
testchmb_a_14
 
testchmb_a_15
 
escape_00
 
escape_01
 
escape_02
 
testchmb_a_08_advanced
 
testchmb_a_09_advanced
 
testchmb_a_10_advanced
 
testchmb_a_11_advanced
 
testchmb_a_13_advanced
 
testchmb_a_14_advanced
 
  
 +
<source>
 +
myportalmod_map_00
 +
myportalmod_map_01
 +
</source>
  
delete all of that and replace it with the names of your maps. keep them in order, and remember that you don't need '''Bold text'''.bsp on the end of the names in this list.
+
====Create Chapter Configuration Files====
 +
Change to your mod's <code>cfg</code> directory. Create configuration files for
 +
each chapter of your mod, starting with <code>chapter1.cfg</code> and continuing
 +
on to <code>chapter2.cfg</code>, etc.
  
-now go into your cfg folder and open '''chapter1.cfg''' it will only have one line:
+
In these files, you will issue whatever commands you want to be executed by the
map testchmb_a_00
+
developer console when the chapter is first loaded. Typically, a command to load
 +
the chapter's corresponding map is used.
  
replace that with:
+
The following is a <code>chapter1.cfg</code> example:
'''map <yourfirstmapname>'''
+
<source>
 +
map myportalmod_map_00
 +
</source>
  
<yourfirstmapname> should be the name of your first map, without the '''.bsp''' extension (just like it is in maplist.txt). this is your config file for chapter 1. Every time you want to add a new chapter, make a new config file and place the name of the first map of that chapter after the '''map''' text.
+
====Create a Localization File====
 +
Create a localization file, called <code>MyPortalMod_english.txt</code>, in your
 +
game directory's <code>resource</code> folder.
  
Now go into your mods resource folder, and change the name of '''portal_english.txt''' to '''MyPortalMod_english.txt'''. then open it in notepad. there is a lot of extra stuff in there but i didn't bother deleting it in the interest of not breaking anything as there is no need to even delete them.
+
Modify the contents of <code>MyPortalMod_english.txt</code> so that it is
 
+
similar to the following:
Find the following lines:
+
<source>
 
+
"lang"
"Portal_Chapter1_Title" "Testchamber 00"
+
{
"Portal_Chapter2_Title" "Testchamber 04"
+
"Language" "english"
"Portal_Chapter3_Title" "Testchamber 08"
+
"Tokens"
"Portal_Chapter4_Title" "Testchamber 10"
+
{
"Portal_Chapter5_Title" "Testchamber 13"
+
"MyPortalMod_chapter1" "The First Chapter"
"Portal_Chapter6_Title" "Testchamber 14"
+
"MyPortalMod_chapter2" "The Second Chapter"
"Portal_Chapter7_Title" "Testchamber 15"
+
}
"Portal_Chapter8_Title" "Testchamber 16"
+
}
"Portal_Chapter9_Title" "Testchamber 17"
+
</source>
"Portal_Chapter10_Title" "Testchamber 18"
 
"Portal_Chapter11_Title" "Testchamber 19"
 
"Portal_Chapter12_Title" "Testing Complete"
 
 
 
and replace them with:
 
 
 
"MyPortalMod_Chapter1_Title" "your chapter name"
 
 
 
Now, of course you should replace the part that says "MyPortalMod" with the name of your mod, and "your chapter name" with whatever you want the first chapter to be called. when you are ready to add a second chapter, add:
 
 
 
"MyPortalMod_Chapter2_Title" "your second chapter name"
 
 
 
and so on for chapter 3, 4...
 
 
 
== Setting up Source SDK to work with your mod ==
 
 
 
To set up the SDK to work with your mod, navigate to
 
Code:
 
Steam\SteamApps\<username>\sourcesdk\bin\orangebox\bin
 
 
 
and open up the text file '''GameConfig'''
 
 
 
Find where it says:
 
Code:
 
"Portal"
 
{
 
"GameDir" "c:\program files\steam\steamapps\SourceMods\'''you mod name'''"
 
"hammer"
 
{
 
"TextureFormat" "5"
 
"MapFormat" "4"
 
"DefaultTextureScale" "0.250000"
 
"DefaultLightmapScale" "16"
 
"DefaultSolidEntity" "func_detail"
 
"GameExeDir" "c:\program files\steam\steamapps\'''your username'''\half-life 2"
 
"MapDir" "c:\program files\steam\steamapps\sourcesdk_content\Portal\mapsrc"
 
"CordonTexture" "tools\toolsskybox"
 
"MaterialExcludeCount" "0"
 
"GameExe" "c:\program files\steam\steamapps\'''your username'''\half-life 2\hl2.exe"
 
"BSP" "c:\program files\steam\steamapps\'''your username'''\sourcesdk\bin\orangebox\bin\vbsp.exe"
 
"Vis" "c:\program files\steam\steamapps\'''your username'''\sourcesdk\bin\orangebox\bin\vvis.exe"
 
"Light" "c:\program files\steam\steamapps\'''your username'''\sourcesdk\bin\orangebox\bin\vrad.exe"
 
"BSPDir" "c:\program files\steam\steamapps\SourceMods\'''your mod name'''\maps"
 
"GameData0" "c:\program files\steam\steamapps\'''your username'''\sourcesdk\bin\orangebox\bin\halflife2.fgd"
 
}
 
}
 
 
 
 
 
 
 
Change the new '''your mod name''' to your mods folder name, not the name in the gameinfo.txt, i mean the mods folder name in sourcemods.
 
  
In the part:
+
In this case, <code>MyPortalMod</code> is used because it is the name of the
Code:
+
mod's game directory. "The First Chapter" is an English title for the mod's
"MapDir"      "c:\program files\steam\steamapps\<username>\sourcesdk_content\portal\mapsrc"
+
first chapter. Add any additional chapters for your mod by following the
"BSPDir"     "c:\program files\steam\steamapps\SourceMods\'''your mod name'''\maps"
+
pattern in "Tokens".
  
You may change these outputs to any desired location if you want, '''MapDir''' is where hammer saves your Portal mod maps VMF's. And '''BSPDir''' is where hammer places a compiled map's bsp for your mod.
+
{{warning|<u>'''This file must be saved in a Unicode format.'''</u>}}
  
Note: The parts that says c:\program files\steam\ may not be exactly the same, but it should say the path to your Steam directory. And the parts that say '''your username''' you must replace with your Steam username.
+
{{note|The author (on Windows Vista) used a little endian UTF-16 encoding. In Notepad, under <code>Save As...</code>, this is equivalent to choosing <code>unicode</code> for the <code>Encoding</code> option at the bottom of the dialog.}}
  
 +
==Setting Up Hammer==
 +
{{note|If you have not yet created a mod from the 'Source SDK' tool (creating a 'Source code only' mod doesn't count), then you will need to first create one. Otherwise, you will not be allowed to add a game configuration file for MyPortalMod. This configuration file is required to save Hammer settings specific for the MyPortalMod mod. See [[Create a Mod]] for details on this process. Do not create a 'Source code only' mod. {{confirm|Is [[Game Directory|vconfig.exe]] a viable alternative to creating an initial dummy mod?}}}}
  
== Mapping for your new mod ==
+
Launch the 'Source SDK' from your Steam Library 'Tools' section. Make sure that
 +
the 'Engine Version' pull-down has "Source Engine 2009" selected. Select 'Edit
 +
Game Configurations'. From the pop-up menu, select 'Add'. A second pop-up will
 +
appear, asking for a name and a directory. Enter the name that you want your  
 +
mod to be listed as (with respect to the 'Source SDK' tool) and enter the path to
 +
your game directory (<code>[Steam Root]\steamapps\SourceMods\MyPortalMod</code>).
 +
Then select 'OK' for the second and first pop-ups. Assume we named our game
 +
configuration "My Portal Mod".
  
That should complete the '''setup''' of your mod. now you just need to add maps to play. start up the SDK, and change "engine version" to "The Orange Box". in the current game dropdown list, there should now be an option for "MyPortalMod" (or whaatever you named it). Now when you make maps in this configuration, it will save the BSP files to where you chose the '''BSPDir'''
+
[[Image:Making_your_portal_mod_00.png|center]]
you should be good to go!
 
  
== Topics not covered for this mod ==
+
Restart the 'Source SDK' tool. Set 'Engine Version' and 'Current Game' to
 +
'Source Engine 2009' and 'My Portal Mod', respectively. Now, select 'Hammer
 +
Editor'. In the editor, select <code>Tools > Options</code>. A 'Configure
 +
Hammer' pop-up should appear. Select the 'Game Configurations' tab and then hit
 +
the 'Add' button for 'Game Data Files'. Select the file <code>portal.fgd</code>
 +
and accept the changes. These configurations will be saved and restored the next
 +
time you open Hammer from the 'Source SDK' tool with your mod name selected.
  
    * Creating a background map for the menu
+
==See Also==
    * Creating a background image for the menu
+
* [[Portal mod template]]
    * Creating images for the chapter titles
+
* [[Level Design]]
 +
* [[Modding]]
  
I have not chose to explain how to do this, because the way you do this for Half-Life 2 is the same for Portal.
+
<!-- This comment is 80 characters wide. -------------------------------------->
And also anything else that you do for a Half-Life 2 mod, is all done in the same manner for Portal.
 
So head over here: http://developer.valvesoftware.com/wiki/Category:Modding
 
To learn more on modding if needed.
 

Latest revision as of 21:45, 24 May 2018

Русский

This article will discuss how to create a Portal content mod, from scratch. Part of the reason for creating the mod from scratch is that Valve does not provide a specific SDK or mod template for Portal. Another reason is that creating the mod from scratch is not difficult and is of general interest to Source SDK developers that would like to learn more about how everything works. So, let's get started.

Note:Portal modification is different from some of the other Source-based games in that the source code to build the client.dll and server.dll files is not provided by Valve. However, a modder can still modify anything that isn't built directly into the game, which includes scenes, scripts, sounds, textures, and models, to name a few.

Prerequisites

To follow along with this article, you will need a copy of Portal and the Source SDK, installed on Steam.

Creating the Mod

Creating the mod consists of creating a game folder and filling it with configuration files and mod-related content. Let's assume we are creating a mod named "My Portal Mod", and that [Steam Root] is Steam's installed path on your machine. (e.g. C:\Program Files (x86)\Steam)

Create the Game Folder

Navigate to your SourceMods directory and create a folder named "MyPortalMod".

In this new directory, create a file called GameInfo.txt.

Edit the contents of GameInfo.txt so that they look similar to the following snippet. For details about the structure of this file, see

Gameinfo.txt.
Note: This page has been edited after the SteamPipe update
"GameInfo"
{
	game 		"My Portal Mod"
        title 		"My Portal Mod"
	type		singleplayer_only
	nodifficulty	1
	hasportals	1
	nocrosshair	1
	nomodels	1
       
	developer		" Name "
	developer_url		" Link "
	manual		" - "
	icon		"resource/icon"

	FileSystem
	{
		SteamAppId				400
		ToolsAppId				211

		SearchPaths
		{
			game+mod			|gameinfo_path|.
			platform			|gameinfo_path|.

			// We search VPK files before ordinary folders, because most files will be found in
			// VPK and we can avoid making thousands of file system calls to attempt to open files
			// in folders where they don't exist.  (Searching a VPK is much faster than making an operating
			// system call.)
			game_lv				portal/portal_lv.vpk
			game+mod			portal/portal_sound_vo_english.vpk
			game+mod			portal/portal_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

			// Now search loose files.  We'll set the directory containing the gameinfo.txt file
			// as the first "mod" search path (after any user customizations).  This is also the one
			// that's used when writing to the "mod" path.
			mod+mod_write+default_write_path		|gameinfo_path|.

			// Add the Portal directory as a game search path.  This is also where where writes
			// to the "game" path go.
			game+game_write		portal

			// Where the game's binaries are
			gamebin				portal/bin

			// Last, mount in shared HL2 loose files
			game				|all_source_engine_paths|hl2
			platform			|all_source_engine_paths|platform
		}
	}
}

Restarting Steam at this point will create an entry in the game Library for the mod. Deleting the game folder we created or removing the GameInfo.txt file will remove the entry.

Configure the Mod

Initial Setup

Let's add some standard folders to the game directory that will hold our mod's configuration files and content. Add the following folders to your game directory:

  • cfg
  • resource
  • maps.

While we're at it, let's add the following optional folders, for custom content like models and sounds:

  • materials
  • models
  • scenes
  • scripts
  • sound

Create a Map List

In your game directory, create a file called maplist.txt. In it, we will list all of the mod's map names (excluding the .bsp extension). This file allows the game to pre-cache the first .125 milliseconds of sound for a map, which is enough time to load the remainder.

The following is a sample maplist.txt for a mod with two maps, named myportalmod_map_00.bsp and myportalmod_map_01.bsp.

myportalmod_map_00
myportalmod_map_01

Create Chapter Configuration Files

Change to your mod's cfg directory. Create configuration files for each chapter of your mod, starting with chapter1.cfg and continuing on to chapter2.cfg, etc.

In these files, you will issue whatever commands you want to be executed by the developer console when the chapter is first loaded. Typically, a command to load the chapter's corresponding map is used.

The following is a chapter1.cfg example:

map myportalmod_map_00

Create a Localization File

Create a localization file, called MyPortalMod_english.txt, in your game directory's resource folder.

Modify the contents of MyPortalMod_english.txt so that it is similar to the following:

"lang"
{
"Language" "english"
"Tokens"
{
"MyPortalMod_chapter1"	"The First Chapter"
"MyPortalMod_chapter2"	"The Second Chapter"
}
}

In this case, MyPortalMod is used because it is the name of the mod's game directory. "The First Chapter" is an English title for the mod's first chapter. Add any additional chapters for your mod by following the pattern in "Tokens".

Warning: This file must be saved in a Unicode format.

Note:The author (on Windows Vista) used a little endian UTF-16 encoding. In Notepad, under Save As..., this is equivalent to choosing unicode for the Encoding option at the bottom of the dialog.

Setting Up Hammer

Note:If you have not yet created a mod from the 'Source SDK' tool (creating a 'Source code only' mod doesn't count), then you will need to first create one. Otherwise, you will not be allowed to add a game configuration file for MyPortalMod. This configuration file is required to save Hammer settings specific for the MyPortalMod mod. See Create a Mod for details on this process. Do not create a 'Source code only' mod.
Confirm:Is vconfig.exe a viable alternative to creating an initial dummy mod?

Launch the 'Source SDK' from your Steam Library 'Tools' section. Make sure that the 'Engine Version' pull-down has "Source Engine 2009" selected. Select 'Edit Game Configurations'. From the pop-up menu, select 'Add'. A second pop-up will appear, asking for a name and a directory. Enter the name that you want your mod to be listed as (with respect to the 'Source SDK' tool) and enter the path to your game directory ([Steam Root]\steamapps\SourceMods\MyPortalMod). Then select 'OK' for the second and first pop-ups. Assume we named our game configuration "My Portal Mod".

Making your portal mod 00.png

Restart the 'Source SDK' tool. Set 'Engine Version' and 'Current Game' to 'Source Engine 2009' and 'My Portal Mod', respectively. Now, select 'Hammer Editor'. In the editor, select Tools > Options. A 'Configure Hammer' pop-up should appear. Select the 'Game Configurations' tab and then hit the 'Add' button for 'Game Data Files'. Select the file portal.fgd and accept the changes. These configurations will be saved and restored the next time you open Hammer from the 'Source SDK' tool with your mod name selected.

See Also