Script:setmaterial: Difference between revisions

From Arx Libertatis Wiki
Jump to navigation Jump to search
(Created page with "{{ScriptCommandPage |description=set the collision sound material |context=any |special= none |parameters= material string Material to use for collision sounds |intro=<br> The collision sound material is used when thrown items hit the environment. If the item is under water then the <code>water</code> material is used. The sound sample used is <code>sfx/<material>_on_<groundmaterial>_1.wav</code> where <code><groundmaterial></code> is <code>metal</code>, <code>wood</cod...")
 
mNo edit summary
 
Line 12: Line 12:
The collision sound material is used when the player strikes an entity barehanded. The sound sample used is <code>sfx/<material>_on_flesh_1.wav</code>. If <material> is <code>water</code> 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 <code>sfx/<material>_on_flesh_1.wav</code>. If <material> is <code>water</code> then there will also be a visual splash effect in addition to the sound.


The collision material is also used when striking an [[:Category:Items|item]] or [[:Category:Props|prop]] or when damaging an [[:Category:NPCs|NPC]] (in addition to the sound from the armor material) with a weapon. The sound sample used is configured in <code>localisation/snd_armor.ini</code>, <code>localisation/snd_step.ini</code>, <code>localisation/snd_weapon.ini</code> in increasing order of priority. Here the [[Script:setweaponmaterial|weapon material]] (from the weapon entity if set there or the [[:Category:NPCs|NPC]] or player wielding it) determines the section and the collision material determines the key in that section.
The collision material is also used when striking an [[:Category:Items|item]] or [[:Category:Props|prop]] or when damaging an [[:Category:NPCs|NPC]] (in addition to the sound from the armor material) with a weapon. The sound sample used is configured in <code>localisation/snd_armor.ini</code>, <code>localisation/snd_step.ini</code> or <code>localisation/snd_weapon.ini</code> in increasing order of priority. Here the [[Script:setweaponmaterial|weapon material]] (from the weapon entity if set there or the [[:Category:NPCs|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 {{Command|setstepmaterial}}. To set the sound material for combat strikes, use {{Command|setarmormaterial}} and {{Command|setweaponmaterial}}.
To set the sound material for step sounds when walking, use {{Command|setstepmaterial}}. To set the sound material for combat strikes, use {{Command|setarmormaterial}} and {{Command|setweaponmaterial}}.

Latest revision as of 12:36, 9 July 2022

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:

ParameterTypeDescription
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