Difference between revisions of "Sound and Music:zh-cn"

From Valve Developer Community
Jump to: navigation, search
(Created page with "{{otherlang2 |title=声音与音乐 |en=Cables_and_Ropes |ru=Cables_and_Ropes:ru }} {{Abstract Mapping:zh-cn}} __NOTOC__ '''Cables''' provide a simple method for adding move...")
 
 
Line 6: Line 6:
 
{{Abstract Mapping:zh-cn}}
 
{{Abstract Mapping:zh-cn}}
  
__NOTOC__
+
{{todo|There needs to be a brief description or link to a tutorial or guide on how to take an existing .wav file and make it accessible to the Hammer Sound Browser or Face Poser.}}
'''Cables''' provide a simple method for adding movement and complexity to a scene for a relatively low cost. Cables can be strung between moving objects and used as a visual representation between physical constraints (springs, length constraints, etc). Cables can also dynamically be shaken or broken by level events.
 
{{note|Cables are ''not'' solid unless you make them that way. To suspend an object by a cable you must also use a physics constraint. Details below.}}
 
  
== Placement ==
 
[[Image:hammer_cables.jpg|frame|A cable strewn between two points in Hammer.]]
 
  
Cables are strewn through a level using the [[move_rope]] and [[keyframe_rope]] entities. First, place a <code>move_rope</code> entity at one desired anchor point for the rope. Next, place a <code>keyframe_rope</code> at the second anchor point. Point the "Next Keyframe" field on the <code>move_rope</code> to the <code>keyframe_rope</code> entity. You'll now see a line representing an estimation of how the cable will lie between the two points. Cloning the <code>keyframe_rope</code> entity will automatically rename the new entity and point the entity that was cloned from to that new entity. Using this method you can quickly lay out cables through multiple points (like power lines).
+
'''Sound''' in Source can be processed in many ways. It can emit from a location in the world, have its pitch or volume altered, trigger behaviours from NPCs, and be lip synced.
  
== Appearance ==
+
Any sound can be played as '''music''' by prefixing it's path with <code>#/</code>. <code>#/music/sound.wav</code> or <code>#/ui/gamestartup.mp3</code> works.
Cables have a certain amount of "slack", which is the amount of bend they have while resting between their two anchor points. Slack helps give the cables a greater sense of motion and believability. The value entered into the entity field dictates how much "extra" cable there is between the two anchor points. This is equivalent to stretching the cable directly between the two points, then adding the specified number of units to that length. As the cable moves, the slack is not recalculated, so a cable that initially droops due to slack will become taut if one of the end points moves away from the other. Likewise, a taut cable will begin to droop if its end points move closer together. (NOTE: The keyframe_rope entitiy includes a flag marked 'Auto Resize' which will recalculate the slack on the rope in realtime. This is extremely useful for things like a crane raising an object or a counterweighted elevator.) The line representing the estimated lie of the cable in Hammer will update itself based on the values entered, and may be used as a guide for how the cable will look when seen in the engine.
 
  
== Behavior ==
+
== Entities ==
Cable anchor points may be placed in [[Entity_Hierarchy_(parenting)|hierarchy]] with other objects, and will move along with those entities. In the sample map provided in the SDK, a [[func_door|moving door]] (cleverly disguised as a pole) provides a dynamic anchor point for two cables. As the door moves, the cables stretch and move to maintain their span. In addition, a timed [[env_shake]] entity periodically moves all the anchor points, causing the cables to "bounce." These techniques can be a very effective visual tool for adding movement and polish to simple moving pieces in the world.
+
*[[ambient_generic]] &mdash; this is the basic entity to play a specific sound, including music
 +
*[[ambient_music]] &mdash; {{l4d2}} audio in the music layer, overriding music queued by the AI Director.
 +
*[[env_soundscape]] plays background noises (see [[Soundscapes]])
 +
*[[env_soundscape_proxy]] Point entity that acts like a soundscape but gets all of its sound parameters from another [[env_soundscape]] entity.
 +
*[[env_soundscape_triggerable]] Point entity just like [[env_soundscape]] except that it works in conjunction with the [[trigger_soundscape]] entity to determine when a player hears it.
 +
*[[trigger_soundscape]] Brush-based soundscape trigger. Does not need outputs, as it automatically triggers the soundscape specified by its Soundscape property.  
 +
*[[env_microphone]] &mdash; detects sounds
 +
*[[env_speaker]] &mdash; plays sounds based on a set of [[Response System]] rules
 +
*[[scripted_sentence]] &mdash; used to make an [[NPC]] speak an idea
 +
*[[sound_mix_layer]] &mdash; {{l4d2}} used to set a mix layer to a specific value.
 +
*[[logic_choreographed_scene]] &mdash; used for conversations and other sequences. See [[:Category:Choreography]].
  
It is possible to detach cables from their anchor points, either by a player's direct action or by triggering it to do so. When a cable receives a "Break" input, it will detach itself from the anchor point which received the input. A cable will also detach itself from an anchor point if that point is parented via hierarchy to an entity which is killed. In the sample map provided in the SDK, add a weapon_crowbar entity to the map. The tattered pole (a [[func_breakable]]) on the left-most side of the map can be broken with the crowbar. When the pole breaks, it triggers a "Break" output to the anchor point at its top and the cable attached to it will fall to the ground.
+
== Articles ==
 +
