Adding Prop Models: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Temp save. Still working on this, but wanted to comment on another thing first.)
m (bug notice hidetested=1 param on page where it might not make sense)
 
(45 intermediate revisions by 23 users not shown)
Line 1: Line 1:
[[Category:Level Design Tutorials]]
{{LanguageBar}}
 
{{first room menu}}
{{first room menu}}


Prop models are geometry files created in a modeling program such as Softimage|XSI. You can place these prop models in Hammer, like adding props to a movie set.
Prop models are geometry files created in a modeling program such as [[Softimage Mod Tool]]. You can place these prop models in maps like adding props to a movie set.
 
<br clear="both">
 
[[Image:hammer_pickpropstatic.jpg |thumb|right|400px| Select [[prop_static]] from the drop-down list.]]


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.
* ''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).


We will start by adding a static prop.
You will learn how to place and position two of these types in this tutorial.


All props are entities, and handled as such, so switch to the '''Entity Tool''' again.
==== Known bugs in the model browser: ====
{{bug|hidetested=1|When using the filter (search function) the text typed will be typed backwards if the mouse cursor is outside of the model browser. Example: Typing "sign" will be shown as "ngis".}}


Then pick [[prop_static]] from the entity list in the '''Objects Toolbar'''.


{{clr}}


<br clear="both">
[[File:hammer_pickpropstatic.png|thumb|left|200px|Select [[prop_static]] from the drop-down list.]]
[[File:hammer_placepropstatic.png|thumb|right|300px|Place the ''prop_static'' entity on the floor by clicking in the 3D View.]]


[[Image:hammer_placepropstatic.jpg |thumb|right|400px| Place the ''prop_static'' entity on the floor by clicking in the 3D View.]]
We will start by adding a static prop.


Place the ''prop_static'' in the map by clicking on the floor brush in the 3D View.
All props are entities, and handled as such, so switch to the '''Entity Tool''' again.


Double-click it to bring up its properties.
Then pick [[prop_static]] from the entity list in the '''Objects Toolbar'''.


<br clear="both">
Place the ''prop_static'' in the map by clicking on the floor brush in the 3D view.


[[Image:hammer_pickworldmodel.gif |thumb|right|400px| Switch to the World Model field.]]
The result is a little red box. That’s because we haven’t decided what the prop will look like yet.


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


# Click the '''World Model''' field in the '''Object Properties''' dialog.
{{clr}}
# Click the '''Browse''' button to open the model browser.


<br clear="both">
[[File:hammer_pickworldmodel.png|thumb|right|400px|Switch to the World Model field.]]


[[Image:hammer_pickfolder_sm.jpg |thumb|right|400px| Double-click a folder to change to that sub-directory.]]
Switch to the Selection Tool and double-click the ''prop_static'' to bring up its properties.


Double-click the ''props_c17'' folder in the model browser to open the sub-directory.
# Click the '''World Model''' field in the '''Object Properties''' dialog.
# 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.)


<br clear="both">
{{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.}}


[[Image:hammer_pickfence_sm.jpg |thumb|right|400px| Double-click the ''fence01a'' model to select it and close the browser.]]
{{clr}}


<br clear="left">
[[File:Hammer_ModelBrowser_PickFolder.jpg|thumb|right|400px|Click a folder to change to that sub-directory.]]


[[Image:hammer_pickapply_sm.jpg |thumb|right|400px| Click the ''Apply'' button to confirm your changes.]]
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.


Double-click the model <code>fence01a.jpg</code> to select it, as shown here.
Click the ''props_c17'' folder in the model browser to list its models in the lower left window.


The model browser will close and the <code>fence01a</code> will be selected as the model for the <i>prop_static</i> entity.
{{clr}}


<br clear="both">
[[File:Hammer_ModelBrowser_PickFence.jpg|thumb|right|400px|Click the ''fence01a'' model to select it, and then click ''OK'' to close the browser.]]


