Portal 2 Custom Map Loader

Avatar
kyle273
10 Posts
Posted Jun 19, 2011
I made this quick tool to make it easier to load custom maps into Portal 2.

Here's the code:

echo off
cls
echo.
echo                .,-:;//;:=,
echo            . :H@@@MM@M#H/.,+%%;,
echo        ,/X+ +M@@M@MM%%=,-%%HMMM@X/,
echo      -+@MM; $M@@MH+-,;XMMMM@MMMM@+-
echo    ;@M@@M- XM@X;. -+XXXXXHHH@M@M#@/.
echo   ,%%MM@@MH ,@%%=             .---=-=:=,.
echo   =@#@@@MX.,                -%%HX$$%%%%%%:;
echo  =-./@M@M$                   .;@MMMM@MM:
echo  X@/ -$MM/       Portal 2     . +MM@@@M$
echo ,@M@H: :@:     Map Launcher   . =X#@@@@-
echo ,@@@MMX, .                    /H- ;@M@M=
echo .H@@@@M@+,                    %%MM+..%%#$.
echo  /MMMM@MMH/.                  XM@MH; =;
echo   /%%+%%$XHH@$=              , .H@@@@MX,
echo    .=--------.           -%%H.,@@@@@MX,
echo    .%%MM@@@HHHXX$$$%%+- .:$MMX =M@@MM%%.
echo      =XMMM@MM@MM#H;,-+HMM@M+ /MMMX=
echo        =%%@M@M#@$-.=$@MM@@@M; %%M%%=
echo          ,:+$+-,/H#MMMMMMM@= =,
echo                =++%%%%%%%%+/:-.
echo.
echo.

echo Enter Map Path, or Drag and Drop Map into Batch File. Press Enter to continue...
echo.

set /p map = %1
dir /b %1 > maplauncher.txt
set /p map=<maplauncher.txt


::Here is where you need to edit your own file locations in. Will be more convenient in future releases. (If there ever is any!)
IF EXIST  "C:\Program Files (x86)\Steam\steamapps\common\portal 2\portal2\maps\%map%" GOTO RUN
copy %1 /D "C:\Program Files (x86)\Steam\steamapps\common\portal 2\portal2\maps"

:RUN
::Make sure to change the path here for your own computer!
"C:\Program Files (x86)\Steam\steamapps\common\portal 2\portal2.exe" -hijack -novid  +map %map%

:END

To run:
1.Copy and paste the code into notepad
2. Change C:\Program Files (x86)\Steam\steamapps\common\portal 2\portal2.exe to your own portal 2 path
3. Change C:\Program Files (x86)\Steam\steamapps\common\portal 2\portal2\maps in the two places to your own portal 2 maps directory
4. save as ~.bat where ~ is the name you choose
5. Drag and drop a custom map file onto the batch file, and press enter to copy the map into your map directory, and start portal 2.

Hopefully this works for you guys! It is an in house tool I made for myself, so there are a few bugs.
I'm planning on making a better version, but it's still in the works.

Edit: walropodes, thanks for the awesome advice! Map launcher can now be run while portal 2 is running.

Advertisement
Registered users don't see ads! Register now!
Avatar
walropodes
39 Posts
Posted Jun 20, 2011
Replied 4 hours later
You should add the "-hijack" launch option, so you can use it to make portal 2 load a map even when it's running
Avatar
kyle273
10 Posts
Posted Jun 20, 2011
Replied 3 hours later
By God it works! Updated code in first post.
Avatar
walropodes
39 Posts
Posted Jun 20, 2011
Replied 13 hours later
Glad to be of help
Avatar
albie0803
1 Posts
Posted Jun 30, 2011
Replied 9 days later
Why? I ask, was not a custom level loader built into P2 as there was in P1
Avatar
dhavalmistry
107 Posts
Posted Jun 30, 2011
Replied 33 minutes later
maybe you can write code that can cycle the maps one after other. Its useful when playing custom coop maps.
Avatar
Hober
1,180 Posts
Posted Jun 30, 2011
Replied 2 hours later

albie0803 wrote:
Why? I ask, was not a custom level loader built into P2 as there was in P1

Because they had to choose which functionality would be completed, polished, and tested in the original release, and a feature that 10% of the PC players (say, 50% of the overall players) would use got bumped to the bottom.

I'm fairly confident they're working on it.

Avatar
MasterLagger
1,695 Posts
Posted Jun 30, 2011
Replied 28 minutes later
That code looks like half of the Aperture Science logo.
Advertisement
Registered users don't see ads! Register now!
Avatar
KenJeKenny!?
238 Posts
Posted Jun 30, 2011
Replied 1 hour later

MasterLagger wrote:
That code looks like half of the Aperture Science logo.

lol.

The code "window" has a scrollbar at the right. So your not seeing everything. It would make the posts huge so now it's nice and organized for those who wish to view it.