Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
tehg3a3

playSound parameters not changing when executed with eventhandler

Recommended Posts

Hey folks, I'll try and keep this short. I'm new to scripting in Arma 3, so I got a friend to assist me with custom dialogue that is set to occur in my mission when certain things happen. For example, I have audio that is supposed to play when an enemy plane gets shot down. But because the player is in their own plane for the entire mission, all that dialogue will sound muffled. We did go into the mission.sqm and set proper parameters for the briefing dialogue which makes it sound loud and clear even when inside a vehicle, but the shootdown dialogue is tied to eventhandlers within the unit's init in 3den. I tried setting the same parameters since it's also playSound script, but the audio is still muffled. Below is the code for one of the enemy units:

 

this addEventHandler ["Hit", {bt1 setdamage 1}];
this addEventHandler ["killed", {playSound "GACSFXMODVSong0", 2, 0;}];
this addEventhandler ["Hit", {titleText ["<t align = 'center' shadow = '2' color='#FF0000' size='2' font='RobotoCondensedBold' >BOMBER</t><br /><t color='#FFFFFF' size='2' font='RobotoCondensed' shadow = '2' >This is Grey Two, we're hit, we're hit!</t>", "PLAIN DOWN", -1, true, true];}];

I'm using the information provided on this page as well: https://community.bistudio.com/wiki/playSound

I'm hoping I'm just implementing the parameters wrong and someone here can show me the light. That, or someone can show me a better way to implement sounds that occur during the mission without using 3den triggers. Many thanks in advance!

 

EDIT: Someone else helped me out and now the audio plays unmuffled, all because of a little syntax issue:
 

this addEventHandler ["killed", {playSound "GACSFXMODVSong0", 2, 0;}];

 

The old code above was missing brackets around the sound and parameters itself. The fix is below:

 

this addEventHandler ["killed", {playSound ["GACSFXMODVSong0", 2, 0];}];
 

Really simple fix, but I'll leave this post up in case someone else has this specific problem in the future. Case closed!

Share this post


Link to post
Share on other sites

×