Creating props

Props help to decorate the world. They take less computer power to render and simulate than world geometry, but you need third-party software in order to create them. All props are point entities and are placed into the map with the entity tool.

Creating static props

Most of the props used in a Source map are static props. Static props account for any nonmoving (static) object. Light posts, wall clocks, trees, and pipes are all examples of items that can be static props. Let's place a tree on the dirt mound we have just created.

Creating static props

In the Objects drop-down, select prop_static and then left-click on the dirt mound in the 3D window to place a prop_static entity. It will be displayed as a red box. Left-click on it twice or hit Alt + Enter to bring up the object properties. In order to define which model we want to use for the prop, select the World model property, and click on browse to bring up the Model Browser window.

Creating static props

The model browser allows you to filter and search for all the models you can place in a map. Below the 3D preview, there are five tabs that give you more information about the model. The Render tab allows you to view different features of the model such as the wireframe view and collision mesh. The Sequences tab lists all the animations for the model, while the Activities tab lists some special model functions that make use of the animations. Each model has at least one Skin attributed to it that defines which textures it uses, and the Info tab will list some special properties of the model and tell you if it can be a static, physics, or a dynamic prop.

Type tree into the Filter to search for all the available tree models, and select models/props_foliage/tree_deciduous_03a.mdl. Check the Info tab to make sure that the Static tab is checked, which means this model can be used as a static prop. Click on Ok to close the browser and return to the prop_static properties window. The only thing left to do now is to fine-tune the entity placement and make sure the tree is intersecting with the displacement.

Static props greatly increase the look and feel of your maps, but they don't move. If we want some props we can interact with, we need a physics prop.

Creating physics props

Physics props take advantage of the Source's physics engine. They interact with the player, world geometry, and other models, and have the ability to break apart into pieces known as gibs. Physics props are placed into the world just like static props are, but they use the prop_physics point entity. Let's place a breakable chair into the map to see what the physics engine can do. Place a prop_physics entity on the floor inside the house; open its properties and then the model browser via the world model property. Select the models/props_c17/furniturechair001a.mdl model and look at the Info tab in the Model Browser window. Note that the physics and staticstatic boxes are checked. This means that this model can act as a static prop or a physics prop. If the physics prop box was not checked, the compiler will report that as an error, and the model will not appear when you go to view it in the game.

Creating physics props

Place a weapon_crowbar point entity on the ground next to the chair so that we can test the gib functionality in the game. Compile the map, load it up, and see how the chair reacts to physics, collisions, and damage.

Creating physics props

Creating dynamic props

Dynamic props, like the name suggests, have the ability to move. They do not move in reaction to physics inputs; rather, their animations are controlled with triggers. They are placed in the map just like a static or physics prop, the only difference being the entity they are created with, which is prop_dynamic. You will learn more about controlling these props in Chapter 7, Triggers and the Input/Output System, when you get more acquainted with the Input/Output system, but for now, just know that they exist!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.12.207