Portal 2

Portal 2

73 ratings
How to make Portal 2 Mod? - Tutorial
By RedSkittleFox
1.Mod folder structure creation
First we need to make basic game
I will be making my mod called Escapent.
Go to ...//steam/steamapps/common/ and create here your game folder.

Now in that folder create next folders:
-Yourmodname (with out space)

Now copy folders:

Now we need to get basic game launcher.
Copy portal2.exe to your game folder and give it same name as yourmodname folder.

At the end it will look like that:

Now we will do things in Yourmodname folder

First create this folders:

Copy scenes.image from
...\Steam\steamapps\common\Portal 2\portal2_dlc2\scenes
and paste it to scenes folder.

Now copy
-cfg from
...\Steam\steamapps\common\Portal 2\portal2_dlc2\
to your folder

Create game_sounds_manifest.txt in scripts folder inside yourmodname folder

Write in it:
// README FIRST!!! // // Due to a limitation in the sound emitter system that we shipped on PS3, // the original sound scripts must NOT be changed after ship on PC/Mac // until we can patch PS3 and fix the issue for real. // // You will get a fatal error on startup if you do so. // // If you need to add more sounds, you MUST add them to a NEW sound script file // and reference that file at the BOTTOM of this list after the designated // marker ("new_sound_scripts_must_go_below_here"). // game_sounds_manifest { "precache_file" "scripts/game_sounds.txt" "precache_file" "scripts/game_sounds_ui.txt" "precache_file" "scripts/game_sounds_player.txt" // HL2 World, Ambient Generic, Items, Physics, Vehicles "precache_file" "scripts/game_sounds_physics.txt" // Game level sounds "precache_file" "scripts/level_sounds_aperture.txt" "precache_file" "scripts/game_sounds_portal.txt" "precache_file" "scripts/game_sounds_weapons_portal.txt" "precache_file" "scripts/npc_sounds_energy_ball.txt" // Aperture "precache_file" "scripts/game_sounds_props_aperture.txt" "precache_file" "scripts/game_sounds_vo.txt" "precache_file" "scripts/game_sounds_animation.txt" "precache_file" "scripts/game_sounds_auto_generated.txt" "precache_file" "scripts/game_sounds_turret_auto_generated.txt" "precache_file" "scripts/game_sounds_cave_auto_generated.txt" "precache_file" "scripts/game_sounds_sphere03_auto_generated.txt" "precache_file" "scripts/game_sounds_world.txt" "precache_file" "scripts/game_sounds_announcer_auto_generated.txt" "precache_file" "scripts/game_sounds_cores_auto_generated.txt" //Portal content Sounds "precache_file" "scripts/level_sounds_music_portal.txt" "precache_file" "scripts/level_sounds_escape.txt" "precache_file" "scripts/npc_sounds_aperture_ai.txt" "precache_file" "scripts/npc_sounds_energy_ball.txt" "precache_file" "scripts/npc_sounds_turret_portal.txt" "precache_file" "scripts/npc_sounds_rocket_turret.txt" "precache_file" "scripts/npc_sounds_glados_cores.txt" //Co-op bots "precache_file" "scripts/game_sounds_ballbot.txt" "precache_file" "scripts/game_sounds_eggbot.txt" // NPC Sounds "precache_file" "scripts/npc_sounds_combine_ball.txt" "precache_file" "scripts/npc_sounds_combine_ball_episodic.txt" "precache_file" "scripts/npc_sounds_hover_turret.txt" "precache_file" "scripts/npc_sounds_turret.txt" "precache_file" "scripts/game_sounds_npc.txt" // Player "precache_file" "scripts/game_sounds_player_portal2.txt" // Items "precache_file" "scripts/game_sounds_nugget.txt" // FIXME / REMOVEME / whatever: tempcontent "precache_file" "scripts/level_sounds_tempcontent.txt" // Paint "precache_file" "scripts/game_sounds_weapons_paintgun.txt" "precache_file" "scripts/game_sounds_paint_player.txt" "precache_file" "scripts/game_sounds_paint.txt" // Scripted Sequences / Cinematics / Set Pieces "precache_file" "scripts/game_sounds_scripted_sequence.txt" // VFX / Particles / Beams "precache_file" "scripts/game_sounds_vfx.txt" // Music "precache_file" "scripts/game_sounds_music.txt" "precache_file" "scripts/game_sounds_music_A1.txt" "precache_file" "scripts/game_sounds_music_A2.txt" "precache_file" "scripts/game_sounds_music_A3.txt" "precache_file" "scripts/game_sounds_music_A4.txt" "precache_file" "scripts/game_sounds_music_mp.txt" "new_sound_scripts_must_go_below_here" "" // ---- // PRECACHE NEW SOUND SCRIPTS HERE! // ---- //BR "precache_file" "scripts/game_sounds_BR_world.txt" // taunts for the store "precache_file" "scripts/game_sounds_taunts_egg.txt" "precache_file" "scripts/game_sounds_taunts_ball.txt" }
2.Gameinfo creation
Now we need to make gameinfo.
Create file called gameinfo.txt in .../steam/steamapps/common/yourmodname/yourmodname/

