Map names and startup behavior

Avatar
KennKong
942 Posts
Posted Oct 24, 2011
OmniCoder and I have been having a private discussion about how the wonderful map Edifice behaves differently at startup depending on what you name the map file.

What I have discovered is that the game (with DLC 1 as of this post) starts maps differently depending on the map filename.

  1. For all maps started with the map command, the game runs scripts\vscripts\transitions\sp_elevator_motifs.nut, which just sets the elevator starting speed.

  2. If a map filename starts with "sp_", the game will run scripts\vscripts\transitions\sp_transition_list.nut. If the filename isn't in the script, your level will start with a potato gun. If your filename doesn't begin with "sp_", the map must equip the player with whatever gun you want, or it will start without a portalgun.

  3. For those who do split-screen coop, any map filename containing "mp_coop_" should start properly with the ss_map command. Without it, you get the "Server Full" error. If the name doesn't contain "mp_coop_", you must start another level that does using ss_map, and then changelevel to the right map.

As discussed more authoritatively elsewhere in this forum and on VDC, if you create a custom series of maps, you should hardcode the transitions into the maps, or use your own transition script, and don't start your single player map filenames with "sp_". Similarly, you should include "mp_coop_" in any multiplayer levels, to be nice to those who split-screen coop.

EDIT 10/25/2011 Behavior of loading screens courtesy of reepblue.

The game loads custom screens for maps named starting with "sp_a[1-5]".
The images used for sp_a[1-4] are found in the portal2\pak01_dir.vpk in the materials\vgui\loading_screens directory. I do not know where the "starfield" used for sp_a5 comes from.
The images may be overridden by files with the same name in a custom mod's pak01_dir.vpk. Putting them directly into the mods file heirarchy doesn't work (apparently, .vpks take precedence?) reepblue says that custom loading images with different filenames works in the file heirarchy (i.e. outside of pak01_dir.vpk), but I haven't been able to confirm that (and there are so many things I could be doing wrong!)
I couldn't make other numbers work (e.g. sp_a6 using images named "loadingscreen_a6_*").
Only the first digit counts. Howeer, reepblue says this works in his ALH series, and who are you gonna believe? I will investigate further.

This behavior is not script driven in any way that I can find; it may be compiled into the game.

I have not investigated the behavior of the coop loading screens.

I will monitor this thread and edit this post with additional wisdom and corrections that others have to share.

Advertisement
Registered users don’t see ads! Register now!
Avatar
spongylover123
944 Posts
Posted Oct 24, 2011
Replied 7 hours later
I learned from reepblue that portal 2 and hammer will always check the newest folder added to their directory.
If you have problems building cubemaps and loading vpks.
C:\Program Files\Steam\steamapps\common or username (common= bought from retail) (username= bought online)\portal2\update\maps or addons

I also suggest you should go to hammer directory text file in the bin file, and change the place to copy maps directory (portal2) to (update) saves more time building cubemaps

Avatar
KennKong
942 Posts
Posted Oct 25, 2011
Replied 17 hours later
The method I have chosen is to create my own mods in steamapps\sourcemods. When starting those mods, the search paths created by the game will always put those first, no matter how many updates to the original game are done. I have one mod to hold single player maps, and another to hold multiplayer maps. Any changes I make to the files in these mods will have no effect on the game started as Portal 2.

I originally did this when I thought the addons functionality was completely broken. If what you say about putting .vpks in the update\addons folder is correct, then putting an addons folder in my mods should work too. I will test this, and report the results.

EDIT 10/25/2011: I used Portal Raider Toxic b2 as my test case. I had extracted the files from its .vpk and put them in my SP mod's heirarchy, and it was working fine. I removed all those files from the heirarchy, and then put the .vpk file in my mod's new addons folder, and it worked fine when I started the mod. I moved the addons directory to the portal 2\update folder, started Portal 2, and it didn't find the map. I then moved the addons folder to portal 2\portal2_dlc1, and it still didn't find the map. So the addons functionality still works in my mod, but doesn't work in Portal 2 natively.

One thing I do know is that using your own mods doesn't change the behavior of the game as regards to which startup files it reads depending on the map filename. It only changes the order of the search paths used to find those startup files.

Avatar
spongylover123
944 Posts
Posted Oct 25, 2011
Replied 4 hours later

KennKong wrote:
The method I have chosen is to create my own mods in steamapps\sourcemods. When starting those mods, the search paths creted by the game will always put those first, no matter how many updates to the original game are done. I have one mod to hold single player maps, and another to hold multiplayer maps. Any changes I make to the files in these mods will have no effect on the game started as Portal 2.