[[Image:hammer_pickpropphysics.jpg |thumb|right|400px| Pick the prop_physics_multiplayer entity.]]
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 “<code>fence</code>” in the text box just beneath the list.


Click the model file <code>fence01a.mdl</code> to select it.


Notice how the fence model now appears in the 3D View.
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.
Click the '''Apply''' button to commit the changes and see the results in the '''3D View'''.


Now we'll add a prop model with physics properties.
When you’re done with inspecting the preview, confirm your model choice by clicking ''OK''.


Switch to the Entity Tool.
The Model Browser will close and the ''fence01a'' model will be selected as the model for the ''prop_static'' entity.


Choose [[prop_physics_multiplayer]] from the entity list in the Object Toolbar.
[[File:hammer_pickapply_sm.png|thumb|right|400px|Click the ''Apply'' button to confirm your changes.]]


<br clear="both">
Click the ''Apply'' button to commit the changes.
[[Image:hammer_placepropphysics.jpg |thumb|right|400px| Place the ''prop_physics_multiplayer'' entity by clicking the floor in the 3D View.]]


Place the ''prop_physics_multiplayer'' entity into the room by clicking on the floor in the '''3D View'''.
The ''prop_static'' will now change into displaying the fence model you selected in the 3D view.


Now open the '''Object Properties''' dialog by choosing '''Properties''' from the '''Edit Menu''', if it's not already open.
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.  


The '''Object Properties''' dialog will now show the parameters of the ''prop_physics_multiplayer'' entity.


<br clear="both">
{{clr}}


[[Image:hammer_pickbarrel_sm.jpg |thumb|right|400px| After clicking Browser, scroll down to the oildrum001 model, and double-click it.]]
[[File:hammer_pickpropphysics.jpg|thumb|left|100px|Choose the appropriate physics prop entity.]]
[[File:hammer_placepropphysics.png|thumb|right|300px|Place the physics prop entity by clicking the floor in the 3D view.]]


Click the '''Browse''' button in the '''World Model''' field in the '''Object Properties''' dialog to bring up the model browser.
Now let’s add a prop model with physics properties.


Scroll down in the browser and double-click the <code>oildrum001.jpg</code> in the <code>props_c17</code> model directory, as shown here.
Switch to the '''Entity Tool'''.


<br clear="both">
The type of prop_physics entity we’ll need depends on your game choice.


[[Image:hammer_pickapply_sm2.jpg |thumb|right|400px| Click ''Apply'' to make the change and update the 3D View.]]
* 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 [[Counter-Strike: Source]], choose the [[prop_physics_multiplayer]] entity.


Click the '''Apply''' button to confirm your changes.
Choose the appropriate entity from the entity list in the ''Object Toolbar''.


Notice how the barrel model model now appears in the '''3D View next''' to the fence.
Place the physics prop entity somewhere on the floor of the room.


<br clear="both">
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.


[[Image:hammer_closeprop.jpg |thumb|right|400px| Close the Object Properties dialog.]]
{{clr}}


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


<br clear="both">
Again click the '''Browse...''' button in the '''World Model''' field in the '''Object Properties''' dialog to load up the model browser.


=Moving Objects with the Grid=
# Instead of “<code>fence</code>”, search for “<code>oildrum</code>”.
# Pick the <code>oildrum001.mdl</code>.
# Close the browser with ''OK''.


[[Image:hammer_pickselect.jpg |thumb|right|400px| Switch to the Selection Tool.]]
{{clr}}


You may have noticed that the fence model is stuck part-way into the floor. We need to move it up.
[[File:hammer_pickapply_sm2.png|thumb|right|400px|Click ''Apply'' to make the change and update the 3D view.]]


First, switch to the '''Selection Tool''' so we can move the object.
Click the '''Apply''' button to confirm your changes, and the physics prop will change to the barrel model you selected.


<br clear="both">
{{clr}}


[[Image:hammer_selectfence_sm.jpg |thumb|right|400px| Select the fence model in the 3D View by clicking it.]]
[[File:hammer_closeprop.png|thumb|right|200px|Close the '''Object Properties''' dialog.]]


