Change sound effect via .lua/script? [Solved]
Posted: Thu Dec 21, 2017 5:05 pm
Hey guys,
Quick question, would it possible to change an explosion sound-effect via lua coding? I tried using multiple methods, no one worked. Everything is under ScriptPostLoad().
I'm mainly interested in switching detonators explosion sound, here are my different tries.
The detonator's _exp is named "gun_weap_inf_haywiredetonator_exp" and the sound effect I want to use is "com_weap_inf_haywire_exp". The sound is proprely loaded in a custom lvl. It works fine when I directly edit the .odf.
Any idea? 
Quick question, would it possible to change an explosion sound-effect via lua coding? I tried using multiple methods, no one worked. Everything is under ScriptPostLoad().
I'm mainly interested in switching detonators explosion sound, here are my different tries.
The detonator's _exp is named "gun_weap_inf_haywiredetonator_exp" and the sound effect I want to use is "com_weap_inf_haywire_exp". The sound is proprely loaded in a custom lvl. It works fine when I directly edit the .odf.
Code: Select all
SetSoundEffect("gun_weap_inf_haywiredetonator_exp", "SoundProperty", "com_weap_inf_haywire_exp")
SetProprety("gun_weap_inf_haywiredetonator_exp", "SoundProperty", "com_weap_inf_haywire_exp")
SetClassProprety("gun_weap_inf_haywiredetonator_exp", "SoundProperty", "com_weap_inf_haywire_exp")