Please or Register to create posts and topics.

Map names and startup behavior

Page 1 of 2Next

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 scriptsvscriptstransitionssp_elevator_motifs.nut, which just sets the elevator starting speed.

2. If a map filename starts with "sp_", the game will run scriptsvscriptstransitionssp_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 portal2pak01_dir.vpk in the materialsvguiloading_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.

Expand for my full signature
[spoiler]My YouTube Channel: Please subscribe!
My Steam Workshop Check out my collections for some good maps
Basic Mod for playing .vpk files Needs to be updated for dlc2, but still works[/spoiler]

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 FilesSteamsteamappscommon or username (common= bought from retail) (username= bought online)portal2updatemaps 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

The method I have chosen is to create my own mods in steamappssourcemods. 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 updateaddons 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 2update folder, started Portal 2, and it didn't find the map. I then moved the addons folder to portal 2portal2_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.

Expand for my full signature
[spoiler]My YouTube Channel: Please subscribe!
My Steam Workshop Check out my collections for some good maps
Basic Mod for playing .vpk files Needs to be updated for dlc2, but still works[/spoiler]
KennKong wrote:
The method I have chosen is to create my own mods in steamappssourcemods. 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 updateaddons 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 2update folder, started Portal 2, and it didn't find the map. I then moved the addons folder to portal 2portal2_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".

KennKong wrote:
I moved the addons directory to the portal 2update 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)Steamsteamappscommonportal 2updateaddons
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)Steamsteamappscommonportal 2portal2_dlc1addons
and C:Program Files (x86)Steamsteamappscommonportal 2portal2addons

Expand for my full signature
[spoiler]My YouTube Channel: Please subscribe!
My Steam Workshop Check out my collections for some good maps
Basic Mod for playing .vpk files Needs to be updated for dlc2, but still works[/spoiler]
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 scriptsvscriptstransitionssp_elevator_motifs.nut, which just sets the elevator starting speed.

2. If a map filename starts with "sp_", the game will run scriptsvscriptstransitionssp_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:

Image
I think in terms of boolean variables. Generally, it makes things easier.

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.

:A Little Higher: :Tornate: :Blue Portals: :Vectronic: :Youtube: :Twitter: : ModDB: :Old Sig:

The more you give, the less appreciated it will be received.
spongylover123 wrote:
C:Program FilesSteamsteamappscommon or username (common= bought from retail) (username= bought online)portal2updatemaps 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.

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

Spoiler
Sorry, only logged-in users can see spoilers.
The only thing I don't like is the config.

?????????????????????????????TWP Releases | My Workshop

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

Page 1 of 2Next