Results 1 to 5 of 5

Thread: Help With A GetIn/GetOut Eventhandler Script

  1. #1

    Help With A GetIn/GetOut Eventhandler Script

    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



  2. #2
    Hi,

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

    Code:
    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};
     soundGetIn[] = {Vehicles\get_in,0.000316,1};
     soundGetOut[] = {Vehicles\get_out,0.000316,1};
     soundServo[] = {Vehicles\gun_elevate,0.010000,0.500000};
     soundGear[] = {"\AnyAddon\AnySound(.wss)",0.316228,1}; //no default'

  3. #3
    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.

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

    Code:
    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.

  5. #5
    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""";
    Last edited by Bigpickle; Jan 23 2011 at 12:05.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •