Elevator (Portal 2): Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (updated language bar. also some grammar fixes.)
Line 1: Line 1:
{{otherlang2
{{lang|Elevator_(Portal_2)}}
|ru=Elevator_(Portal_2):ru
'''Elevators''' are used in Portal 2 to transition the player from level to level. They are not to be confused with the [[Disassembler]], which took the players from level to level in coop. The elevators are present in Overgrown, Reconstructing, Clean, and Wheatley [[The Aesthetics of Portal 2|themes]].
|es=Elevator_(Portal_2):es
}}
'''Elevators''' are used in Portal 2 to transition the player from level to level. They are not to be confused with the [[Disassembler]], which took the players from level to level in coop. The elevators are present in Overgrown,Reconstructing,Clean and Wheatley [https://developer.valvesoftware.com/wiki/The_Aesthetics_of_Portal_2 themes].


== Adding elevators to a map ==
== Adding Elevators to a Map ==
{{note|This tutorial will create an elevator spawn in your level. To prevent the potato gun from spawning, see potato removal simple tutorial 1 below.}}
{{note|This tutorial will create an elevator spawn in your level. To prevent the potato gun from spawning, see potato removal simple tutorial 1 below.}}
===Entrance elevator===
===Entrance Elevator===
1. Select the entity tool, create a [[func_instance]], and give it the fixup name "Arrival_Elevator" and the VMF file name "instances/turbine_elevator/arrival_elevator_a4_base.vmf"
1. Select the entity tool, create a {{ent|func_instance}}, and give it the fixup name "Arrival_Elevator" and the VMF file name "instances/turbine_elevator/arrival_elevator_a4_base.vmf"


{{note|If the elevator does not load, save hammer and re-open it. You may also assure that the map you are editing is in the portal 2\sdk_content\maps folder.}}
{{note|If the elevator does not load, save hammer and re-open it. You may also assure that the map you are editing is in the <code>portal 2\sdk_content\maps</code> folder.}}


[[Image:Elevatortutorial1.jpg|thumb|right|Both instances just after copying]]
[[Image:Elevatortutorial1.jpg|thumb|right|Both instances just after copying]]
2. To make things simpler, and to not have to create two func_instances and find the second one through all this mess, simply duplicate the "Arrival_Elevator" instance and place the copy exactly back on top of the original.
2. To make things simpler, and to not have to create two <code>func_instance</code>s and find the second one through all this mess, simply duplicate the "Arrival_Elevator" instance and place the copy exactly back on top of the original.


{{note|If you look at the tall blue "skip"-textured column, you can easily align the two items.  Simply ensure that the columns line up in all three 2d windows.  Also make sure the bottom of the columns are aligned.  If you need to select one of the two parts, ie the elevator or the logic, you can click one of the cubes attached to the column.}}
{{note|If you look at the tall blue <code>toolsskip</code>-textured column, you can easily align the two items.  Simply ensure that the columns line up in all three 2d windows.  Also make sure the bottom of the columns are aligned.  If you need to select one of the two parts, such as the elevator or the logic, you can click one of the cubes attached to the column.}}


3. Double-click either one and change the name to "Arrival_Logic" with the VMF file name "instances/turbine_elevator/arrival_elevator_a4_logic.vmf"
3. Double-click either one and change the name to "Arrival_Logic" with the VMF file name "instances/turbine_elevator/arrival_elevator_a4_logic.vmf"
{{note| You don't have to use the a4_logic if you don't want. "arrival_elevator_logic" works just as well, except the elevator comes down from above rather than up from below.}}
{{note| You don't have to use <code>a4_logic</code> if you don't want. <code>arrival_elevator_logic</code> works just as well, except the elevator comes down from above rather than up from below.}}


You can use one of the other elevators to use a different theme; just make sure you have both the elevator and the logic instances.
You can use one of the other elevators to use a different theme, as long as you have both the elevator and the logic instances.


=== Transition manager ===
=== Transition Manager ===
[[Image:Elevatortutorial2.jpg|thumb|right|Transition manager is the little boxes behind the elevator]]
[[Image:Elevatortutorial2.jpg|thumb|right|Transition manager is the little boxes behind the elevator]]
4. Create one more func_instance entity anywhere; a convenient place is right behind the elevator model (but not inside the arrival elevator!).  Name this one "Arrival_Departure_Trans" with the VMF file name "[[Arrival departure transition ents.vmf (Portal 2)|instances/transitions/arrival_departure_transition_ents.vmf]]". This instance covers the transition for both the Arrival AND Departure elevators, but does not cover the vmf's for the departure elevator(read below)
4. Create one more <code>func_instance</code> entity anywhere; a convenient place is right behind the elevator model (but not inside the arrival elevator!).  Name this one "Arrival_Departure_Trans" with the VMF file name "[[Arrival departure transition ents.vmf (Portal 2)|instances/transitions/arrival_departure_transition_ents.vmf]]". This instance covers the transition for both the Arrival AND Departure elevators, but it does not cover the <code>.vmf</code>s for the departure elevator (read below).


You were able to set the videos on the elevators by setting the variables in this instance before the DLC2 - update (Puzzlemaker) broke it. This is still possible. By replacing (remember to keep a backup of the original script)
You were able to set the videos on the elevators by setting the variables in this instance before the DLC2 - update (Puzzlemaker) broke it. This is still possible. By replacing (remember to keep a backup of the original script)
Line 34: Line 31:
:"<Your Steam Folder>\SteamApps\common\portal 2\portal2\scripts\vscripts\video\video_splitter.nut"
:"<Your Steam Folder>\SteamApps\common\portal 2\portal2\scripts\vscripts\video\video_splitter.nut"


you'll be able to set arrival- and departure- videos, instead of a random one being chosen on upload; e.g. try setting $arrival_video to media/animalking.bik. For a complete list of available videos, see [[List_of_Portal_2_Movies|this page.]]
you'll be able to set arrival- and departure- videos, instead of a random one being chosen on upload; e.g. try setting <code>$arrival_video</code> to <code>media/animalking.bik</code>. For a complete list of available videos, see [[List_of_Portal_2_Movies|this page.]]
 
{{todo|Is it possible to change the script in the instance's script Entity?}}
{{note|It may be possible to change the script in the instance's script Entity. However, I currently don't know if that works.}}


=== Exit elevator ===
=== Exit elevator ===
Line 43: Line 39:
=== Connection to the map ===
=== Connection to the map ===
[[Image:Elevatortutorial3.jpg|thumb|right|Elevator connected to a room]]
[[Image:Elevatortutorial3.jpg|thumb|right|Elevator connected to a room]]
6. You will notice that sticking out of the middle of the elevators on one side is an extension that looks like a hallway. You must connect this passage to your map. A [[Test Door (Portal 2)|door]] would look good here.
6. You will notice that sticking out of the middle of the elevators on one side is an extension that looks like a hallway. You must connect this passage to your map. A [[Test Door (Portal 2)|door]] would look good here.


{{note|The map will leak at the passageway exit if it's not sealed off with your own construction. You do not have to box the entire elevator, just take care of the exit.}}
{{note|The map will leak at the passageway exit if it isn't sealed off with your own construction. You do not have to box the entire elevator, just take care of the exit.}}


{{note|You do not need a spawn point or a portal gun entity, the instances cover this.}}
{{note|You do not need a spawn point or a portal gun entity, as the instances cover this.}}


Now your elevator is complete, congratulations!
Now your elevator is complete, congratulations!


==Spawning without a potato (advanced)==
==Spawning Without a Potato (Advanced)==
{{todo|Why is this method better?}}
{{todo|Why is this method better?}}


Line 58: Line 54:
2. At step 3, replace the instance "instances/turbine_elevator/arrival_elevator_a4_base.vmf" with "instances/turbine_elevator/arrival_elevator_base.vmf".
2. At step 3, replace the instance "instances/turbine_elevator/arrival_elevator_a4_base.vmf" with "instances/turbine_elevator/arrival_elevator_base.vmf".


3. Double click on the instance and click on Edit Instance. Immediately, save it under a new name ("my_arrival_elevator_base.vmf", for example) because we'll be doing some changes in it. Also, don't forget to modify the Vmf Filename of the instance in the main map.
3. Double click on the instance and click on Edit Instance. Immediately save it under a new name ("my_arrival_elevator_base.vmf", for example), because we'll be doing some changes in it. Also, don't forget to modify the VMF Filename of the instance in the main map.


4. Double click on the trigger_once named "elevator_1_interior_start_trigger" that cover the elevator model.
4. Double click on the {{ent|trigger_once}} named "elevator_1_interior_start_trigger" that covers the elevator model.


5. Go to the Outputs, and Copy the line with:  
5. Go to the Outputs and copy the line with:  


::{| class=standard-table
::{| class=standard-table
Line 70: Line 66:
|}
|}


6. Delete that output line, and place a func_instance_io_proxy entity named "proxy" near the elevator model.
6. Delete that output line, and place a {{ent|func_instance_io_proxy}} entity named "proxy" near the elevator model.


7. Go to the Outputs, and Paste the line copied before.
7. Go to the Outputs, and Paste the line copied before.
Line 76: Line 72:
8. Change the "OnStartTouch" output to "OnProxyRelay". Save your instance.
8. Change the "OnStartTouch" output to "OnProxyRelay". Save your instance.


9. Go back to your main map and create a info_player_start and a weapon_portalgun in the elevator (make sure that the player is not stuck in the elevator).
9. Go back to your main map and create a {{ent|info_player_start}} and a {{ent|weapon_portalgun}} in the elevator (make sure that the player is not stuck in the elevator).


10. Create a trigger_once entity that covers the whole elevator model and info_player_start.
10. Create a <code>trigger_once</code> entity that covers the whole elevator model and <code>info_player_start</code>.


11. Add this Output:
11. Add this output:


::{| class=standard-table
::{| class=standard-table
Line 88: Line 84:
|}
|}


12. Finally, save your map, compile it and it should works, if you did it correctly.
12. Finally, save your map and compile it.


== Spawning without a potato (simple) ==
== Spawning Without a Potato (simple) ==
1. Create a logic_playerproxy named player_settings.
1. Create a {{ent|logic_playerproxy}} named "player_settings."


2. Place a logic_auto somewhere in your map. Put it next to the logic_playerproxy so that you can find them both.
2. Place a {{ent|logic_auto}} somewhere in your map (preferably next to the </code>logic_playerproxy</code> so you can easily find them both).


3. On the Output tab of logic_auto, add this output:
3. On the Output tab of the <code>logic_auto</code>, add this output:


::{| class=standard-table
::{| class=standard-table
Line 103: Line 99:
|}
|}


4. Finally, save your map, compile it and it should work, if you did it correctly.
4. Finally, save your map and compile it.


==Spawning without a potato (simple #2)==
==Spawning Without a Potato (simple #2)==
1. Create a trigger_weaponstrip at the bottom of the arrival elevator.
1. Create a {{ent|trigger_weaponstrip}} at the bottom of the arrival elevator.


2. Place a portal gun above the trigger.
2. Place a portal gun above the trigger.


3. In the settings of the portal gun, adjust it to your preference (no potatoes or single portal only).
3. In the settings of the portal gun, adjust it to your preference (such as no potatoes or single portal only).




== Creating an underground elevator ==
== Creating an Underground Elevator ==
There's already a page for this, but it's incomplete and I think this tutorial belongs here.
{{seealso|Underground Elevator}}


1. Follow instructions above, but use instances/underground/test_dome_entrance_lift_01.vmf for the Arrival_Elevator and don't make Arrival_Logic.
1. Follow instructions above, but use "instances/underground/test_dome_entrance_lift_01.vmf" for the Arrival_Elevator and don't make Arrival_Logic.


2. In your elevator, make an info_player_start. If it won't work in the 3D view, make it in the 2D view and move it down so it touches the floor of the actual elevator. (NOT the shaft, the actual elevator itself.)
2. In your elevator, make an <code>info_player_start</code>. If it won't work in the 3D view, make it in the 2D view and move it down so it touches the floor of the elevator. (NOT the shaft, the actual elevator itself.)


3. Create a logic_auto (or, if one already exists outside of an instance, use that). On the outputs tab, put the following output:
3. Create a <code>logic_auto</code> (or, if one already exists outside of an instance, use that). On the outputs tab, put the following output:


::{| class=standard-table
::{| class=standard-table
Line 130: Line 126:
This will show up as invalid. It will still work. The "simple" instructions for changing the portalgun apply here. I'm not sure the "advanced" instructions do.
This will show up as invalid. It will still work. The "simple" instructions for changing the portalgun apply here. I'm not sure the "advanced" instructions do.


== Creating an underground elevator (simple) ==
== Creating an Underground Elevator (simple) ==


Go and open the vmf file maps\instances\underground\test_dome_entrance_lift_01.vmf
Go and open the VMF file <code>maps\instances\underground\test_dome_entrance_lift_01.vmf</code>.
Go and find the point_teleport enity called @test_dome_lift_entry_teleport and change its name to @arrival_teleport and save it and it will work.
Go and find the {{ent|point_teleport}} entity called "@test_dome_lift_entry_teleport," change its name to "@arrival_teleport," then save.


== Custom entrance and exit ==
== Custom Entrance and Exit ==
If you wish for the player to spawn at a specific point create a [[point_teleport]] and name it @arrival_teleport and set the Entity to Teleport to "!player".
If you wish for the player to spawn at a specific point, create a <code>point_teleport</code> and name it "@arrival_teleport," then set the Entity to Teleport to "!player."


For a custom exit, add the following output to the trigger or other entity that ends your level.
For a custom exit, add the following output to the trigger or other entity that ends your level.
Line 144: Line 140:
| [[Image:Io11.png]] || "insert output" || @exit_teleport || teleport || || 0.00 || No
| [[Image:Io11.png]] || "insert output" || @exit_teleport || teleport || || 0.00 || No
|}
|}
If it says that the output is invalid ignore it.
If it says that the output is invalidignore it.


==See also==
==See also==
*[[Underground Elevator]]
* [[Underground Elevator]]
*[[Instance]]
* [[Instance]]
[[Category:Portal 2 Level Design]]
[[Category:Portal 2 Level Design]]
[[Category:Portal 2 Tutorials]]
[[Category:Portal 2 Tutorials]]

Revision as of 19:59, 25 April 2022

English (en)Español (es)Русский (ru)中文 (zh)Translate (Translate)

Elevators are used in Portal 2 to transition the player from level to level. They are not to be confused with the Disassembler, which took the players from level to level in coop. The elevators are present in Overgrown, Reconstructing, Clean, and Wheatley themes.

Adding Elevators to a Map

Note.pngNote:This tutorial will create an elevator spawn in your level. To prevent the potato gun from spawning, see potato removal simple tutorial 1 below.

Entrance Elevator

1. Select the entity tool, create a func_instance, and give it the fixup name "Arrival_Elevator" and the VMF file name "instances/turbine_elevator/arrival_elevator_a4_base.vmf"

Note.pngNote:If the elevator does not load, save hammer and re-open it. You may also assure that the map you are editing is in the portal 2\sdk_content\maps folder.
Both instances just after copying

2. To make things simpler, and to not have to create two func_instances and find the second one through all this mess, simply duplicate the "Arrival_Elevator" instance and place the copy exactly back on top of the original.

Note.pngNote:If you look at the tall blue toolsskip-textured column, you can easily align the two items. Simply ensure that the columns line up in all three 2d windows. Also make sure the bottom of the columns are aligned. If you need to select one of the two parts, such as the elevator or the logic, you can click one of the cubes attached to the column.

3. Double-click either one and change the name to "Arrival_Logic" with the VMF file name "instances/turbine_elevator/arrival_elevator_a4_logic.vmf"

Note.pngNote: You don't have to use a4_logic if you don't want. arrival_elevator_logic works just as well, except the elevator comes down from above rather than up from below.

You can use one of the other elevators to use a different theme, as long as you have both the elevator and the logic instances.

Transition Manager

Transition manager is the little boxes behind the elevator

4. Create one more func_instance entity anywhere; a convenient place is right behind the elevator model (but not inside the arrival elevator!). Name this one "Arrival_Departure_Trans" with the VMF file name "instances/transitions/arrival_departure_transition_ents.vmf". This instance covers the transition for both the Arrival AND Departure elevators, but it does not cover the .vmfs for the departure elevator (read below).

You were able to set the videos on the elevators by setting the variables in this instance before the DLC2 - update (Puzzlemaker) broke it. This is still possible. By replacing (remember to keep a backup of the original script)

"<Your Steam Folder>\SteamApps\common\portal 2\portal2_dlc2\scripts\vscripts\video\video_splitter.nut"

with

"<Your Steam Folder>\SteamApps\common\portal 2\portal2\scripts\vscripts\video\video_splitter.nut"

you'll be able to set arrival- and departure- videos, instead of a random one being chosen on upload; e.g. try setting $arrival_video to media/animalking.bik. For a complete list of available videos, see this page.

Todo: Is it possible to change the script in the instance's script Entity?

Exit elevator

5. To create the exit elevator, simply repeat steps 1-3 but instead of "arrival_elevator" you will choose "instances/turbine_elevator/departure_elevator_a4_logic.vmf" and "instances/turbine_elevator/departure_elevator_a4_base.vmf" both of which are located in the same folder. Name these "Departure_Elevator" and "Departure_Logic" respectively.

Connection to the map

Elevator connected to a room

6. You will notice that sticking out of the middle of the elevators on one side is an extension that looks like a hallway. You must connect this passage to your map. A door would look good here.

Note.pngNote:The map will leak at the passageway exit if it isn't sealed off with your own construction. You do not have to box the entire elevator, just take care of the exit.
Note.pngNote:You do not need a spawn point or a portal gun entity, as the instances cover this.

Now your elevator is complete, congratulations!

Spawning Without a Potato (Advanced)

Todo: Why is this method better?

1. Repeat steps 1 and 2 above.

2. At step 3, replace the instance "instances/turbine_elevator/arrival_elevator_a4_base.vmf" with "instances/turbine_elevator/arrival_elevator_base.vmf".

3. Double click on the instance and click on Edit Instance. Immediately save it under a new name ("my_arrival_elevator_base.vmf", for example), because we'll be doing some changes in it. Also, don't forget to modify the VMF Filename of the instance in the main map.

4. Double click on the trigger_once named "elevator_1_interior_start_trigger" that covers the elevator model.

5. Go to the Outputs and copy the line with:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnStartTouch elevator_1 MoveToPathNode @elevator_1_bottom_path_1 0.10 No

6. Delete that output line, and place a func_instance_io_proxy entity named "proxy" near the elevator model.

7. Go to the Outputs, and Paste the line copied before.

8. Change the "OnStartTouch" output to "OnProxyRelay". Save your instance.

9. Go back to your main map and create a info_player_start and a weapon_portalgun in the elevator (make sure that the player is not stuck in the elevator).

10. Create a trigger_once entity that covers the whole elevator model and info_player_start.

11. Add this output:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnStartTouch Arrival_logic instance:elevator_1;MoveToPathNode 0 0.00 No

12. Finally, save your map and compile it.

Spawning Without a Potato (simple)

1. Create a logic_playerproxy named "player_settings."

2. Place a logic_auto somewhere in your map (preferably next to the logic_playerproxy so you can easily find them both).

3. On the Output tab of the logic_auto, add this output:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnMapSpawn player_settings RemovePotatosFromPortalgun 1.00 No

4. Finally, save your map and compile it.

Spawning Without a Potato (simple #2)

1. Create a trigger_weaponstrip at the bottom of the arrival elevator.

2. Place a portal gun above the trigger.

3. In the settings of the portal gun, adjust it to your preference (such as no potatoes or single portal only).


Creating an Underground Elevator

See also:  Underground Elevator

1. Follow instructions above, but use "instances/underground/test_dome_entrance_lift_01.vmf" for the Arrival_Elevator and don't make Arrival_Logic.

2. In your elevator, make an info_player_start. If it won't work in the 3D view, make it in the 2D view and move it down so it touches the floor of the elevator. (NOT the shaft, the actual elevator itself.)

3. Create a logic_auto (or, if one already exists outside of an instance, use that). On the outputs tab, put the following output:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnMapSpawn Arrival_Elevator-entrance_lift_train StartForward 0.00 No

This will show up as invalid. It will still work. The "simple" instructions for changing the portalgun apply here. I'm not sure the "advanced" instructions do.

Creating an Underground Elevator (simple)

Go and open the VMF file maps\instances\underground\test_dome_entrance_lift_01.vmf. Go and find the point_teleport entity called "@test_dome_lift_entry_teleport," change its name to "@arrival_teleport," then save.

Custom Entrance and Exit

If you wish for the player to spawn at a specific point, create a point_teleport and name it "@arrival_teleport," then set the Entity to Teleport to "!player."

For a custom exit, add the following output to the trigger or other entity that ends your level.

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png "insert output" @exit_teleport teleport 0.00 No

If it says that the output is invalid, ignore it.

See also

External links