Entities use this function to cache sound, stored in the PAK-file, during spawning. After that they simply refer to the index returned from this function.
Generates sound centered on given entity. Channel specifies which channel to use. It is sound type related and a second sound of the same sort will overwrite the first sound. The function plays a sound given a sound index, which is retreived with gi.soundindex. Volume is between 0 and 1. Attenuation gives how far away sound can be heard. Time_ofs signifies the delay before playing the sound.
channel can be any of:
|
new sound - does not overwrite any others |
|
weapon sound |
|
sound made by entities vocal chords :) |
|
invulnerability, quad damage, etc |
|
footsteps, stomach rumblings :) plus optional flags : |
|
everyone hears this (same as ATTN_NONE) |
|
important sound - make sure it gets there safely |
attenuation can be :
|
ATTN_NONE |
heard everywhere |
|
ATTN_NORM |
carries a long way |
|
ATTN_IDLE |
does not carry as far? |
|
ATTN_STATIC |
does not go very far at all |
Similar to sound (see above for most of settings). Origin sets position for sound to come from relative to level origin (NOT entity origin)