Fix broken Chapter Handling by Base Game
Quote from Liam on August 22, 2012, 5:40 amI am running again into issues where my mod and the Portal 2 base game do not like each other!
In order to provide the proper menu background images and the music for each of the 5 (internal)* chapters of my mod I have included the following to override the base game:
- /media/menu_act(01 | ... | 05).bik: The background video/image which is displayed in the main menu.
- pak01_dir.vpk/materials/vgui/backgrounds: Images of the main menu background which are displayed before the bik video files are loaded and played. Usually the first frame of the video.
- pak01_dir.vpk/sound/music/mainmenu/portal2_background(01 | ... | 05).wav: Main menu background music overide with my content rather than the original.
* internal means here the division in 5 acts while having about 12 chapters ingame so the player can choose rather a chapter than a act to start with.
However I have and issue and one question concerning this one:
- Assume I play the first level of my mod, this is obviously Act 1 and Chapter 1. Now i close my mod and start playing Portal 2 - let's say we start with a new Game in Chapter 7 which is Act 3 internally. When I now change back to my mod it thinks it is already in Act 3 and therefore displays the wrong menu background and could spoiler the player etc. therefore the chapter handling of the base game influences my mod and I do not want to everybody something like "don't play Portal 2 unless you play through my mod.".
- Is there any way to fix this issue? I already tried to mess around with the sv_unlockedchapters variable but it looks like this not affect Portal 2.
A workaround would be to use only one background and the same music for all chapters but it would very neat if the menu is contextual based on the progress in the mod!
I am running again into issues where my mod and the Portal 2 base game do not like each other!
In order to provide the proper menu background images and the music for each of the 5 (internal)* chapters of my mod I have included the following to override the base game:
- /media/menu_act(01 | ... | 05).bik: The background video/image which is displayed in the main menu.
- pak01_dir.vpk/materials/vgui/backgrounds: Images of the main menu background which are displayed before the bik video files are loaded and played. Usually the first frame of the video.
- pak01_dir.vpk/sound/music/mainmenu/portal2_background(01 | ... | 05).wav: Main menu background music overide with my content rather than the original.
* internal means here the division in 5 acts while having about 12 chapters ingame so the player can choose rather a chapter than a act to start with.
However I have and issue and one question concerning this one:
- Assume I play the first level of my mod, this is obviously Act 1 and Chapter 1. Now i close my mod and start playing Portal 2 - let's say we start with a new Game in Chapter 7 which is Act 3 internally. When I now change back to my mod it thinks it is already in Act 3 and therefore displays the wrong menu background and could spoiler the player etc. therefore the chapter handling of the base game influences my mod and I do not want to everybody something like "don't play Portal 2 unless you play through my mod.".
- Is there any way to fix this issue? I already tried to mess around with the sv_unlockedchapters variable but it looks like this not affect Portal 2.
A workaround would be to use only one background and the same music for all chapters but it would very neat if the menu is contextual based on the progress in the mod!

