Making Your Portal Mod: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Fixed some things, because Scratchyoshi fixed other things.)
Line 63: Line 63:


Now, create a file called maplist.txt. In this, put all of your mod's map names without the ".bsp" extenstion.
Now, create a file called maplist.txt. In this, put all of your mod's map names without the ".bsp" extenstion.
Not sure of the point of this. Maybe to make chapters work.
This allows the game to precache the first .125 milliseconds of sound in the map, which is enough time to load the rest.


Change to your cfg directory and make a file called chapter1.cfg.
Change to your cfg directory and make a file called chapter1.cfg.
Line 70: Line 70:
If you want more chapters make chapter2.cfg, chapter3.cfg, and so on.
If you want more chapters make chapter2.cfg, chapter3.cfg, and so on.


Now, switch to your resources folder and create a file called MyPortalMod_english.txt with the name of your mod's folder replacing MyPortalMod.
Now, switch to your resources folder and create a file called MyPortalMod_english.txt with the name of your mod's folder replacing MyPortalMod. Type in
Type in text like this:
 
"MyPortalMod_chapter1" "First Chapter"
<pre>"lang"
{
"Language" "english"
"Tokens"
{</pre>
 
Then type in text like this:
<code>"MyPortalMod_chapter1" "First Chapter"</code>
MyPortalMod is the name of your mod's folder. First Chapter is the name of your first chapter.
MyPortalMod is the name of your mod's folder. First Chapter is the name of your first chapter.
Add additional lines with chapter2, chapter3, etc. instead of chapter1 for additional chapters.
Add additional lines with chapter2, chapter3, etc. instead of chapter1 for additional chapters.
At the end, put:
<pre>
}
}
</pre>
Save the file AS UNICODE. IT HAS TO BE UNICODE.
Save the file AS UNICODE. IT HAS TO BE UNICODE.



Revision as of 01:56, 26 March 2012

Broom icon.png
This article or section needs to be cleaned up to conform to a higher standard of quality.
For help, see the VDC Editing Help and Wikipedia cleanup process. Also, remember to check for any notes left by the tagger at this article's talk page.

Not an executable mod

You can't modify the executables, libraries, or anything like that. You CAN modify/create scenes, scripts, sounds, textures, models, or anything else that isn't completely built into the game.

Getting started

You do not need any tools to do this (apart from Windows, Steam and a copy of Portal on Steam).

Creating Necessary Folders

In a Windows Explorer window, navigate to your Steam directory. Then go to the folders: SteamApps, sourcemods. Inside sourcemods, create a folder. For this tutorial I will use "MyPortalMod". You can use anything -- it does not affect the mod's actual name. Make the following folders:

  • cfg
  • resource
  • maps
  • materials -- Optional
  • models -- Optional
  • sound -- Optional
  • scripts -- Optional
  • scenes -- Optional

Create files

Create and open a file called GameInfo.txt.

Copy and paste this into the file and then we'll go through what it means.

"GameInfo"
{
   game      "MyPortalMod"
   title       "MyPortalMod"
   type      singleplayer_only
   "icon"      "icon"

   nodifficulty   1
   hasportals   1

   FileSystem
   {
      SteamAppId            400
      ToolsAppId            211      

      SearchPaths
      {
         Game            |gameinfo_path|.
         Game            portal
         Game            hl2
      }
   }
}

game "MyPortalMod" tells Steam that the name of this game is MyPortalMod. This will appear in the Steam menu.

title "MyPortalMod" tells Source that it should display the title MyPortalMod on the titlescreen.

type singleplayer_only tells Source that this is NOT a multiplayer game. This makes the "multiplayer" tab not appear in Options.

"icon" "icon" tells Steam to look for a file called icon.tga, which will be the game's icon. Note: The FIRST "icon" is telling Steam this is the icon line, the SECOND icon is telling it to look for a file called icon.tga.

nodifficulty 1 tells Source not to show difficulty settings.

hasportals 1 tells Portal's Source that this game includes portals. If on, the "Portals" tab will appear in options.

The rest is telling Steam to load Portal's Source engine and models.

Now, create a file called maplist.txt. In this, put all of your mod's map names without the ".bsp" extenstion. This allows the game to precache the first .125 milliseconds of sound in the map, which is enough time to load the rest.

Change to your cfg directory and make a file called chapter1.cfg. Add all the lines you want executed in the developer console when you load the first chapter of your mod to this file. Usually all you'd do is type in map and then the name of the first map of chapter 1 without the ".bsp" extenstion. If you want more chapters make chapter2.cfg, chapter3.cfg, and so on.

Now, switch to your resources folder and create a file called MyPortalMod_english.txt with the name of your mod's folder replacing MyPortalMod. Type in

"lang" 
{ 
"Language" "english" 
"Tokens" 
{

Then type in text like this: "MyPortalMod_chapter1" "First Chapter" MyPortalMod is the name of your mod's folder. First Chapter is the name of your first chapter. Add additional lines with chapter2, chapter3, etc. instead of chapter1 for additional chapters. At the end, put:

} 
}

Save the file AS UNICODE. IT HAS TO BE UNICODE.

Setting up Source SDK to work with your mod

Go into Source SDK. Select Edit Game Configurations. Now select Add. Type in the name you want your mod to be listed as in the Source SDK in the Name box and the path to your mod folder in the Directory box.

Setting up the Hammer Editor

In Hammer Editor select Tools and then Options. Then make sure you are on the Game Configurations tab and choose Add. Then double-click on portal.fgd and click Open then OK and you're done.

See Also