Hot Fixing broken "sourcemods" main menu's

Avatar
CosmicD
125 Posts
Posted May 17, 2012
Hello,

For you who have made your portal 2 mod using the sourcemods methods described here, you will find the main menu of your mod broken after valve updated portal 2 with the new Perpetual Testing DLC.

This is because the engine no longer looks inside the packaged filesystem for mainmenu.res , but mainmenu_new.res when trying to find it inside the resource/ui/basemod/ui folder.

I relealise people will mostly use the new workshop/puzzlemaker combo, but I invested allot in a bit of story telling, custom props and scripts for my campaign so whenever I update it I want it to update it foremost using the "sourcemods" approach.

After that I'll see if I can cram all this stuff inside workshop version of my individual core maps.

Anyway, just want to mention this for people having the same prob.

Advertisement
Registered users don’t see ads! Register now!
Avatar
Lpfreaky90
2,842 Posts
Posted May 17, 2012
Replied 2 minutes later
Yea, I found the same solution too, but thanks for sharing!
Now if there was only a way to properly modify portals' main menu...
Avatar
CosmicD
125 Posts
Posted May 17, 2012
Replied 4 minutes later
yeah, doing the main menus it's a drag. But honestly I was very relieved that hotfixing it was so simple :razz: I'm totally no programmer but I'm sure that following its structure, you could make a front-end application for it.
Avatar
ChickenMobile
2,460 Posts
Posted May 17, 2012
Replied 8 hours later
interesting... ty cosmicd
Avatar
josepezdj
2,386 Posts
Posted May 18, 2012
Replied 5 hours later
I also found that same shortcut. After I went to my mod's menu and saw that it looked like the new Portal2's menu including the "Play Community Chambers" button and such (what made me angry and worried...), I quickly went and looked into the dlc2 folder and the pak01_dir in it and found the new mainmeu_new.res file...
Avatar
CosmicD
125 Posts
Posted May 18, 2012
Replied 1 hour later
YEah I was annoyed too. WHen I saw thid bodged menu, all I could think was hard things, like when they stopped reading vpk's in the addons folder, i thought like OMG, have they stopped reading resources from sourcemods dirs ? Have they stopped reading packed dirs ? Maybe they restricted to read the main menu from any other location but the main dlc2 dir.....

But I'm glad to say I was wrong lol.

Avatar
FelixGriffin
2,680 Posts
Posted May 18, 2012
Replied 2 hours later
Wait, addons don't work anymore? When did that happen? :angrysquare:
Avatar
ChickenMobile
2,460 Posts
Posted May 18, 2012
Replied 18 minutes later
Only vpk's in the addons. This has been for months, ever since the last DLC came out.
Avatar
Lpfreaky90
2,842 Posts
Posted May 18, 2012
Replied 59 minutes later
Ever since the first DLC came out :wink:
Hopefully valve will fix this... ...eventually!
Avatar
FelixGriffin
2,680 Posts
Posted May 18, 2012
Replied 4 hours later
Well, that's awful! Is there any way to play addons like Retrospective anymore?
Avatar
ChickenMobile
2,460 Posts
Posted May 18, 2012
Replied 7 hours later

FelixGriffin wrote:
Well, that's awful! Is there any way to play addons like Retrospective anymore?

You can open the vpk and drag all the files into the necessary folders.

Avatar
CosmicD
125 Posts
Posted May 20, 2012
Replied 1 day later
yeah, it's usually ok when it's only singular maps and custom props etc. But when the author includes custom transitions and lightboards and uses the same transition file (scripts/vscripts/sp_transition_list.txt) and actually replaces the entire file with their custom stuff, your main game starts to be a bit polluted.

You actually HAVE to use sp_lightboards.txt , it's somehow hardcoded and some authors replace (and not complete the stock one so you end up screwing over your standard level test signs.

Rightnow if you want to extract stuff from a vpk, I even believe that some scripts are read from the main portal dir, (portal2) and the soundscripts or transitions (if added) are read from the most recent dlc dir. (portal2_dlc2) . You just have to test for that.

So in short I'd say, go ahead when it's only maps inside a vpk, you can just put them in the maps folder (of your main portal2 dir, not the dlc ones), materials and models can go in the respective dirs as well but anything in scripts and scripts/vscripts is tricky for the engine to not screw up the original game. Depending on what the author did with the files.

For example:
Some authors also make complete custom lightboards with the lightboard creator thats floating around here, this just gives you custom materials and models, thats still safer

All this what I said here is valid conserning the extractions of vpk's that were read from the /addons folder and you want to extract this.

Avatar
tile
380 Posts
Posted Nov 17, 2012
Replied 5 months later

it didn't work for me. i've named my mainmenu.res file mainmenu_new.res and all forms of capatol/lowercase of that, and even changed the line in mainmenu_new that says the directory. any ideas why?

also, here's the contents of it:

"Resource/UI/mainmenu_new.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"
   }
                  
   // Single player
   "BtnPlaySolo"
   {
      "ControlName"            "BaseModHybridButton"
      "fieldName"               "BtnPlaySolo"
      "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"                  "220"
      "tall"                  "20"
      "autoResize"            "1"
      "pinCorner"               "0"
      "visible"               "1"
      "enabled"               "1"
      "tabPosition"            "0"
      "navUp"                  "BtnOptions"   [$GAMECONSOLE]
      "navUp"                  "BtnEconUI"      [!$GAMECONSOLE]
      "navDown"               "BtnQuit"
      "labelText"               "#PORTAL2_MainMenu_Solo"
      "style"                  "MainMenuButton"
      "command"               "Extras"
      "ActivationType"         "1"
      "FocusDisabledBorderSize"   "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"                  "220"
      "tall"                  "20"
      "autoResize"            "1"
      "pinCorner"               "0"
      "visible"               "1"
      "enabled"               "1"
      "tabPosition"            "0"
      "navUp"                  "BtnPlaySolo"
      "navDown"               "BtnQuit"   [$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"                  "378"
      "wide"                  "220"
      "tall"                  "20"
      "autoResize"            "1"
      "pinCorner"               "0"
      "visible"               "1"
      "enabled"               "1"
      "tabPosition"            "0"
      "navUp"                  "BtnOptions"
      "navDown"               "BtnPlaySolo"
      "labelText"               "uit"
      "style"                  "MainMenuButton"
      "command"               "QuitGame"
      "ActivationType"         "1"
   }
}

Avatar
ChickenMobile
2,460 Posts
Posted Nov 17, 2012
Replied 15 minutes later
Tile,
This is an old thread from half-way through this year. Most probably that this solution is no longer valid as the GUI has been updated again since the workshop.

I would create both a mainmenu.res and a mainmenu_new.res and also go through the Portal 2 updates to see where the new 'community chambers' option is inside the mainmenu.res.

Avatar
tile
380 Posts
Posted Nov 17, 2012
Replied 1 hour later
been there, done that. and sorry for replying to an old thread.
Avatar
BenVlodgi
633 Posts
Posted Nov 18, 2012
Replied 1 hour later
you are paking this into the pak01_dir right?
steam message me BenVlodgi
Advertisement
Registered users don’t see ads! Register now!
Avatar
josepezdj
2,386 Posts
Posted Nov 20, 2012
Replied 2 days later

tile wrote:
been there, done that. and sorry for replying to an old thread.

I rechecked mine and everything is working fine. I came to the same solution than CosmicD right after the dlc update changed the menu. What I did was to copy exactly the same I had in mainmenu.res into mainmenu_new.res. Ofc, as Ben said, you have to put both into your pak01_dir.vpk file for it to work.