Adding Prop Models: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Changed some images to PNG and made small layout changes)
m (small style changes; proper apostrophes)
Line 11: Line 11:
There are basically three types of props:
There are basically three types of props:
* ''Static'' props will always be stationary in the map.
* ''Static'' props will always be stationary in the map.
* ''Dynamic'' props are props that can be animated and/or move with another object.
* ''Dynamic'' props are props that can be animated and/or can move with another object.
* ''Physics'' props are props that can be tossed about (obeying physics like gravity).
* ''Physics'' props are props that can be tossed about (obeying physics like gravity).


Line 29: Line 29:
Place the ''prop_static'' in the map by clicking on the floor brush in the 3D view.
Place the ''prop_static'' in the map by clicking on the floor brush in the 3D view.


The result is a little red box. That’s because we haven't decided what the prop will look like yet.
The result is a little red box. That’s because we haven’t decided what the prop will look like yet.


We will have to choose a model for this prop to do that.
We will have to choose a model for this prop to do that.
Line 42: Line 42:
# Click the '''Browse...''' button and wait patiently while the '''Model Browser''' list populates. (You will only have to wait once; after that, the list will be cached for future searches.)
# Click the '''Browse...''' button and wait patiently while the '''Model Browser''' list populates. (You will only have to wait once; after that, the list will be cached for future searches.)


{{note|There are currently two types of model browsers in Hammer, depending of whether the ''Use VGUI model browser'' flag is checked in the Hammer options. This tutorial will only focus on the new and default VGUI model browser. The older browser functions a lot like a normal Windows file explorer does.}}
{{note|There are currently two types of model browsers in Hammer, depending of whether the ''Use VGUI model browser'' flag is checked in the Hammer options. This tutorial will only focus on the new and default VGUI model browser. The older browser is similar to a normal Windows file explorer.}}


{{clr}}
{{clr}}
Line 48: Line 48:
[[File:Hammer_ModelBrowser_PickFolder.jpg|thumb|right|400px|Click a folder to change to that sub-directory.]]
[[File:Hammer_ModelBrowser_PickFolder.jpg|thumb|right|400px|Click a folder to change to that sub-directory.]]


Don't worry that it says “ERROR” in big red letters in the preview window of the Model Browser. That’s just because we haven't chosen any model to preview yet.
Don’t worry that it says “ERROR” in big red letters in the preview window of the Model Browser. That’s just because we haven’t chosen any model to preview yet.


Click the ''props_c17'' folder in the model browser to list the models in it in the lower right window.
Click the ''props_c17'' folder in the model browser to list its models in the lower right window.


{{clr}}
{{clr}}
Line 60: Line 60:
Click the model file <code>fence01a.mdl</code> to select it.
Click the model file <code>fence01a.mdl</code> to select it.


A preview of the model will be displayed in the preview window. You can drag your mouse in that window to freely rotate the model if you want.
A preview of the model will be displayed in the preview window. You can drag your mouse in that window to freely rotate the model.


When you're done with inspecting the preview, confirm your choice of the model by clicking ''OK''.
When you’re done with inspecting the preview, confirm your model choice by clicking ''OK''.


The Model Browser will close and the ''fence01a'' model will be selected as the model for the ''prop_static'' entity.
The Model Browser will close and the ''fence01a'' model will be selected as the model for the ''prop_static'' entity.
Line 72: Line 72:
The ''prop_static'' will now change into displaying the fence model you selected in the 3D view.
The ''prop_static'' will now change into displaying the fence model you selected in the 3D view.


You can also change the direction the fence faces by changing the pitch yaw and roll settings or using the angle circle and typing in a value of 0 to 360.  
You can also change the direction the fence faces by changing the pitch yaw and roll settings or using the angle circle and typing in a value between 0 and 360.  




Line 80: Line 80:
[[File:hammer_placepropphysics.png|thumb|right|300px|Place the physics prop entity by clicking the floor in the 3D view.]]
[[File:hammer_placepropphysics.png|thumb|right|300px|Place the physics prop entity by clicking the floor in the 3D view.]]


We will now add a prop model with physics properties.
Now let’s add a prop model with physics properties.


Switch to the '''Entity Tool'''.
Switch to the '''Entity Tool'''.


The type of prop_physics entity we are going to choose depends on what game your map is for.
The type of prop_physics entity we’ll need depends on your game choice.


