Momentary rotating button example

Half-Life HL
Momentary rotating button example by The Mad Carrot
Posted 14 years ago2009-11-30 12:26:13 UTC • Examples • Half-Life
Loading...
Screenshot Thumbnail
Name
Momentary rotating button example
By
The Mad Carrot The Mad Carrot
Type
Map
Engine
Goldsource
Game
Half-Life
Category
Examples
Included
BSP, RMF/VMF
Created
14 years ago2009-11-30 12:26:13 UTC
Updated
5 years ago2019-10-26 13:17:23 UTC
Views
5003
Downloads
1309
Comments
2
Download (36.29kb)

Remember the dish in the Half-Life demo Uplink and in my "remastered" Uplink Extended? The dish is a momentary_rot_button. You can rotate it with the turnwheel which is also a momentary_rot_button. When the dish is in its correct postion, a light flicks on, and a func_button is enabled (unlocked). How does the dish know when it's in the correct position?

It's done using another momentary_rot_button, not visible to the player. This momentary_rot_button is just a flat brush with a func_pushable sitting on top of it. When the dish rotates, this momentary_rot_button moves to the right, carrying the pushable along with it.

A trigger_pushable can trigger other entities, provided that the 'pushables' flag is checked. By using one ore more trigger_multiples, you can trigger entities when the pushable brush goes through them. The trigger_multiple can then trigger things like a light or a sound to tell the player the dish is in the correct position.

In this example map, I have a momentary_rot_button which rotates the needle of a gauge. When the needle enters the red part of the gauge, a red light flicks on and the button on the control panel is enabled (the pushable touched the second trigger_multiple, marked with a partial see through green brush). When the needle leaves the red part, the light is turned off and the button is disabled (the pushable touched the third trigger_multiple, marked with a partial see through red brush).

When you turn the turnwheel the other way, the same thing happens. Needle enters red part, pushable touches second trigger_multiple (green brush), light and button are enabled. Needle leaves red part, pushable touched first trigger_multiple (red brush), light and button are disabled.

There is however one slight issue when rotating the turn wheel the other way, there's a slight delay at which the light and button should enable/disable, causing the light and button to enable when the needle is already in the red part, and the light and button will disable when the needle has already left the red part.

Note: the partial see through green and red brushes are not part of the contraption and are just there to show the location of the trigger_multiples in-game.

Edit (10-26-2019): Renamed zip file and contents. "mom_rot_btn" just doesn't sound right.

2 Comments

Commented 14 years ago2009-12-01 00:13:03 UTC Comment #4429
Nice example map. thumbs up
Commented 14 years ago2009-12-03 10:02:22 UTC Comment #4434
I remember long time ago, you personally sent me this. Now, all the rest who do not know, knows. thumbs up :D

You must log in to post a comment. You can login or register a new account.