Please or Register to create posts and topics.

Elevator Departure Transition Timing

I'm not sure if somebody asked this before or not (I couldn't find help with searches), but I'm trying to get my elevators to work exactly how I would like them to. The trouble I'm having is with the actual transition part.

1. How do you get an elevator to transition after dialogue has finished? Was this done with a cleverly placed trigger or is there a entity, script, or something else that controls this?

2. When I put my elevator in the sp_elevator_motifs script, why does the elevator take longer to transition than without it in the motifs script (where it just transitions right away). Is there a part of the script I'm missing something?

Thanks! :)

Oh hey, I'm in a box!
[spoiler]Image
Currently Working On:
Portal 2 Mod: Currently Dubbed Project Aftermath
Finished Portal Work:
None... yet.
Links:
My Steam Profile[/spoiler]

I don't know all of the details yet, but there are several points along the elevator path where there is an opportunity to trigger a transition. Whether or not this happens depends on a global script variable called "TransitionReady", which has to be set to 1 for the transition to take place. This variable is presumably set by the entities that control dialogue, so the next map isn't loaded before everyone has finished talking.

It shouldn't be hard to control this manually; I'll have a look and report back if I find anything useful.

Edit: To control when a transition occurs, do the following:

- First, make sure that your map is listed in "sp_elevator_motifs.nut".
- Enter a fixup name for your exit elevator logic instance. ("exit_el" in this example).
- Then send the following event whenever it is time to transition to the next map:

Code: Select all
OnWhatever: exit_el-elevator_1_player_teleport: RunScriptCode, parameter: "::TransitionReady <- 1"

Don't include the double quotes around the parameter. Also, replace the first part of the target name (exit_el) with the name of your exit elevator logic instance.

The elevator will continue going up or down until the event is triggered, after which it will start the map transition at the next path node. (If it reaches the end of the shaft, it will transition anyway, regardless of the TransitionReady setting.)

If you don't want to edit script files (for example when you're distributing a single map and don't want the hassle of including custom files), you can add the map to the list in-game by adding a logic_auto with the following output:

Code: Select all
OnMapSpawn: exit_el-elevator_1_player_teleport: RunScriptCode, parameter: "ElevatorMotifs[0].map = GetMapName()"

It's a bit of a hack, but it works :)

Sendificate series: Sendificate | A Beam Too Far | Airtime | 302
Other Portal 2 maps: Medusa Glare
Portal 1 maps: Try Anything Twice | Manic Mechanic
HMW wrote:
I don't know all of the details yet, but there are several points along the elevator path where there is an opportunity to trigger a transition. Whether or not this happens depends on a global script variable called "TransitionReady", which has to be set to 1 for the transition to take place. This variable is presumably set by the entities that control dialogue, so the next map isn't loaded before everyone is finished talking.

It shouldn't be hard to control this manually; I'll have a look and report back if I find anything useful.

doesn't the scene enable those transitions? Something with on end scene? The other thing you can do is measure the time the scene and use a logic relay and enable the trigger with a delay that is the same as the time the scene takes.

-sent from phone, may contain some more errors

lpfreaky90 wrote:
doesn't the scene enable those transitions?

Yes, that sounds very plausible. I couldn't find the thing that triggers it in a decompiled map, but it may be hiding in another script file somewhere.

Sendificate series: Sendificate | A Beam Too Far | Airtime | 302
Other Portal 2 maps: Medusa Glare
Portal 1 maps: Try Anything Twice | Manic Mechanic