Momentary rotating button example

Half-Life HL
Momentary rotating button example by The Mad Carrot
Posted 12 years ago2009-11-30 12:26:13 UTC • Examples • Half-Life
Screenshot Thumbnail
Momentary rotating button example
The Mad Carrot The Mad Carrot
12 years ago2009-11-30 12:26:13 UTC
2 years ago2019-10-26 13:17:23 UTC
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.


Commented 12 years ago2009-12-01 00:13:03 UTC Comment #4429
Nice example map. thumbs up
Commented 12 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.