Elevator Departure Transition Timing

Avatar
DigitalMan
17 Posts
Posted Apr 01, 2012
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! :smile:

Advertisement
Registered users don’t see ads! Register now!
Avatar
HMW
806 Posts
Posted Apr 06, 2012
Replied 4 days later
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:```
    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:

OnMapSpawn: exit_el-elevator_1_player_teleport: RunScriptCode, parameter: "ElevatorMotifs[0].map = GetMapName()"
```
It's a bit of a hack, but it works :smile:

Avatar
Lpfreaky90
2,842 Posts
Posted Apr 06, 2012
Replied 32 minutes later

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

Advertisement
Registered users don’t see ads! Register now!
Avatar
HMW
806 Posts
Posted Apr 06, 2012
Replied 11 minutes later

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.