Change sound effect via .lua/script? [Solved]

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
CdtFox
2nd Lieutenant
2nd Lieutenant
Posts: 379
Joined: Wed Feb 17, 2016 8:51 am
Projects :: BUC and Designated Days
Games I'm Playing :: SWBF2+EAW+Subnautica
xbox live or psn: No gamertag set
Location: France
Contact:

Change sound effect via .lua/script? [Solved]

Post by CdtFox »

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.

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")
Any idea? :D
Last edited by CdtFox on Fri Dec 22, 2017 2:13 am, edited 1 time in total.
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Change sound effect via .lua/script?

Post by AQT »

CdtFox
2nd Lieutenant
2nd Lieutenant
Posts: 379
Joined: Wed Feb 17, 2016 8:51 am
Projects :: BUC and Designated Days
Games I'm Playing :: SWBF2+EAW+Subnautica
xbox live or psn: No gamertag set
Location: France
Contact:

Re: Change sound effect via .lua/script?

Post by CdtFox »

Thx :)
Post Reply