Level Transition Problem

Avatar
tokichronos
4 Posts
Posted Mar 04, 2013
Hello,
I've posted the below on the steam forums but I've not gotten any helpful responses. Many of my attempts to find a solution to my problem have brought me back to this community, so I hope that there may be some skillful posters here.

I'm setting up a sequence of 30 maps for academic research purposes. I am using the three entities of elevator_entrance, elevator_exit, and arrival_departure_transition_ents to change levels using the elevators (all located in the /p2editor folder). All world geometry is exported from puzzlemaker to a .vmf for editing. I have followed the online guide at the valve developer community and have referenced my custom .vmf's to use a custom .nut transition list file (my elevator_motifs is similarly edited).

My levels are currently transitioning correctly in the sense that the level loads successfully. My problem now is that I am spawning in total darkness with a blue-only portalgun and falling forever (percieved by rushing wind noises).
Strangely, the transition works perfectly from the first to the second level but from that point on this error repeats, despite the entities being the same.
I've considered forcing playerspawning within the level geometry, but the last time I did that I had some very strange errors occur, such as the elevator fan and tube spawning above me and my character being forced into the brush floor (some puzzle elements broke using this method as well).

Has anyone else encountered this problem?

Advertisement
Registered users don’t see ads! Register now!
Avatar
FelixGriffin
2,680 Posts
Posted Mar 04, 2013
Replied 2 hours later
It seems that your transition script isn't working properly. Have you tried Brainstone's Hardcoded instances?
Avatar
tokichronos
4 Posts
Posted Mar 05, 2013
Replied 2 hours later
Thanks, its much easier to transition them now and I don't have any of the problems reocurring.
I do however have a new problem, in that Portal 2 is no longer recording research data with Brainstone's instances.
I am afraid that this request is even more obscure than my original request as I imagine most people don't care about the performance data for the game, but it is vital to me.

To summarize it, if you use the console command "record_research_data 1" Portal 2 will save a .csv file with that session's play data. I can only imagine that Brainstone's script has removed this functionality for fewer issues.

Avatar
TopHATTwaffle
113 Posts
Posted Mar 05, 2013
Replied 5 minutes later
The transition script works by teleporting the player to a certain area as soon as the level is spawned. If this are does NOT exist, this can happen.

The game is looking for the following entities:
@elevator_entry_teleport
@arrival_teleport
If it cannot find one, no go! But never fear! We can choose what we want to teleport to! First let's look at a transition list. Here is part from my mod.

"s_c1_cutscene_2",      
   "@Spawn_Room",      // This is where the player is teleported to upon entering s_c1_intro
"s_c1_intro",         
   "@Spawn",      // Teleport location for s_c1_intro_2
"s_c1_intro_2",         // GLaDOS's chamber
"s_c1_cutscene_3",      // Next Cutscene

You can see the levels are all prefixed with, "s_c1_" And there is a "@Spawn_Room" and "@Spawn" in the list as well. There are manual teleport points. When a level is reached the script will check, using this bit of code:

if( MapPlayOrder[index-1].find("@") == null )
            {
               printl( "Teleporting to default start pos" )
               EntFire( "@elevator_entry_teleport", "Teleport", 0, 0 )      
               EntFire( "@arrival_teleport", "Teleport", 0, 0 )               
            }

if it finds a "**@**" If it can't it tries to teleport to: @elevator_entry_teleport, or @arrival_teleport.

If it DOES find one it fires this bit of code:

   else
            {
               printl( "Trying to teleport to " + MapPlayOrder[index - 1] + "_teleport" )
               EntFire( MapPlayOrder[index - 1] + "_entry_teleport", "Teleport", 0, 0.0 )
            }

This tells it to teleport the play to an entity named XXX_entry_teleport. Where XXX is one above the map name. So in my case, "**@Spawn_Room_entry_teleport**"

So TL:DR. Add a line above your level as something, name a point_teleport that +_entry_teleport, $$$$, PROFIT!!!!