* If you are mapping for [[Half-Life 2]]: Single Player, choose the [[prop_physics]] entity.
* If you are mapping for [[Half-Life 2]]: Single Player, choose the [[prop_physics]] entity.
* If you are mapping for [[Half-Life 2: Deathmatch]], choose the [[prop_physics]]/[[prop_physics_respawnable]] entity. (Do '''NOT''' choose the [[prop_physics_multiplayer]] entity, because gravity gun can't interact with it.)
* If you are mapping for [[Half-Life 2: Deathmatch]], choose the [[prop_physics]]/[[prop_physics_respawnable]] entity. (Do '''NOT''' choose the [[prop_physics_multiplayer]] entity, because gravity gun can’t interact with it.)
* If you are mapping for [[Counter-Strike: Source]], choose the [[prop_physics_multiplayer]] entity.
* If you are mapping for [[Counter-Strike: Source]], choose the [[prop_physics_multiplayer]] entity.


Line 94: Line 94:
Place the physics prop entity somewhere on the floor of the room.
Place the physics prop entity somewhere on the floor of the room.


Re-open the '''Object Properties''' dialog if you've closed it, to display the properties of the physics prop. Otherwise the dialog will automatically have changed to display its properties.
Re-open the '''Object Properties''' dialog if you’ve closed it to display the properties of the physics prop. Otherwise the dialog will automatically have changed to display its properties.


{{clr}}
{{clr}}


[[File:Hammer_ModelBrowser_PickOildrum.jpg|thumb|right|400px|After having opened the browser, search for <code>oildrum</code>, choose the ''oildrum001'' model, and click ''OK''.]]
[[File:Hammer_ModelBrowser_PickOildrum.jpg|thumb|right|400px|After opening the browser, search for <code>oildrum</code>, choose the ''oildrum001'' model, and click ''OK''.]]


Again click the '''Browse...''' button in the '''World Model''' field in the '''Object Properties''' dialog to load up the model browser.
Again click the '''Browse...''' button in the '''World Model''' field in the '''Object Properties''' dialog to load up the model browser.
Line 123: Line 123:
[[File:hammer_pickselect.png|frame|right|Switch to the Selection Tool.]]
[[File:hammer_pickselect.png|frame|right|Switch to the Selection Tool.]]


You may have noticed that the fence model is stuck half-way into the floor. We are going to move it up now.
Right now the fence model is stuck half-way into the floor. Let’s move it up.


Entities are moved just like brushes are:
Entities are moved just like brushes are:
Line 146: Line 146:


# Click the '''Smaller Grid''' button in the grid toolbar in the upper left corner of the Hammer window.
# Click the '''Smaller Grid''' button in the grid toolbar in the upper left corner of the Hammer window.
{{note|Alternatively, you can use the shortcut key {{key|[}} to decrease the grid size, or the {{key|]}} key to increase the grid size}}
{{note|Alternatively, you can use the shortcut key {{key|[}} to decrease the grid size, or the {{key|]}} key to increase it}}
# Zoom in a bit on where the fence meets the floor, so that you can see better.
# Zoom in a bit on where the fence meets the floor, so that you can see better.
# Adjust the height of the fence.
# Adjust the height of the fence.
# Repeat steps 1-3 until you're satisfied. (For a perfect fit, you will need to decrease the grid size to 2.)
# Repeat steps 1-3 until you’re satisfied. (For a perfect fit, you will need to decrease the grid size to 2.)


[[File:hammer_movefence_sm.png|thumb|left|400px|With the grid size smaller, the fence can be lined up with the floor.]]
[[File:hammer_movefence_sm.png|thumb|left|400px|With the grid size smaller, the fence can be lined up with the floor.]]
Line 155: Line 155:
{{clr}}
{{clr}}


You are finally done with the blueprints for this map.
Now you are finally done with the blueprints for this map.


{{Navbar|Adding Light|Your First Map|Saving and Compiling}}
{{Navbar|Adding Light|Your First Map|Saving and Compiling}}

Revision as of 13:21, 1 May 2012

Template:Otherlang2

Prop models are geometry files created in a modeling program such as XSI Mod Tool. You can place these prop models in maps like adding props to a movie set.

There are basically three types of props:

  • Static props will always be stationary in the map.
  • Dynamic props are props that can be animated and/or can move with another object.
  • Physics props are props that can be tossed about (obeying physics like gravity).

You will learn how to place and position two of these types in this tutorial.

Select prop_static from the drop-down list.
Place the prop_static entity on the floor by clicking in the 3D View.

We will start by adding a static prop.

All props are entities, and handled as such, so switch to the Entity Tool again.

Then pick prop_static from the entity list in the Objects Toolbar.

Place the prop_static in the map by clicking on the floor brush in the 3D view.

The result is a little red box. That’s because we haven’t decided what the prop will look like yet.

We will have to choose a model for this prop to do that.

Switch to the World Model field.

Switch to the Selection Tool and double-click the prop_static to bring up its properties.

  1. Click the World Model field in the Object Properties dialog.
  2. Click the Browse... button and wait patiently while the Model Browser list populates. (You will only have to wait once; after that, the list will be cached for future searches.)
Note.pngNote:There are currently two types of model browsers in Hammer, depending of whether the Use VGUI model browser flag is checked in the Hammer options. This tutorial will only focus on the new and default VGUI model browser. The older browser is similar to a normal Windows file explorer.
Click a folder to change to that sub-directory.

Don’t worry that it says “ERROR” in big red letters in the preview window of the Model Browser. That’s just because we haven’t chosen any model to preview yet.

Click the props_c17 folder in the model browser to list its models in the lower right window.

Click the fence01a model to select it, and then click OK to close the browser.

There are a lot of models in this folder, so instead of scrolling through the entire list, we can simply filter the content like we did with the texture browser, by typing in "fence" in the text box just beneath the list.

Click the model file fence01a.mdl to select it.

A preview of the model will be displayed in the preview window. You can drag your mouse in that window to freely rotate the model.

When you’re done with inspecting the preview, confirm your model choice by clicking OK.

The Model Browser will close and the fence01a model will be selected as the model for the prop_static entity.

Click the Apply button to confirm your changes.

Click the Apply button to commit the changes.

The prop_static will now change into displaying the fence model you selected in the 3D view.

You can also change the direction the fence faces by changing the pitch yaw and roll settings or using the angle circle and typing in a value between 0 and 360.


Choose the appropriate physics prop entity.
Place the physics prop entity by clicking the floor in the 3D view.

Now let’s add a prop model with physics properties.

Switch to the Entity Tool.

The type of prop_physics entity we’ll need depends on your game choice.

Choose the appropriate entity from the entity list in the Object Toolbar.

Place the physics prop entity somewhere on the floor of the room.

Re-open the Object Properties dialog if you’ve closed it to display the properties of the physics prop. Otherwise the dialog will automatically have changed to display its properties.

After opening the browser, search for oildrum, choose the oildrum001 model, and click OK.

Again click the Browse... button in the World Model field in the Object Properties dialog to load up the model browser.

  1. Instead of "fence", search for "oildrum".
  2. Pick the oildrum001.mdl.
  3. Close the browser with OK.
Click Apply to make the change and update the 3D view.

Click the Apply button to confirm your changes, and the physics prop will change to the barrel model you selected.

Close the Object Properties dialog.

Close the Object Properties dialog.

Moving objects

Switch to the Selection Tool.

Right now the fence model is stuck half-way into the floor. Let’s move it up.

Entities are moved just like brushes are:

Switch to the Selection Tool and click on the fence to select it.

Then select the fence model by clicking on it in the 3D view.

A box will appear around the model in all the views, showing that it has been selected.

To move something along the z axis (up or down), you’ll need to move it in one of the lower views (named front (y/z) or side (x/z)).

Click inside the red bounding box in one of these 2D views, and then drag the fence upward until it’s closer to the floor.

Select the fence model in the 3D view by clicking it, and then click and drag the fence in one of the lower views to move it.
Decrease the size of the grid so the objects can be moved in finer steps.

You may find that you can’t quite line up the bottom of the model with the floor because the current size of the grid prevents it. It won’t matter that much if the fence sticks somewhat into the floor, but if you want it exactly aligned you will need to decrease the grid size:

  1. Click the Smaller Grid button in the grid toolbar in the upper left corner of the Hammer window.
Note.pngNote:Alternatively, you can use the shortcut key [ to decrease the grid size, or the ] key to increase it
  1. Zoom in a bit on where the fence meets the floor, so that you can see better.
  2. Adjust the height of the fence.
  3. Repeat steps 1-3 until you’re satisfied. (For a perfect fit, you will need to decrease the grid size to 2.)
With the grid size smaller, the fence can be lined up with the floor.

Now you are finally done with the blueprints for this map.