Quote from ChickenMobile on August 22, 2012, 10:05 amInteresting... Does the menu continue to be the level chosen in Portal 2 when the map changes for example?
Honestly this isn't a very big problem, just a slight bug. 99/100 people who play your mod have already finished Portal 2 and are not likely to play a random act in Portal 2 and then get back to playing your mod. Even if they do see the menu change, they would probably not think much of it as they have just launched the mod.
If this is fixable by using some sort of console command on startup: I definitely don't know what it is.
Ideas people?
Interesting... Does the menu continue to be the level chosen in Portal 2 when the map changes for example?
Honestly this isn't a very big problem, just a slight bug. 99/100 people who play your mod have already finished Portal 2 and are not likely to play a random act in Portal 2 and then get back to playing your mod. Even if they do see the menu change, they would probably not think much of it as they have just launched the mod.
If this is fixable by using some sort of console command on startup: I definitely don't know what it is.
Ideas people?
Quote from Liam on August 22, 2012, 10:47 amHere's the deal - I have started again my mod and it shows Chapter 3 (changed the BGs to be able to distinguish and debug which chapter is selected), after running my very first map once, which is for the sake of simplicity called "sp_a1_intro1" and returning to the menu the chapter was set (and saved!) to be 1. Experimenting a bit revealed, that naming the map "sp_a4_intro1" does not change the chapter to 4. Even including "map sp_a4_intro1" in the chapter4.cfg did not help.
The point with the bug: i HATE having bugs and do not want to countenance them or find a workaround, i want to fix them. In my opinion it even sounds strange to include in a Readme etc. the notice "please do not play the base game while playing this mod, otherwise you would not have the full experience".
Moreover it is quite interesting how one could at least manipulate the current chapter besides my issues - any help is appreciated!^
EDIT:
After experimenting a bit, I figured out that it seems that the relation map <-> chapter is hardcoded into the game. Naming my map the as one of the original ones here or putting them in a separate folder and using symlinks with "original" allowed me to change the current chapter... (I don't know where this information is stored! I NEED to know it!) however that way I am restricted to either the original names AND the maximum amount of maps available. I need to find out, how to change this behaviour, otherwise I probably have to stick to having only one menu setting...
Here's the deal - I have started again my mod and it shows Chapter 3 (changed the BGs to be able to distinguish and debug which chapter is selected), after running my very first map once, which is for the sake of simplicity called "sp_a1_intro1" and returning to the menu the chapter was set (and saved!) to be 1. Experimenting a bit revealed, that naming the map "sp_a4_intro1" does not change the chapter to 4. Even including "map sp_a4_intro1" in the chapter4.cfg did not help.
The point with the bug: i HATE having bugs and do not want to countenance them or find a workaround, i want to fix them. In my opinion it even sounds strange to include in a Readme etc. the notice "please do not play the base game while playing this mod, otherwise you would not have the full experience".
Moreover it is quite interesting how one could at least manipulate the current chapter besides my issues - any help is appreciated!^
EDIT:
After experimenting a bit, I figured out that it seems that the relation map <-> chapter is hardcoded into the game. Naming my map the as one of the original ones here or putting them in a separate folder and using symlinks with "original" allowed me to change the current chapter... (I don't know where this information is stored! I NEED to know it!) however that way I am restricted to either the original names AND the maximum amount of maps available. I need to find out, how to change this behaviour, otherwise I probably have to stick to having only one menu setting...

Quote from ChickenMobile on August 22, 2012, 9:31 pmI assumed that was the case as setting the sp_a1-4 prefix decides what loading screen to use. By setting it as a6 for example, you could make your own loading screens easily.
I assume that code inside the game handles this, and not any kind of script otherwise it wouldn't change from the base mod when you launch it.
What I would suggest is try fiddling with the sp_a#'s and perhaps even create your maps with the prefixes after the main campaign. I'm not entirely sure how this would affect your main menu though when you do go into the main game BUT you could probably set the menu screen to the same image/video for each sp from 1-5 and different ones after that (6 onwards which is the start of your mod because a5 are credits).
P.S. are you using the 'extras' menu for choosing your maps / alternative for the new game menu?
I assumed that was the case as setting the sp_a1-4 prefix decides what loading screen to use. By setting it as a6 for example, you could make your own loading screens easily.
I assume that code inside the game handles this, and not any kind of script otherwise it wouldn't change from the base mod when you launch it.
What I would suggest is try fiddling with the sp_a#'s and perhaps even create your maps with the prefixes after the main campaign. I'm not entirely sure how this would affect your main menu though when you do go into the main game BUT you could probably set the menu screen to the same image/video for each sp from 1-5 and different ones after that (6 onwards which is the start of your mod because a5 are credits).
P.S. are you using the 'extras' menu for choosing your maps / alternative for the new game menu?
Quote from Liam on August 23, 2012, 5:21 amActually it's not about loadingscreen (though I can change them easily based on a# in vpk/materials/vgui/loading_screens/*) it's about the main menu itself you know.
Nevertheless trying to increase the a# number didn't do anything - except having a black loading screen but the menu itself was still chapter 1. It really looks like everything concerning that is hardcoded into the game
Oh and yes, I do use the extras menu hack, because there is no other working hack known, i think!
Actually it's not about loadingscreen (though I can change them easily based on a# in vpk/materials/vgui/loading_screens/*) it's about the main menu itself you know.
Nevertheless trying to increase the a# number didn't do anything - except having a black loading screen but the menu itself was still chapter 1. It really looks like everything concerning that is hardcoded into the game
Oh and yes, I do use the extras menu hack, because there is no other working hack known, i think!

Quote from ChickenMobile on August 23, 2012, 5:33 amHrmm.. I guess it doesn't really matter then and just deal with it unless someone else knows then.
Hrmm.. I guess it doesn't really matter then and just deal with it unless someone else knows then.
Quote from Liam on August 23, 2012, 6:22 amI have made a temporary decision that I will include only one background and one background music (although duplicating it five times is unbelievable redundant... - 7zip recognizes this and just saves it once, however the vpk packer is crappy because it doesn't handle links correct therefore it includes five times the track /firstworldproblems).
Nevertheless thanks for your help CM, I am eager to hear if anyone else has any ideas, meanhwile I am going to create some maps now
I have made a temporary decision that I will include only one background and one background music (although duplicating it five times is unbelievable redundant... - 7zip recognizes this and just saves it once, however the vpk packer is crappy because it doesn't handle links correct therefore it includes five times the track /firstworldproblems).
Nevertheless thanks for your help CM, I am eager to hear if anyone else has any ideas, meanhwile I am going to create some maps now
Quote from HMW on August 23, 2012, 5:07 pmLiam wrote:[...] meanhwile I am going to create some maps nowI can't help you with this particular problem, but I wouldn't put too much time and energy into it if I were you. 99.9% of people's gaming experience is going to be the campaign itself, so focus on that!
I was planning to make a pack out of my Sendificate maps as soon as I had finished a couple of them, and was a bit let down when the whole PTI and workshop was released, thinking that potential players would be less likely to download my map pack if it meant that they had to install it manually, while they were all used to the click & play convenience of the workshop.
Then I decided to just publish maps to the workshop as they get finished, group them into a collection, do my best to make that experience as nice as it can be and otherwise just roll with it. Yes, people can play maps out of order. Yes, you need to click one extra button at the end of each map to go to the next one. But those are only small details that don't outweigh the huge advantage of how easy it is to install maps, plus: I can publish maps as soon as they are finished instead of having to wait until the whole thing is done to release it as one package.
tl;dr: please don't make mods, release maps as you finish them!

I can't help you with this particular problem, but I wouldn't put too much time and energy into it if I were you. 99.9% of people's gaming experience is going to be the campaign itself, so focus on that!
I was planning to make a pack out of my Sendificate maps as soon as I had finished a couple of them, and was a bit let down when the whole PTI and workshop was released, thinking that potential players would be less likely to download my map pack if it meant that they had to install it manually, while they were all used to the click & play convenience of the workshop.
Then I decided to just publish maps to the workshop as they get finished, group them into a collection, do my best to make that experience as nice as it can be and otherwise just roll with it. Yes, people can play maps out of order. Yes, you need to click one extra button at the end of each map to go to the next one. But those are only small details that don't outweigh the huge advantage of how easy it is to install maps, plus: I can publish maps as soon as they are finished instead of having to wait until the whole thing is done to release it as one package.
tl;dr: please don't make mods, release maps as you finish them!
Other Portal 2 maps: Medusa Glare
Portal 1 maps: Try Anything Twice | Manic Mechanic
Quote from portal2tenacious on August 23, 2012, 5:20 pmHMW wrote:tl;dr: please don't make mods, release maps as you finish them!I beg to differ. I feel that maps released in bulk are more exciting. You never need to wait for the next map, and you can understand a mechanic all at once. I think we wouldn't have liked 12 angry tests as much if it hadn't been released in bulk. Unless you're just trying to say don't make people install it because the workshop has made them lazy. In which case I completely agree.
I beg to differ. I feel that maps released in bulk are more exciting. You never need to wait for the next map, and you can understand a mechanic all at once. I think we wouldn't have liked 12 angry tests as much if it hadn't been released in bulk. Unless you're just trying to say don't make people install it because the workshop has made them lazy. In which case I completely agree.

Quote from ChickenMobile on August 23, 2012, 10:15 pmIf it was a large mod: then yes releasing it as a mod is worth it. However also putting it on the workshop is necessary in order to Demo it to a larger audience. Even just putting the first map on the workshop as a demo and then saying with a game_text that you can download the rest of the mod through a link provided in the description is another a way to go.
HMW: are you saying that people cbf to click a button to download a mod and then extract it to one folder? Also story driven mods won't make sense if they were accidentally played out of order (I have subscribed to certain map series before on the workshop and they played out of order), plus the thumbs up menu is annoying as it will interrupt your gameplay every time you want to change to the next map.
If it was a large mod: then yes releasing it as a mod is worth it. However also putting it on the workshop is necessary in order to Demo it to a larger audience. Even just putting the first map on the workshop as a demo and then saying with a game_text that you can download the rest of the mod through a link provided in the description is another a way to go.
HMW: are you saying that people cbf to click a button to download a mod and then extract it to one folder? Also story driven mods won't make sense if they were accidentally played out of order (I have subscribed to certain map series before on the workshop and they played out of order), plus the thumbs up menu is annoying as it will interrupt your gameplay every time you want to change to the next map.