Overview
This guide will lead you through the process to create your own wire puzzle for custom maps in Half-Life Alyx. This is using the community Hammer version which you can find here official tools!We will be creating a simple puzzle which turns a light on and off. Once you have finished the tutorial, you should have the skills to be able to create more complex puzzles.
Setting up the map
If you already have a wall, floor and player set up with the multitool equipped, please skip this step
First, create a wall and a floor for your player to stand on.
Next add the entity info_player_start
Also add the entity info_hlvr_equip_player and in it’s properties, make sure the following are ticked
- Equip on map start
- Multitool
Remember to have some sort of light source in the map as well. I’m going to use a light_enviroment.
Now we are setup to create our wire puzzle!
Creating the port, path, nodes and junction
In order to create the port for the player to use their multitool to activate the puzzle, create an entity with the classname info_hlvr_toner_port and position it onto your wall. Give it a name. I will call mine port. Ensure you tick box “Start Visible”
Next, create the entity info_hlvr_toner_path_node and position it next to your port. Give it a name. I will call mine node1. The nodes will allow us to visualize the wire path in game.
Now create the entity info_hlvr_toner_path next to to the node. Give it a name. I will call mine path1. The paths will allow us to control input and output scripting for our puzzle.
Create the entity info_hlvr_toner_junction next to the path entity. Give it a name. I will call mine junction1. Make sure the junction is pressed against the wall.The junctions are the parts which the player will rotate in order to change the direction of current.
Now we will connect our different parts together. Select the info_hlvr_toner_path entity.
- Open its properties and set Start to the name of the port (so I will set mine to port.)
- Set End to the name of the junction (so I will set mine to junction1).
- Set First Path Node to the name of the node (so I will set mine to node1).
You should see a line connecting the port, node and junction, and should look like this
So it’s setup correctly, but the visualiser line is not straight.Furthermore, the starting orientation of our port is not correct. Select the info_hlvr_toner_port entity and open it’s properties. The property Initial orientation is for the animation of the port activating and desired orientation is the direction in which the wire puzzle continues. Please note that the initial orientation must be plus or minus 90 degrees away from desired orientation, otherwise the port will not activiate properly. I will set my initial orientation to 90 degrees and my desired orientation to 180 degrees. These values will vary, depending on the what the rotation of your port is and the direction of your puzzle.
I will also adjust the position of the port and node so that we have a straight line from the port to the junction. Your puzzle should look something like this:
Now we will set up the properties for the junction. Select the info_hlvr_toner_junction entity, indicated by the block. Set it’s Connected Path Entity Right – or whatever direction your path is coming from – to the name of the path entity (so I will set mine to path1). Furthermore change your Junction orientation so that the player will have to turn the junction to complete the puzzle. Also, you can check out the Junction topology to create alternate junctions such as ones with 3 paths coming off it. It should look something like this:
Well done! If you take a look in game, you should be able to activate the port, and you should be able to see a wire path from the port to the junction.
You should also be able to turn the junction.
Creating the output path, nodes and light
Now that we have setup our junction, port and initial path and node, we can create another path to turn on a light when we correctly position the junction.
Let’s create our light to begin with to show the output. I will use the model models/lights/wall_lights_2c.vmdl and set it’s class to be prop_dynamic so that we can change it’s Skin. We also want to give it a name. I will simply call mine my_light.
Now we will create another node, this time coming off the junction to the right. Give it a name. I will call mine node2.
Next, we will create another path. Give it a name. I will call mine path2.
Like with our first path, we will need to input some values into the new path’s properties.
- Open its properties and set Start to the name of the junction (so I will set mine to junction1.) You will see a line connecting the two entities.
- Set End to the name of the light (so I will set mine to my_light). You will see a line connecting the two entities.
- Set First Path Node to the name of the node we just made (so I will set mine to node2).
Now in the Output section of our path’s properties, we will create outputs to turn the light on when the path is powered on. Add a new output and enter the following values
- Set My output named to OnPowerOn.
- Set Target entities named to the name of your output (so for me, my_light).
- Set Via this input to whatever it is you want to change about your target. To change the light to appear as if it has turned on, we will change it’s Skin from default to red (this won’t actually emit light – you will need to add a light entity for that). So I will select Skin in this box.
- If you need to add a parameter to your output, do it in With a parameter override of. To change the Skin we will need to set this to 1.
We also need to create another output in case the player adjusts the junction to power down the light. This time set My output named to OnPowerOff and set the With a parameter override of to 0
Finally, we need to make sure the junction knows about this new path. Set the Left Path (or whatever direction your new path is in from the junction) property of junction1 to the name of your second path (so for me, path2).
Congratulations! You have succesfully made a wire puzzle in Half-Life: Alyx. You should now have enough knowledge to go on and create more complex puzzles.
Testing it out in game:
I hope you found this guide useful! If you have found any mistakes with it, please message me the error and I will try to fix it as soon as I can. This is a fairly basic guide and there more options to play around with, but I will leave that up to you.