Difference between revisions of "Create a portal 2 mod"

From Valve Developer Community
Jump to: navigation, search
m
(Completely rewrote.)
Line 1: Line 1:
Although the "Create a Mod" option of the Source SDK is not included in the Portal 2 Authoring Tools beta, you can still create mods.
+
The old tutorial was obsoleted by DLC2. This is the new method, as described by Lpfreaky90 and Felix Griffin.
  
The Method is a simple method, but takes a bit of pateince, due to 9.45GB  being copied.
+
===Step 1===
 +
Create a folder for your mod in Steam/steamapps/sourcemods and rename it to the name of your mod. Open that folder and create two subfolders: "cfg" and "maps".
  
 +
===Step 2===
 +
Open the "maps" folder and create a folder called "soundcache" inside it. Copy the file called "_master.cache" from Steam/steamapps/common/portal 2/portal2_dlc2/maps/soundcache to this new soundcache folder.
  
== How it is done ==
+
===Step 3===
 +
Create a gameinfo.txt file in your mod's root directory. Use this template:
 +
[code]
 +
"GameInfo"
 +
    {
 +
        game        "Your Mod's Name"
 +
        title      "Your Mod's Name"
 +
        gamelogo    1
 +
        SupportsDX8    0
 +
        SupportsXbox360 1
 +
        FileSystem
 +
        {
 +
            SteamAppId 620      // Portal 2 has ID 620
 +
            ToolsAppId 211      // Hammer
 +
            SearchPaths
 +
            {
 +
                Game                |gameinfo_path|.
 +
                Game                portal2_dlc2
 +
                Game                portal2_dlc1
 +
                Game                portal2
 +
            }
 +
        }
 +
    }
 +
[/code]
  
First, go into "C:\Program Files\Steam\steamapps\common\portal 2\" or whatever your Portal 2 game files folder is
+
===Step 4===
 +
Use a program like GCFScape to open Steam/steamapps/common/portal 2/portal2_dlc2/pak01_dir.vpk and copy the file called resource/ui/basemodui/mainmenu_new.res to (your mod)/resource/ui/basemodui. Edit it, then pack it into a new VPK using portal 2/bin/vpk.exe or GCFScape.
  
(the "Program Files" may be "Program Files (x86)" or "Program Files (x64)").
+
===Step 5===
 
+
Restart Steam. If it all worked, your mod should be listed. Congratulations!
[[File:Portal2Mod1.GIF]]
 
 
 
Highlight the "portal2" folder, and copy. (Ctrl+C or Right click and 'copy')
 
 
 
Now go into "C:\Program Files\Steam\steamapps\sourcemods" or whatever your SourceMods folder is.
 
 
 
Paste the files and wait for them to finish copying.
 
 
 
----
 
 
 
'''Now, you are free to edit any of the Portal 2 files (in the sourcemods folder) and create your mod.  
 
 
 
 
 
To install the mod on other computers it is as simple as downloading the mod folder and extracting it into the sourcemods folder!'''
 
 
 
----
 
 
 
''Additional info:''
 
 
 
[[File:Portal2ModInfo.GIF]]
 
 
 
 
 
The Portal 2 Steam appid is 620.
 
On the gameinfo file, change 'title' and 'game' from "PORTAL 2"  to whatever your mod is called.
 
  
 
[[Category:Portal 2 Level Design]]
 
[[Category:Portal 2 Level Design]]
 
[[Category:Modding]]
 
[[Category:Modding]]

Revision as of 22:20, 20 November 2013

The old tutorial was obsoleted by DLC2. This is the new method, as described by Lpfreaky90 and Felix Griffin.

Step 1

Create a folder for your mod in Steam/steamapps/sourcemods and rename it to the name of your mod. Open that folder and create two subfolders: "cfg" and "maps".

Step 2

Open the "maps" folder and create a folder called "soundcache" inside it. Copy the file called "_master.cache" from Steam/steamapps/common/portal 2/portal2_dlc2/maps/soundcache to this new soundcache folder.

Step 3

Create a gameinfo.txt file in your mod's root directory. Use this template: [code] "GameInfo"

   {
       game        "Your Mod's Name"
       title       "Your Mod's Name"
       gamelogo    1
       SupportsDX8     0
       SupportsXbox360 1
       FileSystem
       {
           SteamAppId 620      // Portal 2 has ID 620
           ToolsAppId 211      // Hammer
           SearchPaths
           {
               Game                |gameinfo_path|.
               Game                portal2_dlc2
               Game                portal2_dlc1
               Game                portal2
           }
       }
   }

[/code]

Step 4

Use a program like GCFScape to open Steam/steamapps/common/portal 2/portal2_dlc2/pak01_dir.vpk and copy the file called resource/ui/basemodui/mainmenu_new.res to (your mod)/resource/ui/basemodui. Edit it, then pack it into a new VPK using portal 2/bin/vpk.exe or GCFScape.

Step 5

Restart Steam. If it all worked, your mod should be listed. Congratulations!