Adding Point Entities: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(redid presentation (same content). Re-ordering brush and point entity articles.)
Line 1: Line 1:
{{otherlang2
| ru = Adding Entities:ru
| zh-cn = Adding_Entities:zh-cn
}}
{{first room menu}}
{{first room menu}}


Next, we'll insert some [[entities]] into the map.
Now we'll '''add some [[entities]]''' to the map. Entities are objects which have behaviors, and which can (usually) be interacted with somehow.
 
[[Image:hammer_pickentity1.jpg|thumb|left|200px|Switch to the [[Entity Tool]].]]<br>
 
Entities are placed using the [[Entity Tool]] [[Image:Mt-entities.png]]. Select it from the left side icon bar.
 
{{clr}}
 
[[Image:hammer_pickIPD.jpg |thumb|right|400px|Pick the appropriate entity from the drop-down list of entities.]]<br>
 
Next we pick which entity to insert. There is a [[List of entities|list of possible entities]] in the '''Object Toolbar''' (by default in the lower right corner of the Hammer window).
 
The first entity that we will pick is where the player will spawn when he enters the map. What entity to choose from the list depends on what game you are creating this map for.
 
* If you are creating a map for [[Half-Life 2: Deathmatch]], the game will spawn the player at the [[info_player_deathmatch]] entity. If the [[info_player_deathmatch]] does not appear in the list, then follow these steps:
:* Close Hammer
:* From the [[Source SDK]] screen, set the '''Current Game''' to <code>Half-Life 2: Deathmatch</code>
:* Launch Hammer again
* If you are creating a ''single player'' map for [[Half-Life 2]], the game will spawn the player at the [[info_player_start]] entity.
 
Choose the appropriate entity from the drop-down list.
 
:[[image:tip.png]] '''Tip:''' To save time, you can also simply type the name of the entity directly into the drop-down box, instead of scrolling through the entire list to find it.
 
{{clr}}
 
[[Image:hammer_placeentity.jpg|thumb|right|400px|Left-click on the floor in the 3D View to place the starting entity.]]
 
Next we'll place this entity in the map. When placing entities aligned with a surface, you can do this simply by clicking where on the surface you want it in the '''3D View''', so click somewhere on the floor of the room, like in the image here, and the entity will be placed at the spot you click.
 
{{clr}}
 
[[Image:hammer_pick357.jpg|thumb|left|200px|Pick the [[weapon_357]] from the entity list.]]
 
[[Image:hammer_place357.jpg|thumb|right|400px|Place the [[weapon_357]] on the floor.]]
 
Next we will place a weapon.
 
Pick the [[weapon_357]] entity from the entity list in the '''Object Toolbar''', as shown to the left.
 
The [[weapon_357]] entity will spawn the [[weapon 357|.357 magnum revolver]] where it is placed.
 
Click in the '''3D View''' to place the [[weapon_357]] entity, just like you did with the player starting point, as shown to the right.
 
{{clr}}
 
[[Image:hammer_pick357ammo.jpg|thumb|left|200px|Pick the [[item_ammo_357]] from the entity list.]]
 
[[Image:hammer_place357ammo.jpg|thumb|right|400px|Place the [[item_ammo_357]] next to the [[weapon_357]].]]
 
Next we will place some ammo.
 
Pick the [[item_ammo_357]] entity from the entity list.


This entity is a [[item ammo 357|box of .357 ammo]] for the magnum revolver.
This page covers [[point entities]], which are those that exist at a single point on the grid. [[Brush entities]], which are covered by the next article, are slightly different.


Place the [[item_ammo_357]] entity next to the [[weapon_357]], as shown.
# Entities are placed using the {{hammer entity}}. Select it with {{key|Shift+E}}, or from the left-hand icon bar:<p>[[File:Hammer pickentity1.jpg|border|200px|Switch to the [[Entity Tool]].]]</p>
# Next we pick which entity to insert. There is [[:Category:Entities|a list of available entities]] in the Object Toolbar, [[:File:Hammer pickIPD.jpg|which is in the lower-right corner of the Hammer window]]. The one that we want at the moment is a spawn location for the player. Its exact name varies slightly: {{tip|You can search the list by typing into its text box. There is rarely any need to scroll around.}}
#* Singleplayer game: [[info_player_start]]
#* Deathmatch game: [[info_player_deathmatch]]
#* Team game: info_player_<team> (terrorist/counterterrorist, axis/allies, etc.)
# Now we'll place this entity in the map. When placing entities aligned with a surface, you can do this simply by clicking where on the surface you want it in the '''3D View''', so click somewhere on the floor of the room, like in the image here, and the entity will be placed at the spot you click:<p>[[File:Hammer placeentity.jpg|border|400px|Left-click on the floor in the 3D View to place the starting entity.]]</p> {{tip|You can also position entities by clicking in a 2D view and dragging around the crosshairs that appear. When you're happy, with your mouse still over a 2D view hit {{key|Enter}} to create the entity. (Dragging works ''after'' they've been created too!)}}
# Most Source games involve shooting guns, so let's place one. Weapons also vary from game to game, of course, but they ''always'' have names starting with "<code>weapon_</code>". You can search the entity list for that term to see a list of what's available. If you're working with anything related to Half-Life 2 you'll have the option of creating a [[weapon_357]], like this:<p>[[File:Hammer pick357.jpg|border|260px|Pick the [[weapon_357]] from the entity list...]] [[File:Hammer place357.jpg|border|400px|..and place it on the floor.]]</p>
# Depending on the rules of the game you're working with, you may need to create ammunition for the gun too before the player is able to fire it. Not all games provide ammo entities however, and it's not obvious which ammo type goes with which weapon even for those that do. Try searching for "<code>item_ammo_</code>" entities, but if that fails you can always use the [[developer console]] to enable [[sv_cheats|cheats]], and then give yourself ammo (after picking the weapon up) with the "<code>givecurrentammo</code>" command.


{{clr}}
'''With a player start placed, you can compile your map and walk around in it without seeing any strange warnings.'''
{{Navbar|Applying Textures|Your First Map|Adding Light}}


{{otherlang:en}}
{{Navbar|Applying Textures|Your First Map|Creating Brush Entities}}
{{otherlang:en:zh-cn|Adding_Entities:zh-cn}}


[[Category:Level Design Tutorials]]
[[Category:Level Design Tutorials]]

Revision as of 11:58, 28 August 2009

Template:Otherlang2

Now we'll add some entities to the map. Entities are objects which have behaviors, and which can (usually) be interacted with somehow.

This page covers point entities, which are those that exist at a single point on the grid. Brush entities, which are covered by the next article, are slightly different.

  1. Entities are placed using the Entity tool Mt-entities.png. Select it with Shift+E, or from the left-hand icon bar:

    Switch to the Entity Tool.

  2. Next we pick which entity to insert. There is a list of available entities in the Object Toolbar, which is in the lower-right corner of the Hammer window. The one that we want at the moment is a spawn location for the player. Its exact name varies slightly:
    Tip.pngTip:You can search the list by typing into its text box. There is rarely any need to scroll around.
  3. Now we'll place this entity in the map. When placing entities aligned with a surface, you can do this simply by clicking where on the surface you want it in the 3D View, so click somewhere on the floor of the room, like in the image here, and the entity will be placed at the spot you click:

    Left-click on the floor in the 3D View to place the starting entity.

    Tip.pngTip:You can also position entities by clicking in a 2D view and dragging around the crosshairs that appear. When you're happy, with your mouse still over a 2D view hit Enter to create the entity. (Dragging works after they've been created too!)
  4. Most Source games involve shooting guns, so let's place one. Weapons also vary from game to game, of course, but they always have names starting with "weapon_". You can search the entity list for that term to see a list of what's available. If you're working with anything related to Half-Life 2 you'll have the option of creating a weapon_357, like this:

    Pick the weapon_357 from the entity list... ..and place it on the floor.

  5. Depending on the rules of the game you're working with, you may need to create ammunition for the gun too before the player is able to fire it. Not all games provide ammo entities however, and it's not obvious which ammo type goes with which weapon even for those that do. Try searching for "item_ammo_" entities, but if that fails you can always use the developer console to enable cheats, and then give yourself ammo (after picking the weapon up) with the "givecurrentammo" command.

With a player start placed, you can compile your map and walk around in it without seeing any strange warnings.