Classname: | sound_maker |
Purpose: | sounds on demand |
H2 Code: | sound.hc |
fields required: | origin, soundtype, targetnane |
These are sounds that are triggered. There are very few of them in the game, but it is easy to write code to get more, using new .wav files, or ones in the .pak's (for getting started in HexenC, head over to the Chop Shop). At least some of the sounds that don't work as sound_ambients can be gotten as triggered sounds with custom variants of sound_maker. |
origin | As usual |
soundtype | One of the following numbers:
|
targetname | As usual |
delay | As usual |
Here is some code for an entity, custom_sound_maker, which specifies the sound as a filename in the netname field (see below for the format):
void custom_sound_maker (void) { precache_sound (self.netname); self.noise1 = (self.netname); if (self.delay) self.use = sound_maker_wait; else self.use = sound_maker_run; } |
|
Note that the sound file name needs both the .wav extension and the subdirectory name (within the `sound' subdirectory of the .pak or game directory directory), using the forward slash rather than the backslash.
The Raven coders seem to make a point of not passing long string arguments to entities, so there's probably some reason not to do it too often. Modifying the sound entities code is relatively easy.
Note that if you target a looped sound, it will run forever.