Half-Life: Alyx Guide

HLA/Source 2 SDK Elevator Guide for Half-Life: Alyx

HLA/Source 2 SDK Elevator Guide

Overview

This guide will teach you how to create an elevator by using teleports.

Preparations

This guide requires the Source 2/HLA SDK, but this can be done in Source 1 as well.

Create your elevator model. It’s called models/architecture/elevator/apartment_elevator01a.vmdl. You can try and justify it using walls and such, but for this tutorial I’ll be using a barebones map.

Creating the Doors

Create two models with the model name models/architecture/elevator/apartment_elevator01a_door.vmdl. Right click the models, go to “Selected Entities” and select “Convert Model into Editable Mesh”. Make sure the line up the meshes with your elevator. Turn these meshes into entities with CTRL+T, and then change their entity class to func_door. Make sure you name the doors, i’ll be naming them “door_left” and “door_right”, but you can use your own naming scheme if you’d like. Select the movement direction to whichever direction the elevator door will move (as denoted by the white arrow), and then set the lip to -1.

Now, set their spawn position to OPEN, unless you want a button to open the elevator. You can play around with the other settings if you want things like sound on your elevator, but it is not needed. You can also play around with other sound effects like elevator music and a “DING” sound, which all you’d have to do is play those sounds a specific number of seconds after hitting the elevator button, but those aren’t needed for this tutorial.

Creating the Teleport Sequence

Create a button in your elevator. If you don’t know how to make one, Chrjen has a very good button prefab on AlyxMods[alyxmods.com], or you can use this tutorial on the VDC. For this tutorial, I’ll be using the prefab. Next, create a trigger that encompasses the entire elevator. Press CTRL+T and set the entity class to “trigger_teleport” and name it “elevator_teleport”. Set the teleport entity to Start Disabled. If you want, you can change the spawnflags so that everything in the elevator gets teleported and not just the player, so that it looks more realistic.

Create an info_landmark entity somewhere in your elevator and name it “elevator_landmark”. Landmark entities are the same entities used in level changes, but here we’ll be using it to teleport the player. Go to your elevator_teleport entity and set the Local Destination Landmark to elevator_landmark, and select “Use Landmark Orientation”.

Go back to your button. Set the outputs on the button to these:
You can change the amount of time it takes for the elevator to arrive by changing when the teleport entity gets enabled. In this case, the elevator will arrive in 5 seconds.

Creating the Second Elevator

Copy EVERYTHING in the second elevator except for the trigger_teleport. Paste the elevator where you want your elevator to take you. Rename the second elevator’s doors to “door_right2” and “door_left2” and set their spawn position to “Closed”. Remove every output on the second elevator’s button, so that the button doesn’t do anything when pressed (unless you want the elevator to take you back to the previous floor, which I will not be covering.

This is the important part. Take your second info_landmark and change the entity to an info_target. THIS ENTITY MUST BE IN THE EXACT RELATIVE LOCATION AS THE LANDMARK IN THE FIRST ELEVATOR. Otherwise, the teleport will not appear seamless. Do not move the teleport target after this point. Rename the info_target to “elevator_destination”. Go back to the trigger_teleport, and set the “Remote Destination” to your new teleport target.

Go back to the first elevator’s button. Set these two new outputs:
Change the delay to 2 seconds after however long it takes to get to the new floor.

Finishing Up

If you have done everything correctly, the elevator doors should now close when you push the button and open at your new location seamlessly without having an obvious teleport.

If you’re having issues with the lighting on the doors when you teleport (such as the second elevator has a different colored light), you can put blocklight brushes in front of both elevators to have the same exact light on both sides.

If you have any questions, message Zelefant#9683 in the Half-Life Alyx Modding Discord or on Steam, and I can help you out!

SteamSolo.com