Challenge maps in Portal 2?
If we could create the right *.bms files (or whatever the equivalent is in P2) so that we could launch specific Portal 2 single-player maps and start the player at the correct position, I think we could "create" some fairly interesting challenges.
There's some pretty major open questions though:
1) Does Portal 2 even support any kind of challenge? I mean does the engine actually support doing a timed run, a least portals run and/or a least steps run? We can't really know yet, since the game obviously didn't ship with any, but I find it likely that they'd have the functionality in there somewhere.
2) Is it possible to modify player spawn position outside a .bsp? I'm thinking some of the mappers here should be able to answer that. If not many of the single-player chambers that would otherwise work might not be that good since a lot contain too much fluff around the actual puzzle bit.
I'm gonna spend some time over easter trying to see if I can peek into the inner workings of P2 and see what can be found. Now if only it had installed it next to Portal 1 so I knew where to look 
And look what I found in portal 2/portal2/scripts/bonus_maps_manifest.txt:
bonus_maps_manifest
{
"dir" "scripts/advanced_chambers"
"dir" "scripts/challenges"
"search" "maps" [$WIN32]
"map" "scripts/challenges/challenges.bns" [$GAMECONSOLE]
"map" "scripts/advanced_chambers/advanced_chambers.bns" [$GAMECONSOLE]
}
I'd say that is pretty promising 
Hm, wonder if these will be way too big:
This makes me wish for a BBCode to include an image, but scaled down :S
BTW that was done by editing portal2/scripts/extras.txt:
"Extras"
{
...snip...
"twp"
{
"title" "TWP"
"subtitle" "www.thinking.withportals.com"
"pic" "vgui/extras/attract_panels"
"url" "http://www.thinking.withportals.com/"
}
}
Aha, extras.txt can also be used to launch maps, so this might be a way to trigger directly the maps that could do with some bns love:
"Extras"
{
...snip...
"trustflings"
{
"title" "Trust Flings"
"subtitle" "Chamber 06 - Advanced Aerial Faith Plates"
"map" "sp_a2_trust_fling"
}
}
(# being a number between 1 and 3)
hanging_rope wrote:
I can't do it right now, but have you tried typing "sv_bonus_challenge #" into the console?
(# being a number between 1 and 3)
I have not, I'll get right on that. Do I have to have a map already loaded? Or does it apply to subsequent map loads?
(Right now I'm compiling a list of test chamber #XX -> map filename since that's less than obvious from the map names this time round.)
||Chapter 1: The Courtesy Call
sp_a1_intro1: game start, meet wheatley, container ride, and Chamber 00/19 in disprepair
sp_a1_intro2: Chamber 01/19 redesigned and in disrepair
sp_a1_intro3: Chamber 02/19 in shambles and drop to underground with gun
sp_a1_intro4: Chmbaer 03/19 (chamber sign broken) in disrepair and Chamber 04/19 in disprepair
sp_a1_intro5: Chamber 05/19 new design in disrepair
sp_a1_intro6: Chamber 06/19 new design in disrepair
sp_a1_intro7: Chamber 07/19 new design, in shambles and open unto Chamber 08/19 new design and in shambles, meetup with wheatley, bts
sp_a1_wakeup: bts, dead glados, waky waky glados
sp_a2_intro: drop down to incinerator room, work back through Chamber 19/19
Chapter 2: The Cold Boot
sp_a2_laser_intro: Chamber 01/22 laser1
sp_a2_laser_stairs: Chamber 02/22 discouragement redirection cubes
sp_a2_dual_lasers: Chamber 03/22 double lasers
sp_a2_laser_over_goo: Chamber 04/22 laser over water, moving platform
sp_a2_catapult_intro: Chamber 05/22 aerial faith plate intro
sp_a2_trust_fling: Chamber 06/22 advanced aerial faith plates
sp_a2_pit_flings: Chamber 07/22 companion cube refizzle, no emancipation field
sp_a2_fizzler_intro: Chamber 08/22 lasers and emancipation field
Chapter 3: The Return
sp_a2_sphere_peek: Chamber 09/22 broken aerial faith plate, wheatley teaser, ceiling afp fling x 3 and lasers
sp_a2_ricochet: Chamber 10/22 afp x 3 with cube and drc
sp_a2_bridge_intro: Chamber 11/22 hard light bridge
sp_a2_bridge_the_gap: Chamber 12/22 wheatley and bird, easier hlb -.-
sp_a2_turret_intro: Chamber 13/22 turrets, drop bts,
sp_a2_laser_relays: bts up into Chamber 14/22 laser relay triggers (x3)
sp_a2_turret_blocker: Chamber 15/22 using hlb as a blocker
sp_a2_laser_vs_turret: Chamber 16/22 using drc to kill turrets
sp_a2_pull_the_rug: Chamber 17/22 laser + hlb cube drop
Chapter 4: The Surprise
sp_a2_column_blocker: surprise into Chamber 18/22 vertical hlb, drc, turret and 4 x laser relays, wheatley outro
sp_a2_laser_chaining: Chamber 19/22 afp ceiling fling x N, 3 x drc, turret kill
sp_a2_triple_laser: Chamber 20/22 clean look, triple laser receiver
sp_a2_bts1: Chamber 21/22 interrupted, wheatley escape (also fake last test)
sp_a2_bts2: wheatley escape part 2, turrets, smashings
Chapter 5: The Escape
sp_a2_bts3: darkness, factory
sp_a2_bts4: more factory, turret testing, daycare, bring your daughter to work, potatoes
sp_a2_bts5: neurotoxin facility
sp_a2_bts6: tube ride
sp_a2_core: GLaDOS trap, core transfer, evil wheatley pounding
Chapter 6: The Fall
sp_a3_00: the fall
sp_a3_01: rock bottom, condemned, big ass seal door
sp_a3_03: 1950'ies aperture, cave johnson intro, pump station alpha
sp_a3_jump_intro: 1953 Chamber 01 blue gel intro, 1953 Chamber 02 more blue gel
sp_a3_bomb_flings: broken entrance, 1957 Chamber 02, blue gel spray
sp_a3_crazy_box: 1958 Chamber 27, blue gel and water, into blue gel wall from fling, into 1958 Chamber 28 blue gel box
sp_a3_transition01: 1950'ies complete, into 1971 pump station beta, 1970'ies intro, PotatOS
Chapter 7: The Reunion
sp_a3_speed_ramp: 1972 Chamber 01, red gel intro, portrait of a lady, 1972/02 red gel + blue gel fling
sp_a3_speed_flings: 1976/06 more red gel + blue gel flingage
sp_a3_portal_intro: 1978 exit to 1982 pump station gamma (white gel intro) to 1980'ies intro
sp_a3_portal_intro: (huh again?) 1982/?? (unnumbered) white gel bonanza, into 1982 exit, up elevator shaft
sp_a3_end: up through bts industrial (not elevator shaft though), misc goo puzzles to hatch override
Chapter 8: The Itch
sp_a4_intro: wheatley chamber 00 into 01/01 (x2)
sp_a4_tb_intro: wheatley chamber 01/19, funnel cube ceiling button
sp_a4_tb_trust_drop: wheatley chamber 02/19, funnel funnel funnel cube ceiling button again
sp_a4_tb_wall_button: wheatley chamber 03/19, funnel wall button
sp_a4_tb_polarity: whealtey chamber 04/19, reversable funnels
sp_a4_tb_catch:wheatley chamber 05/19, faith plate + funnel, fling self + cube
sp_a4_stop_the_box: wheatley chamber 06/19, vertical hlb, faith plate fling, cube grab, turrets
sp_a4_laser_catapult: wheatley chamber 11/19, funnel, lasers, faith plate flings, drc + cube, ceiling button, remote lifts
sp_a4_laser_platform: wheatley chamber 12/19, laser remoted platform, bts exit
sp_a4_speed_tb_catch: wheatley chamber 15/19, funnel catch cube, funnel speed goo
sp_a4_jump_polarity: wheatley chamber 16/19, reversable funnel blue goo, turrets, funnel fling bounce
Chapter 9: The Part Where...
sp_a4_finale1: wheatley chamber 17/19 but surprise trap
sp_a4_finale2: bts, wheatley chamber 75/19 (broken turrets), misc semi-puzzles
sp_a4_finale3: more bts puzzles
sp_a4_finale4: boss battle, moon, outro, turret opera and credits||
hanging_rope wrote:
It only does it if you type it in then load the map.
I tried it on chamber 06/22 (sp_a2_trust_fling) but it looks like it resets it to zero when it loads the map. I tried creating an sp_a2_trust_fling.bns as well, but this didn't change anything. Hrmpf.
Player1 wrote:
For reference:
...snip...
Arg lol. I just found portal2/scripts/vscripts/transitions/sp_transition_list.nut which contains all the level names in the correct sequence >.<
Well I got to play Portal 2 again so it's not all bad I guess 
I found some promising UI code in portal2/scripts/vguiedit/ in LUA. But it looks very unfinished and doesn't correspond well with the actual in-game menus.
In the VPK's I found lots of UI setup (in .res files) including what I think is actually the used UI. There's even a bonusmappanel.res and a bonusmapsdialog.res. But I can't see any actual code here, so I'm fearing that it's actually compiled into the client :S
I was hoping for an easy way to create a new menu similar to the extras menu to at least put shortcuts to the relevant "challenge" maps in, but I can't see how right now.
And it's 8am now so fatigue is also slowing my processing down 
"sp_a2_laser_intro"
{
"title" "Test 01/22"
"subtitle" "Laser"
"map" "sp_a2_laser_intro"
}
"sp_a2_laser_stairs"
{
"title" "Test 02/22"
"subtitle" "Discouragement Redirection Cube"
"map" "sp_a2_laser_stairs"
}
"sp_a2_dual_lasers"
{
"title" "Test 03/22"
"subtitle" "Dual Lasers"
"map" "sp_a2_dual_lasers"
}
"sp_a2_laser_over_goo"
{
"title" "Test 04/22"
"subtitle" "Laser Over Goo"
"map" "sp_a2_laser_over_goo"
}
"sp_a2_catapult_intro"
{
"title" "Test 05/22"
"subtitle" "Aerial Faith Plates"
"map" "sp_a2_catapult_intro"
}
"sp_a2_trust_fling"
{
"title" "Test 06/22"
"subtitle" "Advanced Aerial Faith Plates"
"map" "sp_a2_trust_fling"
}
"sp_a2_pit_flings"
{
"title" "Test 07/22"
"subtitle" "Pit Flings"
"map" "sp_a2_pit_flings"
}
"sp_a2_fizzler_intro"
{
"title" "Test 08/22"
"subtitle" "Lasers And Emancipation Fields"
"map" "sp_a2_fizzler_intro"
}
"sp_a2_sphere_peek"
{
"title" "Test 09/22"
"subtitle" "The Broken Aerial Faith Plate"
"map" "sp_a2_sphere_peek"
}
"sp_a2_ricochet"
{
"title" "Test 10/22"
"subtitle" "Ricochet"
"map" "sp_a2_ricochet"
}
"sp_a2_bridge_intro"
{
"title" "Test 11/22"
"subtitle" "Hard Light Bridge"
"map" "sp_a2_bridge_intro"
}
"sp_a2_bridge_the_gap"
{
"title" "Test 12/22"
"subtitle" "Bridge the Gap"
"map" "sp_a2_bridge_the_gap"
}
"sp_a2_turret_intro"
{
"title" "Test 13/22"
"subtitle" "Turrets"
"map" "sp_a2_turret_intro"
}
"sp_a2_laser_relays"
{
"title" "Test 14/22"
"subtitle" "Laser Relays"
"map" "sp_a2_laser_relays"
}
"sp_a2_turret_blocker"
{
"title" "Test 15/22"
"subtitle" "Turret Blocker"
"map" "sp_a2_turret_blocker"
}
"sp_a2_laser_vs_turret"
{
"title" "Test 16/22"
"subtitle" "Laser vs Turret"
"map" "sp_a2_laser_vs_turret"
}
"sp_a2_pull_the_rug"
{
"title" "Test 17/22"
"subtitle" "Pull the Rug"
"map" "sp_a2_pull_the_rug"
}
"sp_a2_column_blocker"
{
"title" "Test 18/22"
"subtitle" "Column Blocker"
"map" "sp_a2_column_blocker"
}
"sp_a2_laser_chaining"
{
"title" "Test 19/22"
"subtitle" "Laser Chaining"
"map" "sp_a2_laser_chaining"
}
"sp_a2_triple_laser"
{
"title" "Test 20/22"
"subtitle" "Triple Lasers"
"map" "sp_a2_triple_laser"
}
"sp_a3_jump_intro"
{
"title" "1953/01+02"
"subtitle" "Repulsion Gel"
"map" "sp_a3_jump_intro"
}
"sp_a3_bomb_flings"
{
"title" "1957/02"
"subtitle" "Bomb Flings"
"map" "sp_a3_bomb_flings"
}
"sp_a3_crazy_box"
{
"title" "1958/27+28"
"subtitle" "Crazy Box"
"map" "sp_a3_crazy_box"
}
"sp_a3_speed_ramp"
{
"title" "1972/01+02"
"subtitle" "Propulsion Gel Ramp"
"map" "sp_a3_speed_ramp"
}
"sp_a3_speed_flings"
{
"title" "1976/06"
"subtitle" "Propulsion Gel Fling"
"map" "sp_a3_speed_flings"
}
"sp_a3_portal_intro"
{
"title" "1982"
"subtitle" "Conversion Gel"
"map" "sp_a3_portal_intro"
}
"sp_a4_tb_intro"
{
"title" "Wheatley 01/19"
"subtitle" "Excursion Funnel"
"map" "sp_a4_tb_intro"
}
"sp_a4_tb_trust_drop"
{
"title" "Wheatley 02/19"
"subtitle" "Trust Drop"
"map" "sp_a4_tb_trust_drop"
}
"sp_a4_tb_wall_button"
{
"title" "Wheatley 03/19"
"subtitle" "Wall Button"
"map" "sp_a4_tb_wall_button"
}
"sp_a4_tb_polarity"
{
"title" "Wheatley 04/19"
"subtitle" "Polarity"
"map" "sp_a4_tb_polarity"
}
"sp_a4_tb_catch"
{
"title" "Wheatley 05/19"
"subtitle" "Catch"
"map" "sp_a4_tb_catch"
}
"sp_a4_stop_the_box"
{
"title" "Wheatley 06/19"
"subtitle" "Stop the Box"
"map" "sp_a4_stop_the_box"
}
"sp_a4_laser_catapult"
{
"title" "Wheatley 11/19"
"subtitle" "Laser Aerial Faith Plate"
"map" "sp_a4_laser_catapult"
}
"sp_a4_laser_platform"
{
"title" "Wheatley 12/19"
"subtitle" "Laser Platform"
"map" "sp_a4_laser_platform"
}
"sp_a4_speed_tb_catch"
{
"title" "Wheatley 15/19"
"subtitle" "Propulsion Funnel Catch"
"map" "sp_a4_speed_tb_catch"
}
"sp_a4_jump_polarity"
{
"title" "Wheatley 16/19"
"subtitle" "Repulsion Polarity"
"map" "sp_a4_jump_polarity"
}
Just paste that in somewhere in portal2/scripts/extras.txt with a normal text editor, eg. notepad. (I put mine in the top.) This gets you a quick way to start a specific test chamber.
It's a shame there is no modular way of editing extras.txt, meaning map makers could release a custom extra file that adds their map to the extras list.
Beer-Me wrote:
It's a shame there is no modular way of editing extras.txt, meaning map makers could release a custom extra file that adds their map to the extras list.
I'm willing to create a program that makes the editing of extras.txt file easy. The program would open the extras.txt file and add a new section in the end of it. It is going to have a settings.ini file in which the portal 2 path, default title & subtitle & map file name are stored. I'm also going to make it to automatically recognize the map files in the folder where the program is.
I'm going to start working on the program today. I'll update my progress to this topic.
Sorry for my bad english, I'm from Finland.
Haapavuo wrote:
I'm going to start working on the program today. I'll update my progress to this topic.
I think this is a bit premature. We should at least wait until either 1) the SDK is out, and only proceed if there's no proper way to package bonus maps, or 2) we reach a critical mass of custom maps and still do not have an SDK.
Imo wait a month or so at least. Packaging maps with an executable is also problematic imo and should not be done unless we have no other way to do it.
Modding the menus sounds very interesting to me. If you need somekind of modding tools later, I'm eager to help by making some.
EDIT: Ok, here is the program: post28934.html#p28934
Haapavuo wrote:
Beer-Me wrote:It's a shame there is no modular way of editing extras.txt, meaning map makers could release a custom extra file that adds their map to the extras list.
I'm willing to create a program that makes the editing of extras.txt file easy. The program would open the extras.txt file and add a new section in the end of it. It is going to have a settings.ini file in which the portal 2 path, default title & subtitle & map file name are stored. I'm also going to make it to automatically recognize the map files in the folder where the program is.
I'm going to start working on the program today. I'll update my progress to this topic.
Sorry for my bad english, I'm from Finland.
Personally thats not how I would do it, doesn't seem modular enough.
I would make your app read a folder called "Extras", any .txt file inside that, your app will automatically read, and then amend onto the extras.txt and then simply output the file to the main directory.
That way map makers can simple add a custom text file to the release that has any title, and will be read from your app.
If you need any help, give me a shout Haapavuo, what language are you thinking of developing it in, C#, C++?