Proper Chapter Menus and Titles?

Avatar
DigitalMan
17 Posts
Posted Jan 19, 2012
I've been working on my Portal 2 mod for a while and I thought it was about time I get proper menus. The problem is, I want to do this like how Valve does theirs. I would prefer not to do a workaround using the "Extras" tab and such as a Chapter selection. May any of you people here help me out? Another problem I have is that my mod doesn't seem to like reading the portal2_english file. Any and all help is appreciated. Thanks in advance.
Advertisement
Registered users don’t see ads! Register now!
Avatar
Robdon
204 Posts
Posted Jan 19, 2012
Replied 42 minutes later
Hi,

Dont think anyone has managed to get it working properly without using the Extras menu.

I tried it a while back.

It seems that for some reason it was not reading the cfg/chapter1.cfg file, which I believe is used by other source games to control chapter selection from the 'Single Player' menu option.

I played around with it for a while, but I could not get it to start up my map, whatever I did. :sad:

Rob.

Avatar
Vordwann
767 Posts
Posted Jan 19, 2012
Replied 3 hours later

http://www.se51.net/2011/09/15/how-to-m ... tal-2-mod/

Avatar
Robdon
204 Posts
Posted Jan 19, 2012
Replied 12 minutes later

Vordwann wrote:
http://www.se51.net/2011/09/15/how-to-make-your-own-portal-2-mod/

Hi,

Thats for just changing the 'Extra' menu though isnt it?

It doesnt give you the ability to have 'save' and 'load' your saves, and doesnt use the 'Single Player' option...

Rob.

Avatar
Lpfreaky90
2,842 Posts
Posted Jan 19, 2012
Replied 1 hour later
yes that's only hack for the extra's menu.
at this point I've heard no one being able to change the singeplayer menu. It SEEMS to be hard coded in the game =(
Avatar
DigitalMan
17 Posts
Posted Jan 19, 2012
Replied 9 hours later
That was the same tutorial I followed originally. I finally found out why the portal2_<lang>.txt files weren't working though and have fixed them. The chapter titles displayed, but the buttons didn't work (as I expected since the file is just filled with text to display). Too bad, as lpfreaky90 said, the chapter buttons themselves seem to be hard coded. Perhaps Valve will add a "Make a Mod" option to the Authoring Tools that will allow us to easily edit these in the next Portal 2 update (although, that could just be wishful thinking).
Avatar
Robdon
204 Posts
Posted Jan 19, 2012
Replied 10 minutes later
Had another play with it tonight.

It seems that it gets some problem when its loading up the bsp.

Even though you cant specify the map name, if you just use the same menus as the main game, when you click on chapter 1 it starts to try to load 'sp_a1_intro1.bsp' (if you put that in your mods maps dir) but then it just sits there not doing much.

I've tried to find if it was getting errors or something but nothing comes up in the console (inc developer 3 set) and even looking with 'process monitor' software, it just seems to read the 'bsp' file and then just stop.

Either we are missing some other setting, or it just doesnt work outside the standard portal2 dir :sad:

Ah well...

Avatar
angelsl
34 Posts
Posted Jan 20, 2012
Replied 13 hours later
I attached a debugger into Portal 2's client.dll.

The map names of all official maps are hardcoded into it. That could mean anything, but I'm guessing it means the chapter buttons are hardcoded.

I did a string search for the map names of each chapter's first map (e.g. sp_a1_intro1) and it seems like there is no where that defines that that button would load that map.

So yeah.

Avatar
Spam Nugget
492 Posts
Posted Jan 20, 2012
Replied 22 minutes later
What if you renamed your maps in your mod to the name of the ones in the original game?
Avatar
Robdon
204 Posts
Posted Jan 20, 2012
Replied 3 minutes later
Nah, renaming doesn't help.

Even though the names are hard coded, it doesn't start the maps correctly, just seems to 'loop' waiting for something when you start the chapter.

Even if you use the original maps.

Rob.

Avatar
DigitalMan
17 Posts
Posted Jan 21, 2012
Replied 21 hours later
Is there even a point to the chapter cfg files? It doesn't look like it since they only go up to Chapter 6 (at least for me) and there are more than 6 chapters in the game of Portal 2. It also seems odd that Valve (might have) hard coded the chapters into a dll file instead of maybe into a vpk file, but that's just me.
Avatar
angelsl
34 Posts
Posted Jan 21, 2012
Replied 28 minutes later

DigitalMan wrote:
Is there even a point to the chapter cfg files? It doesn't look like it since they only go up to Chapter 6 (at least for me) and there are more than 6 chapters in the game of Portal 2. It also seems odd that Valve (might have) hard coded the chapters into a dll file instead of maybe into a vpk file, but that's just me.

I think they're a remnant of early Portal 2 development. Other Source games all use them, only Portal 2 and (I think) L4D2 doesn't.

Portal 2 doesn't use the standard chapter select screen/dialog we see like in Portal 1 and HL2..

Avatar
DigitalMan
17 Posts
Posted Jan 21, 2012
Replied 7 hours later
I decided to try to see what would happen with the challenge mode in my mod. If I try to go into one of the official maps, it does the same thing as it does when you try to start a chapter. If I try to connect to one of my maps by putting it in the txt file, it just puts me back on the main menu with a dialogue box that says that the requested test chamber is unavailable. I doubt this information is useful, but you never know.
Avatar
andyb
257 Posts
Posted Jan 21, 2012
Replied 14 minutes later
I think its possible to make a mod work just like portal 2 does but alot of editing would need to be done to portals main res files and a few other files to change paths etc then redone into your own pak vpk.No idea of all the files but i've been slowly going through them when I have time.
Avatar
angelsl
34 Posts
Posted Jan 21, 2012
Replied 44 minutes later

