Enter Half-Life Re-imagined, our current competition!
Check out Skewing textures in Hammer, our newest tutorial!
Welcome, Bear, our newest member!

logo

Site Stuff

Reference

Maps

Community

ShoutBOX

Poll

Feeling Blue

What's your favourite shade of blue?

Azure

5

Cobalt

8

Turquoise

1

Cyan

4

Royal

2

Teal

1

Onliners

2 mins

Crollo

8 mins

NineTnine

19 mins

Loulimi

21 mins

Tetsu0

33 mins

Penguinboy

41 mins

Suparsonik

52 mins

Crypt

Affiliates

A gaming and technology blog by TWHL admins Penguinboy and Ant. A music blog by TWHL users Ant and Hugh.

Momentary rotating button example

Map Vault > Example Maps

map screenshot

Ratings Disabled

[More Screenshots]

Avatar

By The Mad Carrot (See more)
30th November, 2009

Half-Life
36.23KB - RMF, BSP
1788 views
529 downloads
2 comments

Last edited: 30th November, 2009

download

Remember the dish in 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 the correct allignment, a light flicks on, and a button is enabled. How does the dish know when it's in the correct allignment?

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 things, provided that the Pushables flag is checked. By using 3 trigger_multiples, you can trigger stuff 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 momentary_rot_button 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 a button is enabled (the pushable touched the second trigger_multiple). When the needle leaves the red part, the light is turned off and the button is disabled (the pushable touched the third trigger_multiple).

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

There is however one slight issue when rotating the turnwheel the other way, there's a slight delay at wich 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.
I don't think there's a fix for this, it's just how the momentary_rot_button works.
You'll understand when you try it yourself.

Note: the transparent green and red brushes are not part of the contraption and are just there to show the location of the trigger_multiples ingame.

Comments

avatar Sajo says: 1st December 2009, 00:13 AM
Nice example map. *thumbs up*
avatar HLGenius says: 3rd December 2009, 10:02 AM
I remember long time ago, you personally sent me this. Now, all the rest who do not know, knows. *thumbs up* :D
You must be logged in to comment.