setmaterial
The setmaterial
script command is used to set the collision sound material for an entity.
The collision sound material is used when thrown items hit the environment. If the item is under water then the water
material is used. The sound sample used is sfx/<material>_on_<groundmaterial>_1.wav
where <groundmaterial>
is metal
, wood
, stone
, gravel
, water
or earth
depending on the polygon type. If either <material> or <groundmaterial>
is water
then there will also be a visual splash effect in addition to the sound.
The collision sound material is used when the player strikes an entity barehanded. The sound sample used is sfx/<material>_on_flesh_1.wav
. If <material> is water
then there will also be a visual splash effect in addition to the sound.
The collision material is also used when striking an item or prop or when damaging an NPC (in addition to the sound from the armor material) with a weapon. The sound sample used is configured in localisation/snd_armor.ini
, localisation/snd_step.ini
or localisation/snd_weapon.ini
in increasing order of priority. Here the weapon material (from the weapon entity if set there or the NPC or player wielding it) determines the section and the collision material determines the key in that section.
To set the sound material for step sounds when walking, use setstepmaterial
. To set the sound material for combat strikes, use setarmormaterial
and setweaponmaterial
.
Usage
setmaterial <material>
setmaterial none
Context: Any Entity
Parameters:
Parameter | Type | Description |
---|---|---|
material |
string |
Material to use for collision sounds |
Material names
The material name must be one of the following. All other strings will be interpreted as "none".
weapon
flesh
metal
glass
cloth
wood
earth
water
ice
gravel
stone
foot_large
foot_bare
foot_shoe
foot_metal
foot_stealth