Avatar
tokichronos
4 Posts
Posted Mar 07, 2013
Replied 2 days later

TopHATTwaffle wrote:
The transition script works by teleporting the player to a certain area as soon as the level is spawned. If this are does NOT exist, this can happen.

The game is looking for the following entities:
@elevator_entry_teleport
@arrival_teleport
If it cannot find one, no go! But never fear! We can choose what we want to teleport to! First let's look at a transition list. Here is part from my mod.
```
"s_c1_cutscene_2",      
   "@Spawn_Room",      // This is where the player is teleported to upon entering s_c1_intro
"s_c1_intro",         
   "@Spawn",      // Teleport location for s_c1_intro_2
"s_c1_intro_2",         // GLaDOS's chamber
"s_c1_cutscene_3",      // Next Cutscene

>
> You can see the levels are all prefixed with, "**s_c1_**" And there is a "**@Spawn_Room**" and "**@Spawn**" in the list as well. There are manual teleport points. When a level is reached the script will check, using this bit of code:
> ```
if( MapPlayOrder[index-1].find("@") == null )
>             {
>                printl( "Teleporting to default start pos" )
>                EntFire( "@elevator_entry_teleport", "Teleport", 0, 0 )      
>                EntFire( "@arrival_teleport", "Teleport", 0, 0 )               
>             }

if it finds a "**@**" If it can't it tries to teleport to: @elevator_entry_teleport, or @arrival_teleport.

If it DOES find one it fires this bit of code:
else             {                printl( "Trying to teleport to " + MapPlayOrder[index - 1] + "_teleport" )                EntFire( MapPlayOrder[index - 1] + "_entry_teleport", "Teleport", 0, 0.0 )             }

This tells it to teleport the play to an entity named XXX_entry_teleport. Where XXX is one above the map name. So in my case, "**@Spawn_Room_entry_teleport**"

So TL:DR. Add a line above your level as something, name a point_teleport that +_entry_teleport, $$$$, PROFIT!!!!

Thank you for your reply, it is far more informative than what I've been reading so far. I have a few questions about your post however.

My maps follow the naming scheme of "training_chamber_01" and then 02 and so on.
When I am making a point_teleport, for instance in level 02, I should then name it in hammer as "@02_entry_teleport" and in the transition list as "@02" above the mapname.

I've tried this and a few other naming methods, but when the level transitions I am placed inside the box found in the arrival_departure_transition entity. Did I miss something important?

Another question is that of where to place the point_teleport. I've only tried placing it within the elevator model in the elevator entry entity for a smooth transition, but I wonder if that could be an issue as I don't have a strong understanding of how Portal 2 actually processes the level transition.

Avatar
TopHATTwaffle
113 Posts
Posted Mar 07, 2013
Replied 44 minutes later
Here is something... Please place a copy of the transitions script into portal 2/update. I think there may be a copy of the script that is being used instead of your copy. If that does not work we can get into trouble shooting this more.

As for your question on placement. Place it where ever you want the player to spawn into the level. That's it.

Avatar
tokichronos
4 Posts
Posted Mar 08, 2013
Replied 12 hours later

TopHATTwaffle wrote:
Here is something... Please place a copy of the transitions script into portal 2/update. I think there may be a copy of the script that is being used instead of your copy. If that does not work we can get into trouble shooting this more.

As for your question on placement. Place it where ever you want the player to spawn into the level. That's it.

I tried the Updates folder, but no luck there.
Good news though, I went through my maps very closely and found a couple careless mistakes that were likely causing some problems. I also took a very close look at the code you referenced and figured out what the game wanted in terms of syntax.

I do realize I couldn't have done it this quickly without your help, thank you very much!

Advertisement
Registered users don’t see ads! Register now!
Avatar
TopHATTwaffle
113 Posts
Posted Mar 08, 2013
Replied 6 hours later
Just happy you have it working!