Welcome to my profile. You do not need to know anything.

RSS My Blogs

How to make a Portal 2 Mod - Part 3: Configure Main Menu

HaloFromSteam Blog 2 comments

Welcome back, Test Subject! This is getting a bit advanced now... Here's some coding you have to do.. :O

Yep, that's right.

Now, go to steamapps\common\portal 2\portal2\, and open up pak01_dir.vpk in GCFScape
Oh, and also anywhere outside your mod folder, create a folder called pak01_dir. Really. That.
Now, create ui\basemodui in your mod's resource folder.

So, when GCFScape is open, go to resource\ui\basemodui.
Go open up mainmenu.res with a text editor, and also go copy and paste it into \resource\ui\basemodui. Now, rename that to mainmenu_new.res
So, first, let's change: (This is for the Single Player Button)

"labelText" "#PORTAL2_MainMenu_Solo"

to:

"labelText" ""

Mine is just:

"labelText" "Play Single Player."

Now, change:

"command" "SoloPlay"

to:

"command" "Extras"

To make it jump into the extras button.

Now to remove the co-op button.

Text Code:

"BtnCoOp"
{
"ControlName" "BaseModHybridButton"
"fieldName" "BtnCoOp"
"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" "220"
"tall" "20"
"autoResize" "1"
"pinCorner" "0"
"visible" "1"
"enabled" "1"
"tabPosition" "0"
"navUp" "BtnPlaySolo"
"navDown" "BtnOptions"
"labelText" "#PORTAL2_MainMenu_CoOp"
"style" "MainMenuButton"
"command" "CoopPlay"
"ActivationType" "1"
}

Also, keep the original .res file open from the .vpk file. You'll need some things from there later on.

Now, remove the extras button.

Text Code:

"BtnExtras" [!$GAMECONSOLE]
{
"ControlName" "BaseModHybridButton"
"fieldName" "BtnExtras"
"xpos" "88" [$WIN32WIDE]
"xpos" "63" [!$WIN32WIDE]
"ypos" "348"
"wide" "220"
"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"
}

Now, remove the Robot Enrichment Econ.

Text Code:

"BtnEconUI" [!$GAMECONSOLE]
{
"ControlName" "BaseModHybridButton"
"fieldName" "BtnEconUI"
"xpos" "97" [$WIN32WIDE]
"xpos" "72" [!$WIN32WIDE]
"ypos" "420"
"wide" "220"
"tall" "20"
"autoResize" "1"
"pinCorner" "0"
"visible" "1"
"enabled" "1"
"tabPosition" "0"
"navUp" "BtnQuit"
"navDown" "BtnPlaySolo"
"labelText" "#PORTAL2_MainMenu_Econ"
"style" "BitmapButton"
"command" "EconUI"
"ActivationType" "1"
"bitmap_enabled" "vgui/store/store_button"
"bitmap_focus" "vgui/store/store_button_focus_anim"

Now, time for the navigation.

So, first, find:

"navDown" "BtnCoOp"

And replace that with:

"navDown" "BtnOptions"

NOTE: This is where you need the original .res file...
Below, for the Options button, you will have to remap that as well. So... find:

"navUp" "BtnCoOp"

And replace it with:

"navUp" "BtnPlaySolo"

Save that file now. Go to \bin, drag that pak01_dir folder outside your hard drive onto vpk.exe, and copy and paste the pak01_dir.vpk (The one you just created) into your mod's folder. Restart Steam and test it!

Continue on to Part 4!

How to make a Portal 2 Mod - Part 2: Making your Mod playable

HaloFromSteam Blog

Welcome back test subject!
So, let's start modding. First, go to the hard drive steam was installed on. (For me, I have a 64-bit computer, and I installed it in C:\Program Files (x86)\Steam, if you have a 32-bit computer it should be in Program Files, and when i was installing steam I forgot if you can choose where you install Steam. I think you can choose, now whatever.) So, now back to modding. Let's go to steamapps\sourcemods. Now, let's create a new folder. Name it the name of your mod. Now do that, and go inside that folder. Let's create one of the most important files: gameinfo.txt. Oh, and also this is only for people with SteamPipe update and after. Now, open up the text file. Now, copy and paste this:

text 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
}
}
}

Now, change the "Your Mod's Name" to the name of your mod. Do it for both lines, game and title.
So, save that file and close it. Now, also create another .txt file. (In your mod's directory). And name it "maplist".
So, if your mod has 70 maps like mine, then you'll need to know what 70 divided by 5 is. (Only if you want each act to have the same number of maps) Here's the answer: 14. Now, the original game has 5 acts. So also the mod has to have five acts. Now, put all your map names on that file. In a list. Not a row.
Done? Save that.
Now, we need to create these folders:

maps
resource
cfg
media
scripts
scenes

Done?
Now, let's go to \portal2\scripts. Now, go find game_sounds_manifest in that folder and copy and paste it into \steamapps\sourcemods\scripts
Now don't open that txt file. You can if you want, but don't change anything.
So, now, restart steam and go to your library, then open up your mod! Now, when you get to the main menu you might think that absolutely nothing has changed. Except the mod name. But you'll see some BIG changes later on. Congratulations if the mod shows up in your steam library!
Continue on to Part 3!

How to make a Portal 2 Mod - Part 1: Applications you need

HaloFromSteam Blog

Welcome test subject to Aperture Science!
Here are the applications you need to start testing:

Applications:
Portal 2, of course
GIMP (GNU Image Manipulation Program)
VTF Plugin for GIMP
vpk.exe (To make the pak01_dir that you will need later on into a .vpk file)
VTFEdit (On Setup, tick both boxes for it to associate with both .vmf and .vtf files)
GCFScape (To open up .vpk files)
RAD Video Tools (To make a image/video into a .bik video file so the mod can read it and it will show up on main menu)
Any Text Editor (I use Notepad++)
Any File Explorer (Just use Windows Explorer XD)
And... Let's see... That's actually it for now. Let's continue onto Part 2 now.
(Making your mod playable)