Piston Platform

From Valve Developer Community
Jump to: navigation, search

Piston platforms are a testing element used in Portal 2. They're used as lifts that rises up when powered.


1. Create a prop_dynamic with the model set to models\anim_wp\arm_interior_192\arm_interior_128_paneltop.mdl and place it in the upper position of the lift.

2. Create another prop_dynamic, this time with the model set to models\props_bts\straight_piston_end.mdl. Position it so the top of it touches the underside of the platform model.

Setup (click to enlarge)

3. Create two brushes textured with tools/toolsinvisible following the general shape (see image) of the objects and tie it to a func_door entity.

4. Set the following keyvalues in the func_door:

  • Name = set this to something memorable, like lift_door
  • Speed = 32
  • Start Sound = World.PlatformStart
  • Stop Sound = World.PlatformStop
  • Delay Before Reset = -1
  • Force Closed = Yes
  • Move Direction = 90 0 0
  • Loop moving sound? = Yes
  • Spawn Position = Open if you want the lift to start in the lower position, Closed if you want it to start in the upper position.

And set the following flags:

  • Toggle = true
  • Touch opens = false

4. Set the parent of the platform and piston models to the func_door.

5. Create something to activate the platform. In this example we'll use a prop_floor_button. Give it the following outputs:

  • OnPressed : lift_door (or whatever you named the func_door) : Open (if it starts in the upper position, or Close if it starts in the lower position.)
  • OnUnPressed : lift_door (or whatever you named the func_door) : Close (if it starts in the lower position, or Open if it starts in the upper position.)

The platform should now work as a functioning lift.