Combine Binoculars

Tutorial collection, comprehensive listings on main site.

Combine Binoculars

Postby Tutorial on Sat Jan 21, 2006 3:46 pm

category
General Half-Life 2/Entities

description
Covers setting up a binoculars prop and allows to player to look through and see a zoomed in view.

keywords
combine, binoculars, point_viewcontrol, path_track, binocular.

This tutorial teaches you how to make the combine binoculars using a point_viewcontrol and several path_track entities.

A preview of the effect:
Image

To begin, we will need the following things in Hammer:

* A room to put the binoculars in.

* An area for the binoculars to be looking at. This can be a separate “room” or can be in the same area as the binoculars, but must be far enough away for the effect to work well. In HL2, they used the second method, because the area they wished to make the binoculars look at was already part of the level (Which was 6000 Hammer units away! Note that I have modified the values used to make it work over a much smaller distance).

We will begin by setting up the room for the spy post. The entities you will need are as follows:

* prop_static
* env_zoom
* env_screenoverlay
* ambient_generic
* func_door
* trigger_multiple

Please note that func_door and trigger_multiple are brush-based entities.

Here's the setup in Hammer:

Image

Image

In-game:

Image

Image

Now we will configure our entities. Select the prop_static and go into its properties (double-click it in the 3D view or press alt+enter) Change the World Model Keyvalue to models/props_combine/combine_binocular01.mdl. Position it where you wish for the binoculars to be.

Next, go to the env_zoom entity and go into it’s properties. Change the Keyvalues Name Seconds to reach target and Target FOV to telescope_zoom, 0, and 30 respectively.

Open the properties for the env_screenoverlay entity and set it’s name to scrnoverlay_binoc. Select Overlay Name 1 and put effects/combine_binocoverlay Finally, change Overlay Duration 1 to -1. This will make it stay forever, until it is told to turn off via triggers.

Now onto the ambient_generic. Set it’s name to telescope_sound. The Sound Name should be NPC_CombineCamera.Click, and the Volume set to 10 and Max Audible distance should be 1250. Leave everything else at default. Place it directly above the prop_static.

For the func_door, you will need to create a brush, texture it with the tools/toolsnodraw texture and press ctrl+t or click the tie to entity button at the middle right of the interface. An Object properties dialog box will pop up. In the Class Drop down list, select func_door and click apply. Set the Name Keyvalue to telescope_button. Leave everything else at default. Now click the Flags tab at the top of the Object Properties window, and uncheck everything except Toggle, Use Opens, and Starts Locked.Close properties box and resize the brush until it fits over the lens of the binoculars. This is where you will press E to activate it.

For the trigger_multiple, select the brush tool again, and create a brush that will cover a large area around the binoculars. Once again, tie it to an entity by pressing ctrl+t. In the dialog box that pops up, change the Class to Trigger_Multiple. Select the Delay before Reset property and change it to 1. Use this image as a guide:

Image

Now for the area that you want to look through the binoculars at. The entities you will need are:

* Point_viewcontrol
* Info_target
* Func_tracktrain
* Path_track (2)

The setup:
Image

In-game:
Image

Image

Select your func_viewcontrol and go into it’s properties. Set the Name Keyvalue to telescope and Entity to look at to telescope_viewtrack. Also, check the following flags:

* infinite hold time
* Snap to goal angles
* Interruptible by player

Place it where you want to be viewing from.

Select your info_target and name it it_binoc. Place it a couple of “meters” away from the func_viewcontrol, directly in it’s line of site.

Create a new brush, texture it with nodraw, and tie it to a func_tracktrain (Valve made theirs a diamond shape so that it would stand out.). Name it Telescope_viewtrack. Set First Stop Target to telescope_viewtrack_1. We haven’t yet created this entity so it will appear red until we do. Set it’s Max Speed to 75. Leave everything else at it’s default. Enter the Flags tab and check everything except HL1 Train, Use max speed for pitch shifting move sound, and is unblockable by player.

Now create two path_track entities and place them at the ends of the path you want the camera to follow. This is the secret Valve doesn’t want you to know about. :wink: Select one of the path_track entities and name it telescope_viewtrack_1. Now set Next stop target to telescope_viewtrack_2. It should appear red because we haven’t named this entity yet. Leave everything else at default and uncheck all of it’s flags. Now select the other path_track and name it telescope_viewtrack2 and set the Next stop target to telescope_viewtrack1. This will make the camera repeatedly pan from left to right, then left again.

We’re done! (I wish!) We’re only half way through. Now we have to code the outputs. I will make it easier for myself and just show screenshots of the output pages instead. So here we go.

* Func_door (telescope_button)
Image

* trigger_multiple
Image

* point_viewcontrol (telescope)
Image

And that’s it! If I get the time some other day, I might edit this post and add the output code myself, to compliment the screens. All you have to do now is compile and run! Thankyou for reading my first mapping tutorial ever!

Sauce.
- Don't send PM's to this user -
Tutorial
Not A Real User
 
Joined: Sun Mar 06, 2005 11:00 pm

Postby Ripper_hugme on Mon Jan 30, 2006 8:56 am

can this be done in multiplayer?
Barely working on (I'm still very busy with real life):
cp_yettobenamed (Updated... Sort of)
dm_agoge (Beta 2 out now)
User avatar
Ripper_hugme
Veteran
Veteran
 
Joined: Tue Apr 12, 2005 9:01 am
Location: Australia: Now a Major Motion Picture!

Postby Sauce on Mon Apr 17, 2006 12:32 pm

I presume it would be possible, if all the entities required are available in the game you need to use it, then yes.
Image
Blink wrote:Do you watch porn and decide you don't need to have sex because you've seen the ending? :-D

zombie@computer wrote:what retarded countries measure in stones anyway?
or feet? or inches? Your dick is a lot longer in cms
User avatar
Sauce
Senior Member
Senior Member
 
Joined: Sat Nov 26, 2005 4:36 am
Location: Australia

Return to Tutorials

Who is online

Users browsing this forum: No registered users