"GameInfo" { game "(YouModName)" title "(YouModName)" gamelogo 1 SupportsDX8 0 SupportsXbox360 1 FileSystem { SteamAppId 620 //(YouModName) has ID (here Id of your steam mod) ToolsAppId 211 // Hammer SearchPaths { Game |gameinfo_path|. Game "|gameinfo_path|../../(YouModName)/(YouModName)/" Game "|gameinfo_path|../../(YouModName)/portal2_dlc2/" Game "|gameinfo_path|../../Portal 2/portal2/" Game "|gameinfo_path|../../Portal 2/portal2_dlc2/" Game "|gameinfo_path|../../Portal 2/portal2_dlc1/" platform "|gameinfo_path|../../(YouModName)/platform/" } } }
3.First running your mod
This part will teach you how to run first time your mod

First run steam (steam.exe).
Then go to library/add a game/add a non-steam game... and select (yormodname).exe

Press run !. You monster.

If u will see orange loading progress don't worry :D. Just wait to 100% and close game.

At the end it will look like that:

When you run game again there will be portal 2 menu.

If you get error called "cant find background image materials/console/startup_loading.vtf"
Go to Portal 2/portal2/pak01_dir then open it and go to materials/console and copy startup_loading.vtf and startup_loading.vmf go to mod pak01_dir open it and go to materials/console and put that files there.

If you get another missing error just copy that files to your game.
4.Menu configuration. (Visual Edition part 1)
This is the hardest part in this part we will reconfigure main menu, create translation and mod menu

To make this we will need:
-notepad++ (download[notepad-plus-plus.org])
-GCFScape (download[nemesis.thewavelength.net])

So let's start.
Now create folder called pak01_dir where you want.
This will be our materials folder.

Menu configuration

Now go to your pak01_dir create folder resource, in this folder create another folder called ui and in ui folderbasemodui so it will look like resource\ui\basemodui\

In basemodui folder create mainmenu_new.res

In mainmenu_new.res write this:
"Resource/UI/MainMenu.res" { "MainMenu" { "ControlName" "Frame" "fieldName" "MainMenu" "xpos" "0" "ypos" "0" "wide" "f0" "tall" "f0" "autoResize" "0" "pinCorner" "0" "visible" "1" "enabled" "1" "tabPosition" "0" "PaintBackgroundType" "0" } "BtnExtras" [!$GAMECONSOLE] { "ControlName" "BaseModHybridButton" "fieldName" "BtnExtras" "xpos" "88" [$GAMECONSOLE && ($GAMECONSOLEWIDE && !$ANAMORPHIC)] "xpos" "63" [$GAMECONSOLE && (!$GAMECONSOLEWIDE || $ANAMORPHIC)] "xpos" "88" [!$GAMECONSOLE && $WIN32WIDE] "xpos" "63" [!$GAMECONSOLE && !$WIN32WIDE] "ypos" "280" [$GAMECONSOLE] "ypos" "258" [!$GAMECONSOLE] "wide" "280" "tall" "20" "autoResize" "1" "pinCorner" "0" "visible" "1" "enabled" "1" "tabPosition" "0" "navUp" "BtnOptions" "navDown" "BtnQuit" "labelText" "#L4D360UI_MainMenu_Extras" "style" "MainMenuButton" "command" "Extras" "ActivationType" "1" } // Community Maps "BtnCommunity" [!$GAMECONSOLE] { "ControlName" "BaseModHybridButton" "fieldName" "BtnCommunity" "xpos" "88" [$GAMECONSOLE && ($GAMECONSOLEWIDE && !$ANAMORPHIC)] "xpos" "63" [$GAMECONSOLE && (!$GAMECONSOLEWIDE || $ANAMORPHIC)] "xpos" "88" [!$GAMECONSOLE && $WIN32WIDE] "xpos" "63" [!$GAMECONSOLE && !$WIN32WIDE] "ypos" "310" [$GAMECONSOLE] "ypos" "288" [!$GAMECONSOLE] "wide" "280" "tall" "20" "autoResize" "1" "pinCorner" "0" "visible" "1" "enabled" "1" "tabPosition" "0" "navUp" "BtnOptions" "navDown" "BtnQuit" "labelText" "#PORTAL2_MainMenu_Community" "style" "MainMenuButton" "command" "CreateChambers" "ActivationType" "1" } "BtnOptions" { "ControlName" "BaseModHybridButton" "fieldName" "BtnOptions" "xpos" "88" [$GAMECONSOLE && ($GAMECONSOLEWIDE && !$ANAMORPHIC)] "xpos" "63" [$GAMECONSOLE && (!$GAMECONSOLEWIDE || $ANAMORPHIC)] "xpos" "88" [!$GAMECONSOLE && $WIN32WIDE] "xpos" "63" [!$GAMECONSOLE && !$WIN32WIDE] "ypos" "340" [$GAMECONSOLE] "ypos" "318" [!$GAMECONSOLE] "wide" "280" "tall" "20" "autoResize" "1" "pinCorner" "0" "visible" "1" "enabled" "1" "tabPosition" "0" "navUp" "BtnCoOp" [$GAMECONSOLE] "navUp" "BtnCommunity" [!$GAMECONSOLE] "navDown" "BtnPlaySolo" [$GAMECONSOLE] "navDown" "BtnExtras" [!$GAMECONSOLE] "labelText" "#PORTAL2_MainMenu_Options" "style" "MainMenuButton" "command" "Options" "ActivationType" "1" } "BtnQuit" [!$GAMECONSOLE] { "ControlName" "BaseModHybridButton" "fieldName" "BtnQuit" "xpos" "88" [$WIN32WIDE] "xpos" "63" [!$WIN32WIDE] "ypos" "348" "wide" "280" "tall" "20" "autoResize" "1" "pinCorner" "0" "visible" "1" "enabled" "1" "tabPosition" "0" "navUp" "BtnExtras" "navDown" "BtnEconUI" "labelText" "#PORTAL2_MainMenu_Quit" "style" "MainMenuButton" "command" "QuitGame" "ActivationType" "1" } }

Now we need to put pak01_dir folder to

Now go to
Find there vpk.exe and create shortcut next to your pak01_dir folder.

Now put pak01_dir folder over vpk.exe like that:

Then it will create pak01_dir.vpk

Go to steam and run game :)

When game is in fullscrean and you press any button andgame close go to steam right click on modname/setlaunch options and write there -windowed
5.Chapter menu configuration. (Visual Edition Part 2)
Go to your mod folder found folder called scripts.
Create file called extras.txt

Lets start scripting:

This are some tamplates:

For Chapter:
"(chaptername)" { "title" "translationtitle" //You can name it for example chapter_1 "subtitle" "translationsubtitle" //You can name it for example chapter_1_sub "pic" "vgui/chapters/(here chapter picture name)" "map" "(map name)" }

For Empty Line:
"nothing" { "title" "empty" //It must be named empty "subtitle" "empty" "command" " " }

For Website:
"Website" [!$GAMECONSOLE] { "title" "websitetranslation" "subtitle" "websitesubtitle" "pic" "vgui/menu/(picture)" "url" "url" }

For Load Last Save:
"save" { "title" "lastsavetranslation" "subtitle" "lastsavetranslation" "pic" "vgui/menu/(picture)" "command" "load autosave" }
If you don't know what is going on with title go to Translation Tab.

Now for custome image you need to get image, convert it to vtf file and put it in to .../vgui/meny/(chapter 1 for example)
6.Custom Loading Image, Logo and Menu Background (Visual Edition Part 3)
Now we will create custome loading image.

First get your image and convert it to vtf file and then rename it to portal2_product_2_widescreen ,portal2_product_1_widescreen portal2_product_2 and portal2_product_1.
Now put it to .../pak01_dir/materials/console and compile it.

Custom Logo
Create your logo with demensions 512 px x 128 px and then convert it to vtf and rename it to portal2logo.vtf .
Now create vmt file with name portal2logo.vmt and write inside it:

UnlitGeneric { $basetexture "vgui/portal2logo" $translucent 1 $vertexcolor 1 $vertexalpha 1 $ignorez 1 $additive 0 $no_fullbright 1 $SHADERSRGBREAD360 1 }
Now place all files in .../pak01_dir/materials/vgui/ and compile vpk folder.

Custom Menu Background

To create custome menu bg you need to create movie of it.
Now open RAD Video Tools, chose your movie and press Bink It!
Now rename it to menu_act01.bik (this will be bg for sp_a1_(...) )
menu_act02.bik (this will be bg for sp_a2_(...) )
menu_act03.bik (this will be bg for sp_a3_(...) )
menu_act04.bik (this will be bg for sp_a4_(...) )
menu_act05.bik (this will be bg for sp_a5_(...) )
7.Custome Sounds
Custome Main menu bg sound

Now we will add our own bg sound.
First create a sound and convert it to wav file (I'm not sure mp3 will work).
Then name it "portal2_background01.wav" for sp_a1
"portal2_background02.wav" for sp_a2
"portal2_background03.wav" for sp_a3
"portal2_background04.wav" for sp_a4
"portal2_background05.wav" for sp_a5

Now go to .../pak01_dir/sound/music/ and place there all sound files.
Copy file from portal 2/portal2/resource/basemodui_english.txt to your folder

"L4D360UI_MainMenu_Extras" "Extras"
"L4D360UI_MainMenu_Extras" "Yourmodname"

"L4D360UI_MainMenu_Quit_Confirm" "Portal 2"
"L4D360UI_MainMenu_Quit_Confirm" "Yourmodname"

In "Menu configuration tab I wrote "chaptertranslation" and so on as name of chapters.
Now you need to rename that names to your chapter names for example.

"title" "chapter_1_translation"
"subtitle" "chapter_1_sub_translation"
"pic" "vgui/chapters/(here chapter picture name)"
"map" "sp_a1_intro"

"chapter_1_translation" "Intro"
"chapter_1_sub_translation" "Chapter 1 - Intro"
There are some help full informations.

Portal 2 Hammer Wiki : https://developer.valvesoftware.com/wiki/Category:Portal_2_Level_Design
Custom Bee2 pallete items : (Comming Soon)
< >
[OLIWIER] Jun 18 @ 6:23am 
when i run the game it goes away but its still running, if I click on it again it just goes away again
Gravy59 Mar 31 @ 7:54am 
Will this work without Portal 2 installed or will I need Portal 2? I'm guessing the former.
Dream Two Mar 24 @ 12:44pm 
how do i import robot mods
Theicyoctoling Nov 10, 2020 @ 6:12pm 
I can't run my game it says "Setup file "GameInfo.txt" doesn't exist in suubdirectory 'portal' .Check your -game parameter or VCONFIG setting." so can you help
brtkllo Nov 1, 2020 @ 11:44am 
@Legacy | Oakley did you activate the shortcut
Tameranian Oct 29, 2020 @ 1:27am 
When I boot up the game I have no single-player option, so I cannot select the chapters. What did I do wrong?
JTeslaCoil Apr 7, 2020 @ 2:05pm 
@Octoexus copy the meterials folder and paste it in yourmodname floder
pluto is a planet Mar 18, 2020 @ 8:42am 
i mean i drag pak01_dir in vpk.exe
pluto is a planet Mar 18, 2020 @ 8:41am 
@RedSkittleFox i drag pak01_dir up the vpk.exe but nothing happens!
Rosegx879 Mar 1, 2020 @ 3:39am 
I'm having a problem running the game it just gives me this error "Setup file 'GameInfo.txt' doesn't exist in subdirectory check your -game parameter or VCONFIG setting "