*[[:Category:Sound System]] &mdash; how sound works in Source
 +
*[[Hammer Sound Browser]] &mdash; documents the [[Hammer]] user interface for browsing sounds
 +
*[[Soundscapes]] &mdash; background sounds in a map
 +
*[[Sound sensitive trigger]] &mdash; how to trigger an event based on the loudness
 +
*[[Startup Music]] &mdash; one way to add music to a mod's title screen (alternatively, put it in a [[Menu Background Map]])
  
By default, cables are not solid and will pass through world geometry. In some cases (especially when cables are broken), this can be visually unacceptable. By using the "Collide With World" setting on the entity, the cable can be made to collide with world geometry. Because this makes the cable more expensive, this setting is only recommended for cables that exhibit the problem of penetrating the world.
+
== AI sounds ==
 +
* AI sounds are not audible to the player; they are purely an [[:Category:AI|AI]] construction. They can be placed in-map with the [[ai_sound]] entity.
  
== Example maps ==
+
== Music ==
* <code>sdk_cables.vmf</code>
+
* [[Music Composition]] - software synthesizers and other audio tools
  
=== TWHL example maps ===
+
== Materials ==
* [http://twhl.info/vault.php?map=3920 A counter-weighted door]
+
To specify the set of sounds for a custom [[:Category:Material System|material]] (the noises produced in response to hits, scrapes, etc), see [[Material surface properties]].
* [http://twhl.info/vault.php?map=3924 Cable shakes on blast]
 
  
== See also ==
+
== Notes ==
* [[Cables on Models]] - Cable placement on models.
+
*To play music, use [[Hammer Sound Browser]] to search for keyword <code>music</code>.
* [[phys_lengthconstraint]] - entity that suspends an object with a unstretchable cable.
+
*Many entities can have sounds assigned to them. For example, [[prop_door_rotating]] can be assigned sounds for opening, closing, swinging, being locked, and being unlocked. See the individual [[list of entities|entities]] for details.
* [[phys_pulleyconstraint]] - entity used to make a pulley.
 
* [[phys_spring]] - entity used to make a stretchable, springy cable.
 
* [[WiseWind]] - Wind-blown power lines
 
* [[Hanging lamps]] - tutorial for making a hanging lamp prop.
 
* [[Suspended Object Trap]] - tutorial for making a trap with an object suspended by a rope.
 
* [[Cable]] - Shader for cable materials.
 
* [[SplineRope]] - Shader for cable materials.
 
  
[[Category: Level Design:zh-cn]]
+
== See Also ==
 +
* [[:Category: Level Design]]
 +
* [[L4D_Soundscripts|Left 4 Dead Soundscripts]]
 +
* [http://www.youtube.com/watch?v=CxVxeGYh618 Custom sounds tutorial]
 +
 
 +
== External links ==
 +
<!-- the following links are not valid.
 +
*[http://halflifestorm.com/?page_id=160 Adding Sounds into your Maps] - Tutorial
 +
*[http://halflifestorm.com/?page_id=170 Triggering sounds in your Maps] - Tutorial
 +
-->
 +
<!-- SDK nuts has closed. When (and if) this tutorial is ported onto the VDC, please link to it instead!
 +
*[http://www.sdknuts.net/akg/?sdk=tutarts Art & Sound] &mdash; tutorials about sound in Source, including adding custom sounds {{TODO|replace with list of sound tutorials}}
 +
-->
 +
 
 +
[[Category:Sound System]]
 +
[[Category:Hubs]]

Latest revision as of 06:20, 12 October 2019

English Русский
概括性的地图制作系列 讨论你的想法——帮助我们写你需要的文章和想法

弹药 | 生物 | 蚁狮 | 光束和激光 | 线缆和绳子 | 动态的天空与云雾 | 颜色理论 | 战斗 | 联合军 | | 尘土、雾、烟 | 升降机 | 关卡转换 | 环境光效、太阳、天气、室外 | 爆炸 | 火焰 | 植被 | 玻璃和窗户 | 梯子 | 光效 | 优化 | 物理 | 视网膜扫描仪 | 声效和音乐 | 特效 | 地形 | 火车 | 机枪塔 | | 僵尸

To do: There needs to be a brief description or link to a tutorial or guide on how to take an existing .wav file and make it accessible to the Hammer Sound Browser or Face Poser.


Sound in Source can be processed in many ways. It can emit from a location in the world, have its pitch or volume altered, trigger behaviours from NPCs, and be lip synced.

Any sound can be played as music by prefixing it's path with #/. #/music/sound.wav or #/ui/gamestartup.mp3 works.

Entities

Articles

AI sounds

  • AI sounds are not audible to the player; they are purely an AI construction. They can be placed in-map with the ai_sound entity.

Music

Materials

To specify the set of sounds for a custom material (the noises produced in response to hits, scrapes, etc), see Material surface properties.

Notes

  • To play music, use Hammer Sound Browser to search for keyword music.
  • Many entities can have sounds assigned to them. For example, prop_door_rotating can be assigned sounds for opening, closing, swinging, being locked, and being unlocked. See the individual entities for details.

See Also

External links