andyb wrote:
I think its possible to make a mod work just like portal 2 does but alot of editing would need to be done to portals main res files and a few other files to change paths etc then redone into your own pak vpk.No idea of all the files but i've been slowly going through them when I have time.

Thing is, the chapter select menu is hardcoded into the game. If they were in the res files we'd have found them by now.

Everything else is doable of course. We just can't use the New Game/Challenge Mode menus. :/

Avatar
262LetsPlay
51 Posts
Posted Jan 22, 2012
Replied 17 hours later
I found a "singleplayer.res" in "resource/ui/basemodui" It is the SP-menu. But changes in there do not affect the game.
Avatar
KennKong
942 Posts
Posted Feb 08, 2012
Replied 17 days later

DigitalMan wrote:
Another problem I have is that my mod doesn't seem to like reading the portal2_english file.

You need to copy the portal2_english.txt to your mod, renamed as _english.txt, where is the folder name of the mod in sourcemods. You could also not be anglocentric and copy and rename all the other language files, too.

Avatar
FelipeCaners
23 Posts
Posted Feb 27, 2013
Replied 1 year later
I'm also trying to make a mod and need to start my maps in the chapter selection screen. By entering the command developer 3 in the console, I get this when I try to load a custom map from there:

Created CMatchSessionOfflineCustom:
&nbsp; settings {
&nbsp; &nbsp; system {
&nbsp; &nbsp; &nbsp; network offline
&nbsp; &nbsp; &nbsp; access public
&nbsp; &nbsp; }
&nbsp; &nbsp; game {
&nbsp; &nbsp; &nbsp; mode sp
&nbsp; &nbsp; &nbsp; map sp_a1_intro1
&nbsp; &nbsp; }
&nbsp; &nbsp; options {
&nbsp; &nbsp; &nbsp; action create
&nbsp; &nbsp; }
&nbsp; }
InitializeDlcMachineSettings: [mask:0x6]
CMatchSessionOfflineCustom::InitializeGameSettings adjusted settings:
&nbsp; settings {
&nbsp; &nbsp; system {
&nbsp; &nbsp; &nbsp; network offline
&nbsp; &nbsp; &nbsp; access public
&nbsp; &nbsp; }
&nbsp; &nbsp; game {
&nbsp; &nbsp; &nbsp; mode sp
&nbsp; &nbsp; &nbsp; map sp_a1_intro1
&nbsp; &nbsp; &nbsp; mp_coop_start int( 1 = 0x1 )
&nbsp; &nbsp; &nbsp; state lobby
&nbsp; &nbsp; &nbsp; dlcrequired u64( 0 = 0x0 )
&nbsp; &nbsp; }
&nbsp; &nbsp; options {
&nbsp; &nbsp; &nbsp; action create
&nbsp; &nbsp; &nbsp; server listen
&nbsp; &nbsp; }
&nbsp; &nbsp; members {
&nbsp; &nbsp; &nbsp; numMachines int( 1 = 0x1 )
&nbsp; &nbsp; &nbsp; numPlayers int( 1 = 0x1 )
&nbsp; &nbsp; &nbsp; numSlots int( 1 = 0x1 )
&nbsp; &nbsp; &nbsp; machine0 {
&nbsp; &nbsp; &nbsp; &nbsp; id u64( 76561198041187132 = 0x110000104D2C33C )
&nbsp; &nbsp; &nbsp; &nbsp; flags u64( 0 = 0x0 )
&nbsp; &nbsp; &nbsp; &nbsp; numPlayers int( 1 = 0x1 )
&nbsp; &nbsp; &nbsp; &nbsp; dlcmask u64( 6 = 0x6 )
&nbsp; &nbsp; &nbsp; &nbsp; tuver 20110805
&nbsp; &nbsp; &nbsp; &nbsp; ping int( 0 = 0x0 )
&nbsp; &nbsp; &nbsp; &nbsp; player0 {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xuid u64( 76561198041187132 = 0x110000104D2C33C )
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name FelipeCaners
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; game {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mp_coop_start int( 1 = 0x1 )
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; }
&nbsp; }
SignalXWriteOpportunity(2)

It looks like a default Portal 2 script, although I'm not sure. Since Portal 2 has a lot of scripts to handle a lot of things (as I found out modding the game), this bit of code could belong to some script.

Has someone figured out how to load custom maps from the chapter selection screen?

Avatar
josepezdj
2,386 Posts
Posted Feb 28, 2013
Replied 5 hours later
Felipe, that part of the menu is hard-coded and it always returns errors... are you aware that there's a workaround to use the menu and introduce custom chapters names by using the 'Extras' part of the main menu? I guess you do, but in the case you don't, check here
Advertisement
Registered users don’t see ads! Register now!
Avatar
FelipeCaners
23 Posts
Posted Feb 28, 2013
Replied 1 hour later
Yes, I already knew about the workaround. I will try looking for anything in the script files, but if it's really hard-coded, I will use the "Extras" menu.