From Valve Developer Community
< User:Thepaperdog
Revision as of 05:33, 18 February 2009 by JurgenKnops (talk | contribs) (Editing)
Jump to: navigation, search


HL2, EP1, EP2: During the game, players will come across some physics scenarios, where they will need to turn a pipe valve on and/or off to achieve an effect or desired progress in the game.

This page will describe steps on how to build a functional valvewheel prop for a custom map, where:

1) The Player can +USE the valve object and it will turn (to open).

2) The Player can repeat the +USE action and the valve object will toggle back (to close).


1) Create a new texture brush and set it as a momentary_rot_button entity.

2) Ensure these flags are set:

     Not Solid       Checked      
     Toggle          Checked
     Use Activates   Checked

3) Create a new prop_dynamic entity and browse/set its world model/skin as model:

   Recommended model:  valvewheel001.mdl


Bind the two new objects together, making the momentary_rot_button entity as the parent of the prop_dynamic entity.

1) Set the Name property for each of the entities (Give each entity a unique, meaningful name). For example:

   (momentary_rot_button)   Name =  MyValveRotator
   (prop_dynamic)           Name =  MyValve

2) Set the Parent property of the prop_dynamic entity to the name of the momentary_rot_button entity:

   (prop_dynamic)           Parent = MyValveRotator


Set an output statemet in the momentary_rot_button entity's OTIP settings (i.e. Output, Target, Input, Parameter Override settings in the entity's Properties | Outputs tab-page).

1) Use the following values:

  Output...    OnPressed
  Target...    MyValve
  Input...     SetAnimation


Drag the momentary_rot_button brush over the prop_dynamic entity, making sure that the prop is completely enclosed by the brush.

Once the entities are properly aligned, it is recommended that they be locked together as group entity. (Also recommend saving that grouped entity as a Prefab in the Steam directory.)


The momentary_rot_button brush placement/position will effect the precision of prop's dynamics. For example, if the brush is moved away from its associated prop, the rotation performance of the prop will behave like a right/left/up/down lever, offset from the intended axis of the prop. A good practice is to make sure that the Origins for each entity are centered and aligned to each other. (You can experiment with the brush placement to illustrate this.)

Updates pending: (valve, valvewheel, pipe-valve, pipe-valvewheel, pipe)

-- The PaperDog 21:22, 16 February 2009 (UTC)


Hi, ThePaperDog. Great to watch you busy with your User Page. But please bear in mind that all those minor changes become visible to all of us within the Recent Changes page. Which generates a big list of minor changes. If editing, use the 'Show Preview' button before posting. Thanks from us all :) --Jurgen Knops 12:33, 18 February 2009 (UTC)