Tutorials
Calibrating a Satellite Dish with a Valve
This tutorial shows you how to create a satellite dish that can be calibrated manually by using a valve, as seen in HL:Uplink. You will also create a progress indicator. This tutorial is for advanced users.
Problem
In Half-Life 1, momentary rotating buttons could be tied to momentary rotating doors. The latter was removed in Source and swapped for the func_movelinear. This entity however, cannot rotate. This tutorial will explain how to work around that problem.
Setting up the indicator panel
1. Create a new room with a light and info_player_start entity. First, we're going to create the indicator. Create a brush (120Lx32Hx8T) and make it func_detail. This is going to be our indicator panel. You can texture it the way you like.
2. Now create a new brush and shape it like a triangle pointing down. Make it 4Lx18Hx2T and put it in front of the indicator panel on the left. Make sure it's 8 units away from the left edge.
3. Select the triangle and make it a func_movelinear with the following values:
Name: indicator_needle Speed: 5 Move distance: 90 FLAGS: check Not Solid (uncheck everything else)
4. To create some more feedback, place a env_sprite on the top right corner of our panel. Next to the panel, you can put an ambient_generic. Use the following values:
Name: indicator_sprite Render Mode: World Space Glow Sprite name: materials/Sprites/flare1.vmt Scale: 0.2 Size of Glow: 2 FLAGS: check Start On (uncheck everything else)
Name: indicator_sound Sound Name: buttons/button3.wav FLAGS: check Start Silent / Is Not Looped (uncheck everything else)
When done it should resemble something like this:

Setting up the calibration wheel
1. Create a new brush (8x8x8) with the NODRAW texture. Put it right under the indicator panel. Make this brush into a momentary_rot_button, with these values:
Name: valve Speed: 20 Distance: 360 Auto-return speed: 50 FLAGS: check Not Solid / Y-Axis / Use Activates (uncheck everything else)
Now create a prop_dynamic with the following values:
Parent: valve World Model: models/props_pipes/valvewheel001.mdl
2. Rotate this valvewheel model so the top faces the player when he approaches the panel. Make sure it sticks into the NODRAW brush and the centers (marked with x) are nicely lined up.
3. It'll seem like the player is rotating the actual wheel, but in reality, the player turns the invisible button behind it. Because the wheel model has the button set as it's parent, it will copy the button's movement. If you want to place the wheel in different angles, be sure to change the axis in the momentary_rot_button FLAGS.

Setting up the satellite dish
1. Create a prop_dynamic and put it somewhere near the panel. Use these values:
Parent: dish Model: models/props_rooftop/roof_dish001.mdl
2. Create a brush (8x8x8) with NODRAW textures on it. Make it into a momentary_rot_button and add these values:
Name: dish Speed: 10 Distance: 180 FLAGS: check Not Solid. (uncheck everything else)
3. Now select the prop_dynamic (dish model) and find it's center (marked with x). Then move the momentary_rot_button inside the dish model so the centers are aligned. This will not be entirely possible because the model isn't perfectly adjusted to the grid, but get it as close as possible.

Connecting the dots [Inputs & Outputs]
1. Everything is handled by the momentary_rot_button at the valve wheel. Select it and go to OUTPUTS and add the following entries from the screenshot.

2. These outputs will move the indicator needle as well as rotate the satellite model itself as soon as someone turns the valve. If the valve is released they will also move backwards. Once the valve has been opened fully it'll lock itself. A sound will play and the sprite will turn green to indicate the correct calibration.
Notes
1. Regarding Speed and Distance: You can change these values to your liking but they have been tweaked to make the indicator panel work correctly and make sense. Currently, the valve turns 360 degrees at 20 speed, the dish 180 degrees at 10 speed and the needle 90 units at 5 speed.
2. The example VMF has a more complex and polished indicator panel that you can use.
Download example VMF
- Hezus
