Zh/Creating Brush Entities: Difference between revisions

From Valve Developer Community
< Zh
Jump to navigation Jump to search
No edit summary
m (Multipage removal)
 
(33 intermediate revisions by 13 users not shown)
Line 1: Line 1:
__NOTOC__{{first room menu}}
{{LanguageBar|title = 创建固体实体}}
在HAMMER编辑器里, a [[Primitives|Primitive]] 是一个相当简单的笔刷对象.  Primitives can be world geometry or interactive entities subject to physics & damage. In this example, we will create an interactive primitive, subject to physics & damage in the map: specifically, a 32 unit [http://www.oldmanmurray.com/features/39.html crate].


<br style="clear:both">
__NOTOC__
# Select the [[Hammer Block Tool|Block Tool]] [[Image:hammer_block.png|28px]] and create a cube in your map.
{{first room menu:zh-cn}}
# Open the [[Hammer_Texture_Browser|Texture Browser]] and [[Hammer_Texture_Browser#Filter|filter]] for '''dev crate'''.  '''Dev/dev_measurecrate02''' should be a 32x32 crate texture.[[Image:Hammer_primitive_crate.png|thumb|left|Properly-sized cube with 32x32 texture.]]
我们已经{{L|Basic Construction|创建了固体}}。另一方面,我们可以创建{{L|Brush Entity|固体实体}}。固体实体是地图中用于物理运动或产生伤害的可互动实体。
# Apply the '''dev/dev_measurecrate02''' texture to your cube. {{Note|If the grid on your 2D views is too large to get down to 32 units, press the <code>[</code> key or click the '''Smaller Grid''' button [[Image:Hammer_SmallerGrid.png]] to create smaller objects on the grid.}}
# Resize your cube using the [[Hammer Selection Tool|Selection Tool]] [[Image:hammer_select.png|28px]] until the texture fits properly on the cube. {{Note|To this point, creating primitives for world geometry and for interactive objects is the same.  In order to specify whether our crate is, indeed, world geometry or an interactive object, we must select it and move it either [[Hammer_New_Objects_Toolbar#toWorld_.3CCtrl.2BShift.2BW.3E|toWorld]] or [[Hammer_New_Objects_Toolbar#toEntity_.3CCtrl.2BT.3E|toEntity]].}}[[Image:hammer_toEntityButton.png|right|thumb|150px|'''toEntity''' button ('''Ctrl+T''')]]
# Select the crate using the [[Hammer Selection Tool|Selection Tool]].
# Click the [[Hammer_New_Objects_Toolbar#toEntity_.3CCtrl.2BT.3E|toEntity]] button to tie a [[List_of_entities#Function_.28brush.29_entities|function]] to the primitive. This will bring up the [[Hammer_Object_Properties_Dialog|Object Properties]] dialog box.
# Select [[Func_breakable|func_breakable]] from the '''Class:''' drop-down menu.
# Under '''Keyvalues''', select '''Name''' and name your crate something descriptive. [[Image:Hammer_object_properties.png|right|thumb|300px|func_breakable object properties]]
# Under '''Keyvalues''', select '''Strength'''. The Strength value specifies how much damage the crate can take before breaking. Set the value to '''1'''.
# Under '''Keyvalues''', select '''Material Type'''. The material type specifies the sounds the crate will make and also what type of gibs it will break into.  Select '''Wood''' from the drop-down menu.
# Under '''Keyvalues''', select '''Physics Impact Damage Scale'''. This scales damage energy when the object is hit by a physics object. {{Note|A value of '''0''' means this feature is disabled. Set to 1.0 for materials as strong as flesh, smaller numbers indicate stronger materials.}}
# Click '''Apply''' and close the Object Properties dialog box.
<br style="clear:both">


==Crate Texture==
{{todo|添加「固体实体」页面}}
Once our crate is correctly sized, we can apply a proper texture to it using the same technique we used previously.
# Open the [[Hammer_Texture_Browser|Texture Browser]] and [[Hammer_Texture_Browser#Filter|filter]] for '''crate'''.
# Select '''props/woodcrate001a''' and apply it to your cube.  You may have to use the Face Edit Sheet to fit the texture to the cube. {{Note|Ensure that the texture is aligned to '''Face'''.}}
[[Image:Hammer_primitive_crate2.png|thumb|315px|left|Textured functional crate]]


<br style="clear:both">
在此例子中,我们将会创建一个32单位的板条箱。
{{NavBar|Creating a Room|Your First Map|Adding Entities}}


{{otherlang:en}}
[[File:Hammer_primitive_crate.png|thumb|none|大小正好的立方体与32×32的纹理。]]
{{otherlang:en:fr|Applying Textures:fr}}


[[Category:Level Design Tutorials]]
==创建==
# 选择{{L|Hammer Block Tool|固体工具}}[[File:hammer_block.png|28px]]并在你的地图中创建一块立方体。
# 打开{{L|Hammer_Texture_Browser|纹理浏览器}}并[[Hammer_Texture_Browser#Filter|过滤]]出<code>dev crate</code> 。<code>dev/dev_measurecrate02</code>应该是一个 32×32 的板条箱纹理。
# 给你的立方体应用'''dev/dev_measurecrate02'''纹理。 {{tip|如果二维视图的网格大于32单位,可以按下{{key|[}}键或者点击'''缩小网格'''按钮[[File:Hammer_SmallerGrid.png]]以便在网格上创建更小的对象。}}
# 用{{L|Hammer Selection Tool|选取工具}}[[File:hammer_select.png|28px]]调整你的立方体大小,直到纹理与立方体吻合。 {{Note|到此为止,创建固体与创建固体实体是相同的。为了指定箱子的作用,是固体还是一种固体实体,我们必须选取并将之转换为[[Hammer_New_Objects_Toolbar#toWorld|环境]]或[[Hammer_New_Objects_Toolbar#toEntity|实体]]中的一种。}}<p>[[File:Hammer toEntityButton.png|border|Hammer toEntity button|link=]]</p>
# 确保这个立方体处于选中状态,按下{{key|Ctrl+T}}或点击[[Hammer_New_Objects_Toolbar#toEntity|转为实体]]按钮将一样[[List_of_entities#Function_.28brush.29_entities|功能]]绑定到此元素。这会打开{{L|Hammer_Object_Properties_Dialog|对象属性}}对话框。<p>[[File:Hammer_object_properties.png|400px]]</p>
# 从'''类别:'''下拉菜单中选择{{L|Func_breakable|func_breakable}}。
# 在Keyvalues下,选择'''名称'''(Name)并给你的箱子起个有意义的名称。
# 在Keyvalues下,选择'''耐久'''(Strength)。此耐久值指定了箱子在被破坏前可承受多少伤害。设置该值为'''1'''。
# 在Keyvalues下,选择'''材料类型'''(Material Type)。此材料类型指定了箱子会发出何种声音和掉出何种碎片。在下拉菜单中选择'''木头'''(Wood)。
# 在Keyvalues下,选择'''物理撞击伤害比例'''(Physics Impact Damage Scale)。这指定当对象被物理对象击中时造成伤害的比例。{{Note|当值为0时表示此特性不起作用。设置为1.0则材料拥有肉体的强度,数字越小代表材料越坚固。}}
# 点击'''应用'''并关闭对象属性对话框。
 
===应用纹理===
当我们的板条箱具有适当的大小时我们就能用以前用过的技术给它应用合适的纹理。
# 打开{{L|Hammer_Texture_Browser|纹理浏览器}}并[[Hammer_Texture_Browser#Filter|过滤]]出<code>crate</code>。
# 选择<code>props/woodcrate001a</code>并应用给你的立方体。你可能会用到表面编辑选项卡使纹理与立方体吻合。{{Note|请确保纹理是与Face对齐的。}}
[[File:Hammer_primitive_crate2.png|thumb|315px|none|功能性的板条箱贴上纹理后]]
 
==销毁==
要把固体实体转换回普通固体,选择它,点击[[Hammer_New_Objects_Toolbar#toWorld|转为固体]],位于转为实体按钮旁边。
 
{{clr}}
{{Navbar|Creating a Room|Your First Map|Adding Point Entities}}
 
{{ACategory|Hammer}}
{{ACategory|Level Design}}
 
 
{{stub}}

Latest revision as of 06:01, 12 July 2024

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


我们已经创建了固体(en)。另一方面,我们可以创建固体实体(en)。固体实体是地图中用于物理运动或产生伤害的可互动实体。

待完善: 添加「固体实体」页面

在此例子中,我们将会创建一个32单位的板条箱。

大小正好的立方体与32×32的纹理。

创建

  1. 选择固体工具(en)Hammer block.png并在你的地图中创建一块立方体。
  2. 打开纹理浏览器(en)过滤dev cratedev/dev_measurecrate02应该是一个 32×32 的板条箱纹理。
  3. 给你的立方体应用dev/dev_measurecrate02纹理。
    Tip.png提示:如果二维视图的网格大于32单位,可以按下[键或者点击缩小网格按钮Hammer SmallerGrid.png以便在网格上创建更小的对象。
  4. 选取工具(en)Hammer select.png调整你的立方体大小,直到纹理与立方体吻合。
    Note.png注意:到此为止,创建固体与创建固体实体是相同的。为了指定箱子的作用,是固体还是一种固体实体,我们必须选取并将之转换为环境实体中的一种。

    Hammer toEntity button

  5. 确保这个立方体处于选中状态,按下Ctrl+T或点击转为实体按钮将一样功能绑定到此元素。这会打开对象属性(en)对话框。

    Hammer object properties.png

  6. 类别:下拉菜单中选择func_breakable(en)
  7. 在Keyvalues下,选择名称(Name)并给你的箱子起个有意义的名称。
  8. 在Keyvalues下,选择耐久(Strength)。此耐久值指定了箱子在被破坏前可承受多少伤害。设置该值为1
  9. 在Keyvalues下,选择材料类型(Material Type)。此材料类型指定了箱子会发出何种声音和掉出何种碎片。在下拉菜单中选择木头(Wood)。
  10. 在Keyvalues下,选择物理撞击伤害比例(Physics Impact Damage Scale)。这指定当对象被物理对象击中时造成伤害的比例。
    Note.png注意:当值为0时表示此特性不起作用。设置为1.0则材料拥有肉体的强度,数字越小代表材料越坚固。
  11. 点击应用并关闭对象属性对话框。

应用纹理

当我们的板条箱具有适当的大小时我们就能用以前用过的技术给它应用合适的纹理。

  1. 打开纹理浏览器(en)过滤crate
  2. 选择props/woodcrate001a并应用给你的立方体。你可能会用到表面编辑选项卡使纹理与立方体吻合。
    Note.png注意:请确保纹理是与Face对齐的。
功能性的板条箱贴上纹理后

销毁

要把固体实体转换回普通固体,选择它,点击转为固体,位于转为实体按钮旁边。



小作品

This article or section is a stub. You can help by expanding it.