Download attachment
What is it?
This effect was used in a fun way in the original game. An unpluggable TV is a TV that first shows a scene taken from a camera (entity) that you've placed. When you pick up the TV and drag it a certain distance away from its original spot, the plug will come out of the wall and the TV will switch off.
Setting up the TV
First, you should create something for the TV to sit on, either a brush-based object, or a prop of some sort (
prop_physics or
prop_static).
Now we need our TV. Place a
prop_physics into the map and select a TV model (for this example, we shall use "
models/props_c17/tv_monitor01.mdl", but you are free to find other ones if you wish). Give the newly created prop a name (something simple, like "
TV"). Make sure you align the TV to the table or surface you made previously.
TV on a table
Now, create a brush inside the TV. Turn it into a
func_brush (select the brush, "ToEntity") and give it a name (
TV_screen). Make sure you also input the name of the model into the Parent field (in this case, "
TV"). When creating the brush, make sure it fits into the area of the model that's defined for a screen, otherwise you'll have an overly large (or small) screen. Make sure you give this brush a texture for the front section: the rest of the brush can be textured (and I recommend it) in nodraw. I used
dev_tvmonitor1a, but you can search for one you like in the texture browser. The difference between the textures is the different effects they have: a list of them can be found
here.
Aligned brush
When you have done that, make another brush inside the TV and place it behind the first one. It may be simpler to simple clone the first brush. After you've done this, apply a black texture to it. Turn it into a
func_brush with the parent "
TV". You are now done with the TV itself.
Now, onto the cable system. Place a
keyframe_rope at the back of the TV, like this:
keyframe_rope
Name it "
tv_plug and give it the parent "
TV". You may also want to alter the thickness of the rope, as the default setting may be too thick. Change it to one to get a nice, thin cord.
Now, make a small brush on a wall that we will use as a socket. You can also use a model as a socket. If you make a brush, turn it into a func_brush and name it "
socket". If you use a model, simply name it "
socket"
When you have done that, put a
move_rope in front of the socket and name it "
cable". In its properties, set the next keyframe as "
tv_plug"
When you're done with that, create a
phys_lengthconstraint and set these properties:
Entity 1: socket
Entity 2: TV
Additional length: 32
Play sound on break: Breakable.Computer
Force limit to break (lbs): 50
Keep in mind that it doesn't matter where the entity, as well as the fact that you can easily adjust these settings to suit your own needs. You could create a longer cord if you wanted, as well as a higher force limit to make it more difficult to unplug.
Now, we need to set up some outputs for the
phys_lengthconstraint. Set it up like this:
Outputs
When you're done with this, you should have something like this:
Final
Setting up the camera
Now for the easy part: setting up the camera.
Make a new room somewhere in the map. Put whatever you want to be on the TV screen in that room and then place a point_camera facing the object(s) you want to be shown on the TV. You can put anything: models and brushes will show up, as well as lighting and all the effects. Name the point_camera "
cam01".
Now we need to connect the camera to our screen. To do this, simply add an
info_camera_link and set it up like this:
Name: cameralink
Entity whose material uses rt_ca..: tv_screen
Camera: cam01
Now you're set! Compile and run the map. Simply pick up the TV using E and walk backwards from the plug. The rope will stretch to a certain amount and the connection will sever, removing the image that was on the screen.
I look forward to using this someday, Its really well written and I know what to do by reading it.
I don't think it does ;(
Hold on, it actually does, I tested it