Jump to content
Sign in to follow this  
bigpickle

Help With A GetIn/GetOut Eventhandler Script

Recommended Posts

Hello,

I've been trying to make a small sound replacement mod for use with my group on Arma CO, the replacement part is going fine and sounds ok. But when I tried to add a new sound it fell apart.

My objective is to make a sound file play when the player(s) gets into a UH1Y, then terminate playing when the player(s) gets out.

I have been told the best way to do this is add an event handler to my UH1Y config, and direct it to an SQF file.

I've googled on how to write this stuff but have no luck with getting any clear instruction. Could someone please help me to do this.

What I have written is below but it does not work:

Added into the UH1Y config :

class CfgSounds {

class Radio {

name = "Radio";

sound[] = {"cmSound_s_UH1Y\Radio_On", db+15, 1};

titles[] = {};

};

class Radio_Off {

name = "Radio_Off";

sound[] = {"cmSound_s_UH1Y\Radio_Off", db+15, 1};

titles[] = {};

};

};

The Event Handler in my UH1Y config:

class EventHandlers {

init = " [_this select 0] execVM ""\cmSound_c_UH1Y\scripts\Radio.sqf""";

My SQF file:

_UH1Y addEventHandler ["GetIn",

{

if (_this select 1) then {

sound[] = {"cmSound_s_UH1Y\Radio_On", db+15, 1};

};

};

];

_UH1Y addEventHandler ["GetOut",

{

if (_this select 1) then {

sound[] = {"cmSound_s_UH1Y\Radio_Off", db+15, 1};

};

};

];

I know this is probably time consuming for someone to help me but If i can get a working version I can learn from it and stuff.

Thank you

Share this post


Link to post
Share on other sites

Hi,

as you're editing the config, then the best way would be to create a new soundgetin and soundgetout entry :

from the wiki :

soundCrash[] = {Vehicles\crash,0.316228,1};
soundDammage[] = {"",1,1};
soundEngine[] = {"",1,1};
soundEnviron[] = {"",1,1};
soundLandCrash[] = {Explosions\intoground,0.316228,1};
soundWaterCrash[] = {Explosions\intowater,0.316228,1};
[color="Red"] soundGetIn[] = {Vehicles\get_in,0.000316,1};
soundGetOut[] = {Vehicles\get_out,0.000316,1[/color]};
soundServo[] = {Vehicles\gun_elevate,0.010000,0.500000};
soundGear[] = {"\AnyAddon\AnySound(.wss)",0.316228,1}; //no default'

Share this post


Link to post
Share on other sites

I have my get in and out sounds set. I wanted to add a new sound triggered by the player getting in or out. That is independant of the original door open/close sound. The independant sound is going to be a radio chatter sound file.

Share this post


Link to post
Share on other sites

So then try the following inside the config, no need for an additional sqf :

class EventHandlers {
getin = "[_this select 0] say ""radio""";
getout = "[_this select 0] say ""radio_off""";
};

if the say command hasn't changed to much from OFP.

Share this post


Link to post
Share on other sites

sadly that didnt work :(

I got very hopeful then :)

I just tried this too but still no luck

class EventHandlers {

getin = "[_this select 0] playSound ""radio""";

getout = "[_this select 0] playSound ""radio_off""";

Edited by Bigpickle

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×