This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
script:module:audio [2019-12-15 18:11] skyjake [Functions] |
script:module:audio [2020-11-12 17:41] skyjake |
||
---|---|---|---|
Line 9: | Line 9: | ||
#@Arg_HTML~Number,volume~@# ) | #@Arg_HTML~Number,volume~@# ) | ||
- | Start playing a local sound without any particular emitter object. This is useful for example for UI/HUD sound effects. | + | Start playing a local sound without any particular emitter object. //sound// must be a valid ID of a [[ded:sound|Sound definition]]. //volume// is the volume of the sound in the range 0...1. |
- | //sound// must be a valid [[ded:sound|Sound]] ID. | + | This is useful for example for UI/HUD sound effects. Use [[script:module:world#World.Thing|World.Thing.startSound()]] to play a sound originating from a [[ded:thing]]. |
- | //volume// is the volume of the sound in the range 0...1. | + | |
+ | #@Identifier_HTML~setAmbientSequence~@# ( | ||
+ | #@Arg_HTML~Number,sequenceNumber~@#, | ||
+ | #@Arg_HTML~Array,commands~@# ) | ||
+ | |||
+ | (Availability: Heretic only; since [[version:2.3]]). | ||
+ | |||
+ | In Heretic, ambient sound effects are linked to DoomEd numbers 1200-1299. When one of these are placed in a level (coordinates do not matter), the corresponding ambient sequence is registered for playing in the map. The //sequenceNumber// zero corresponds DoomEd number 1200. There can be up to eight sequences playing in the map at the same time. | ||
+ | |||
+ | Each ambient sequence is composed of an array of commands. Below is an example of one of Heretic's built-in sequences ("Drops"): | ||
+ | |||
+ | <code> | ||
+ | Audio.setAmbientSequence(2, [ | ||
+ | 'play', 'amb3', | ||
+ | 'delay', 16, | ||
+ | 'delayrand', 31, | ||
+ | 'play', 'amb7', | ||
+ | 'delay', 16, | ||
+ | 'delayrand', 31, | ||
+ | 'play', 'amb3', | ||
+ | 'delay', 16, | ||
+ | 'delayrand', 31, | ||
+ | 'play', 'amb7', | ||
+ | 'delay', 16, | ||
+ | 'delayrand', 31, | ||
+ | 'play', 'amb3', | ||
+ | 'delay', 16, | ||
+ | 'delayrand', 31, | ||
+ | 'play', 'amb7', | ||
+ | 'delay', 16, | ||
+ | 'delayrand', 31, | ||
+ | 'end' | ||
+ | ]) | ||
+ | </code> | ||