Jump to content

Recommended Posts

Hi guys, I'm trying to use a CBA slider to effect a particular sound volume in the example here its the MX, but its going to end up being a few different sounds. My slider is going to go from zero to one and I'm hoping to just send a multiplier to the particular sound(s).

 

Spoiler

class CfgSoundSets
{
    class Rifle_Shot_Base_SoundSet
    {
        soundShaders[] = 
        {
            MX_Closure_SoundShader,
            MX_closeShot_SoundShader,
            MX_midShot_SoundShader,
            MX_distShot_SoundShader,
            MX_tailInterior_SoundShader
        };
        volumeFactor = 1.6;
        volumeCurve = InverseSquare2Curve;
        sound3DProcessingType = WeaponMediumShot3DProcessingType;
        distanceFilter = weaponShotDistanceFreqAttenuationFilter;
        spatial = 1;
        doppler = 0;
        loop = 0;
    };
};

 

 

 

So, I'm hoping to effect the volumeFactor with a multiplier, is this possible and if so how do I send it to the particular sound? Do I just have to redefine the class?

 

Spoiler

[
    "CK_Volume_SliderMx", // Internal setting name, should always contain a tag! This will be the global variable which takes the value of the setting.
    "SLIDER", // setting type
    "MX Volume", // Pretty name shown inside the ingame settings menu. Can be stringtable entry.
    "Fiftysix Sound", // Pretty name of the category where the setting can be found. Can be stringtable entry.
    [0, 1, .5, 1], // data for this setting: [min, max, default, number of shown trailing decimals]
    nil, // "_isGlobal" flag. Set this to true to always have this setting synchronized between all clients in multiplayer
    {  
    call CK_fnc_SetMxVol;
    } // function that will be executed once on mission start and every time the setting is changed.
] call CBA_fnc_addSetting;


CK_fnc_SetMxVol = {

hint format ["You just changed the Mx volume to %1", CK_Volume_SliderMx];

{
  _x = _x*CK_Volume_SliderMx;
} forEach VolumeFactor;
//idk maybee another foreach per class? where do I point foeach, where do the values live?
};


Are these values editable on the fly, or is this somthing that would be better redefined?

A little more...

 

Spoiler

//Maybee it looks like this 

class CfgSoundSets
{
	class stuff_soundset
	{
		soundShaders[] = {"stuff"};
		//other vars here
		//throwing your select game
		//haha more random vars
		volumeFactor = 1;

	};
	class things_soundset
	{
		soundShaders[] = {"things"};
		//other vars here
		//haha more random vars
		volumeFactor = 2.6;

	};
	class forlols_soundset
	{
		soundShaders[] = {"forlols"};
		//other vars here
		//yay theres no order to vars
		volumeFactor = 3.0;
		//haha more random vars

	};
};

 

So, not only do I have to target a specific variable (I guess by name?) but I need to do it for multiple classes as well as each class may have the variable in a different position, I'm a little out of my depth here so I'm not sure if array structure applies to classes?

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

×