I originally did this when I thought the addons functionality was completely broken. If what you say about putting .vpks in the update\addons folder is correct, then putting an addons folder in my mods should work too. I will test this, and report the results.

EDIT 10/25/2011: I used Portal Raider Toxic b2 as my test case. I had extracted the files from its .vpk and put them in my SP mod's heirarchy, and it was working fine. I removed all those files from the heirarchy, and then put the .vpk file in my mod's new addons folder, and it worked fine when I started the mod. I moved the addons directory to the portal 2\update folder, started Portal 2, and it didn't find the map. I then moved the addons folder to portal 2\portal2_dlc1, and it still didn't find the map. So the addons functionality still works in my mod, but doesn't work in Portal 2 natively.

One thing I do know is that using your own mods doesn't change the behavior of the game as regards to which startup files it reads depending on the map filename. It only changes the order of the search paths used to find those startup files.

Not the folder portal2_dlc1 put it inn the folder labeled "update".

Avatar
KennKong
942 Posts
Posted Oct 25, 2011
Replied 45 minutes later

KennKong wrote:
I moved the addons directory to the portal 2\update folder, started Portal 2, and it didn't find the map.

spongylover123 wrote:
[Not the folder portal2_dlc1 put it inn the folder labeled "update".

I did that, as I said. However, I will re-test the update folder.

Edit 10/26/2011: Re-test of update folder failed
To be completely explicit: I created the folder
C:\Program Files (x86)\Steam\steamapps\common\portal 2\update\addons
I put the file retrospective.vpk in it, and started Portal 2. The map was not found.
I put the same file in the addons folder of my mod, started it, and it played the map.
It also failed in
C:\Program Files (x86)\Steam\steamapps\common\portal 2\portal2_dlc1\addons
and C:\Program Files (x86)\Steam\steamapps\common\portal 2\portal2\addons

Avatar
Spam Nugget
492 Posts
Posted Oct 25, 2011
Replied 1 hour later

KennKong wrote:
OmniCoder and I have been having a private discussion about how the wonderful map Edifice behaves differently at startup depending on what you name the map file.

What I have discovered is that the game (with DLC 1 as of this post) starts maps differently depending on the map filename.

  1. For all maps started with the map command, the game runs scripts\vscripts\transitions\sp_elevator_motifs.nut, which just sets the elevator starting speed.

  2. If a map filename starts with "sp_", the game will run scripts\vscripts\transitions\sp_transition_list.nut. If the filename isn't in the script, your level will start with a potato gun. If your filename doesn't begin with "sp_", the map must equip the player with whatever gun you want, or it will start without a portalgun.

  3. For those who do split-screen coop, any map filename containing "mp_coop_" should start properly with the ss_map command. Without it, you get the "Server Full" error. If the name doesn't contain "mp_coop_", you must start another level that does using ss_map, and then changelevel to the right map.

As discussed more authoritatively elsewhere in this forum and on VDC, if you create a custom series of maps, you should hardcode the transitions into the maps, or use your own transition script, and don't start your single player map filenames with "sp_". Similarly, you should include "mp_coop_" in any multiplayer levels, to be nice to those who split-screen coop.

I will monitor this thread and edit this post with additional wisdom and corrections that others have to share.

I was wondering why those damn potatos kept coming from. Thanks :thumbup:

Avatar
reepblue
894 Posts
Posted Oct 25, 2011
Replied 4 hours later
If you also give your map a number (ex: a999), you can also have custom loading screens. That is why all the ALH maps have an "sp_a329" prefix. Of course, there is so much numbers you can do before it gets ridiculous. So I would not do this unless you are releasing a series.
Avatar
Omnicoder
299 Posts
Posted Oct 25, 2011
Replied 6 hours later

spongylover123 wrote:
C:\Program Files\Steam\steamapps\common or username (common= bought from retail) (username= bought online)\portal2\update\maps or addons

Just so you know, this actually isn't how it works (although it may happen to have worked out that way for your game library.)
Username is an older location, newer games use common, regardless of where you bought them.

Avatar
ChickenMobile
2,460 Posts
Posted Oct 26, 2011
Replied 9 hours later

Omnicoder wrote:
Username is an older location, newer games use common, regardless of where you bought them.

I believe that the common folder is a better option than having a couple of accounts with all the extra game data (such as maps) stored for each user.
Small rant
People who played deathmatch would have noticed that the maps folder is very large... and doubled for the other account!The only thing I don't like is the config.

Avatar
marculaa
15 Posts
Posted Oct 30, 2011
Replied 4 days later
I still not beinggood in this. Hem, how i start with out the patato?
Avatar
spongylover123
944 Posts
Posted Oct 30, 2011
Replied 11 minutes later

marculaa wrote:
I still not beinggood in this. Hem, how i start with out the patato?

Change the sp_transition_list.nut

Avatar
KennKong
942 Posts
Posted Oct 30, 2011
Replied 3 hours later
DO NOT USE THE ATTACHED FILE IN YOUR PORTAL2 HEIRARCHY! IT WILL BREAK YOUR GAME!!!
The attached file has a .txt extension, it must be changed to .nut to work.

I created a custom mod to run my single player custom maps. I have modified the <Custom Mod Dir>\scripts\vscripts\transitions\sp_transition_list.nut file to support additional features.

  1. Allows series of maps to be added which will be played in order, returning to the menu after the last one.
  2. Controls which gun a map starts with (if the map doesn't do it itself).

When I add maps to my custom mod, I will update this file to make it start with the right portal gun if the map doesn't do it itself. I may add custom titles if the map doesn't have them (an original Valve feature). I can use this file to create series of maps, if they don't change maps themselves.

This file is provided only as an example. Use it for ideas on creating your own. Let me know if there are obvious bugs in this one, and if you have any ideas for improving it.

Attachments
sp_transition_list.txt
0.01 MB 91 downloads
Avatar
marculaa
15 Posts
Posted Nov 07, 2011
Replied 7 days later
I still dont understand. I am sorry. xD I just want to play that maps in .vpk, but with the new update, seems is not easy. Anyone have a solucion for it?
Avatar
Robdon
204 Posts
Posted Nov 07, 2011
Replied 19 minutes later

marculaa wrote:
I still dont understand. I am sorry. xD I just want to play that maps in .vpk, but with the new update, seems is not easy. Anyone have a solucion for it?

Currently, vpk files arnt working.

We've got a thread here: http://forums.thinking.withportals.com/post58046.html#p58046 where I will keep updated when Valve reply.

Rob.

Avatar
marculaa
15 Posts
Posted Nov 08, 2011
Replied 21 hours later

KennKong wrote:
DO NOT USE THE ATTACHED FILE IN YOUR PORTAL2 HEIRARCHY! IT WILL BREAK YOUR GAME!!!
The attached file has a .txt extension, it must be changed to .nut to work.

I created a custom mod to run my single player custom maps. I have modified the \scripts\vscripts\transitions\sp_transition_list.nut file to support additional features.

  1. Allows series of maps to be added which will be played in order, returning to the menu after the last one.
  2. Controls which gun a map starts with (if the map doesn't do it itself).

When I add maps to my custom mod, I will update this file to make it start with the right portal gun if the map doesn't do it itself. I may add custom titles if the map doesn't have them (an original Valve feature). I can use this file to create series of maps, if they don't change maps themselves.

This file is provided only as an example. Use it for ideas on creating your own. Let me know if there are obvious bugs in this one, and if you have any ideas for improving it.

For what i understand of that (toke 1 week to), you are talking about some kind of "mod". Ok this is all messing me up.

Avatar
Moth
225 Posts
Posted Nov 13, 2011
Replied 5 days later
This thread should be stickied imho, as I refer people to it often, from the 'mapping Help' forum.
Step 2 is a common issue, and this is very useful information in particular.
Avatar
Spam Nugget
492 Posts
Posted Nov 13, 2011
Replied 10 hours later
damn straight.
Avatar
DaMaGepy
361 Posts
Posted Nov 25, 2011
Replied 11 days later

I returned to portal2 after 5 month idling (ye, played WoW and LoL :smile: ), and I found out that a dlc came out (ye, was surprise for me, not started portal since june), and today I found out that all my maps and previously downloaded custom maps start with the potatogun. I remember these maps, they worked fine before. Don't know if its just my Portal2 or others experience this too (I even fully reinstalled portal2), but I found a temporary solution that I described here:

mapping-help/post-your-portal-2-authoring-tool-bugs-t2459-105.html
Basically after this, all old and future custom maps start as they are intended, without the annoying potato. I will also embed this .nut to my future map BSPs so if someone else playing it who experienced the same, the gun will be OK in their portal2 too.

Advertisement
Registered users don’t see ads! Register now!
Avatar
Another Bad Pun
516 Posts
Posted Nov 25, 2011
Replied 20 minutes later

DaMaGepy wrote:
I returned to portal2 after 5 month idling... :blah: Don't know if its just my Portal2 or others experience this too (I even fully reinstalled portal2), but I found a temporary solution that I described here:
mapping-help/post-your-portal-2-authoring-tool-bugs-t2459-105.html

vWizDna1XO4