Make things fly through Pneumatic Vents
You have certain see the "animated" Pneumatic Diversity Vents in the Portal 2 maps made by Valve and you maybe have wondered how to make them in your own maps. Unfortunatley Valve used animations with prop_dynamic for the animation and they are not documented (also they would work only for some specific Tube geometries), so you can not use them for our purpose.
But there is another method: Based on this tutorial I have created a simple to use instance, that does almost everything for you. It will chose random between a turret, a weighted cube or a reflector cube and will move this through the vent while rotating it.
Follow these steps to use it:
- Build a pipe out of prop_static with the proper models.
- Create a track out of path_track entities following the tube geometry: Create one and give it a name (the name must begin with an @ or it wont work! ). Then press shift and drag the path_track to the next position in your track.
- For the last path_track entity open the Properties and set the set the Keyvalue "Next Stop Target" to the name of your start track.
- It should look a closed loop like this now:
- For the first path_track set the "Teleport to THIS path_track":
- Download this instance file and copy it into your instances/user folder
- Create a new func_instance and set VMF Filename to "instances/user/animated_tube.vmf" (or your path if it differs) and give the instance a fixup-name
- Now will have a screen like this:
- You must set the "$track" name to the start path_track entity you have just created.
- On the end track you have to create an output with "My Output" = OnPass , "Target Entity" = [the fix-up name of your instance] and "Via this input" = "instance:chose_random;Trigger":
- Optionally you can set some parameters to change the behaviour of the instance:
- $rotation_speed : this option sets the speed of the rotation of the created object
- $initial_speed and $max_speed : set the correspodending values for the func_tracktrain that moves the obects over the track. Shortly: It controls the Velocity of the movement through the vent.
- $max_pause : When the object reach the end of the track, it waits a random time until it moves again. This value control the maximum waiting time. Set it to zero to restart the movement immediately.
If you have questions or ideas then write them in the comments please!