Now select the fence model by clicking on it in the '''3D View'''.
Close the '''Object Properties''' dialog.
 
A yellow box will appear around the model in the '''3D View''', showing that you've selected it.
 
<br clear="both">


[[Image:hammer_selectfence_sm.jpg |thumb|right|400px| Click and drag the fence in the Side View to move it.]]
{{clr}}


Next, we'll move the fence model in the '''2D Side View''', since it's easy to see how it meets the floor.
== Moving objects ==
[[File:hammer_pickselect.png|frame|right|Switch to the Selection Tool.]]


To move the fence, click anywhere side the red bounding box in the '''2D View''', except in the very center of the box. Then drag the mouse cursor to the new location to move it.
Right now the fence model is stuck half-way into the floor. Let’s move it up.


When you drag it, '''make sure you don't accidentally grab one the 4 boxes in the center of the entity'''. These control the distance fading of the object, and we don't want to change that.
Entities are moved just like brushes are:


If you accidentally alter the fade distance controls, just choose '''Undo''' from the '''Edit''' menu to revert the change.
Switch to the '''Selection Tool''' and click on the fence to select it.


You may find that you can't quite line up the bottom of the model with the floor. The current size of the grid prevents it. Get it close as you can, and we'll fix that next.
Then select the fence model by clicking on it in the 3D view.


<br clear="both">
A box will appear around the model in all the views, showing that it has been selected.


[[Image:hammer_movefence_sm.jpg |thumb|right|400px| Decrease the size of the grid so the objects can be moved in finer steps.]]
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)'').


For finer control, click the '''Smaller Grid''' button in the upper left corner of the Hammer window.
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.


The size of the grid controls how objects are lined up to one another.
[[File:hammer_selectfence_sm.png|thumb|left|400px|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.]]


<br clear="both">
{{clr}}


[[Image:hammer_picksmgrid.jpg |thumb|right|400px| With the grid size smaller, the fence can be lined up with the floor.]]
[[File:hammer_picksmgrid.png|frame|right|Decrease the size of the grid so the objects can be moved in finer steps.]]


With a smaller grid, now try moving the fence again. You can see that it's now possible to line it up with the bottom of the floor, as shown.
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:


If you find that you still can't line up the fence with the floor, click the '''Smaller Grid''' button again.
# Click the '''Smaller Grid''' button in the grid toolbar in the upper left corner of the Hammer window.
# Zoom in a bit on where the fence meets the floor, so that you can see better.
# 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.)
{{note|Alternatively, you can use the shortcut key {{key|[}} to decrease the grid size, or the {{key|]}} key to increase it.}}


'''Note:''' It's okay if the ''prop_static'' entity sticks into the floor a little bit.
[[File:hammer_movefence_sm.png|thumb|left|400px|With the grid size smaller, the fence can be lined up with the floor.]]


<br clear="both">
{{clr}}


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


Now onto [[Saving and Compiling]]!
{{Navbar|Adding Light|Your First Map|Saving and Compiling}}
[[Category:Level Design]]
[[Category:Tutorials]]

Latest revision as of 07:05, 20 May 2025

English (en)Français (fr)日本語 (ja)Polski (pl)Português do Brasil (pt-br)Русский (ru)中文 (zh)Translate (Translate)

Prop models are geometry files created in a modeling program such as Softimage 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.

Known bugs in the model browser:

Icon-Bug.pngBug:When using the filter (search function) the text typed will be typed backwards if the mouse cursor is outside of the model browser. Example: Typing "sign" will be shown as "ngis".


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 left 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.
  2. Zoom in a bit on where the fence meets the floor, so that you can see better.
  3. Adjust the height of the fence.
  4. Repeat steps 1–3 until you’re satisfied. (For a perfect fit, you will need to decrease the grid size to 2.)
Note.pngNote:Alternatively, you can use the shortcut key [ to decrease the grid size, or the ] key to increase it.
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.