Radio chatter framework

## Introduction

The radio chatter module allows you to make any object a source for radio chatter. The object receives an ACE 3 interaction option that allows players to turn it on and off. The same sound is played on all clients and turning the radio on and off will affect every client.

By default the mod comes with one preset radio station referenced to as "US" (see below for use). It plays random radio chatter with sounds sampled from the excellent TV Show *Generation Kill*. But you can create your own radio station and pack it in an addon or directly in the mission file (see framework below). If you make your own radio station addon please share!

## Associated Function

To turn any object into a radio chatter source call the function MRH\_fnc\_isRadioChatterSource preferably from the object's init box.

Here's the function's header:

```
 Function name:MRH_fnc_isRadioChatterSource
            Author: Mr H.
            Description: Turns an object into a radio chatter source, it plays random radio chatter sounds and can be turned on and off with ace 3 interaction.
            Return value:None
            Public:Yes
            Parameters:
            0-<OBJECT> - Object to turn into a radio object
            1 -<STRING> - Radio station to play, by default the mod includes an US radio chatter station, but you can create your own: visit https://mrhmilsimtools-arma3-mod.wikia.com/wiki/Radio_chatter_framework for a more complete guide.
            Example(s):
            [this,"US"] call  MRH_fnc_isRadioChatterSource;
            or
            [this,"YourRadioStationClassname"] call  MRH_fnc_isRadioChatterSource;

```

So:

```
 [this,"US"] call  MRH_fnc_isRadioChatterSource;

```

Will play the mod's default US radio.

While:

```
 [this,"YourRadioStationClassname"] call  MRH_fnc_isRadioChatterSource;

```

Will play the customized radio you have defined in your mission or in your addon. (Of course replace the classname by the one you have defined).
See below for a guide on how to create your own radio station.

## Station Creating Framework

There are two steps to creating your own radio station. You can do this in your mission's description.ext or in your mod's config.cpp. You can find templates and examples in the mod's folder.

**I) Define the sounds in cfgSounds**

The sounds must be defined as you would normally do in Arma in a class cfgSounds (link to the Bis Wiki if you don't know how to do that.

But your sound's config must include an extra config entry:

```
 soundLength

```

Which will tell the mod how long (in seconds) your sound is. For example:

```
 soundLength = 25;

```

Means that the sound last 25 seconds.
Here's a template you can use:

```
 class cfgSounds //Arma 3 default cfgSounds
     {
     		class YourSoundsClassName // Sound classname as listed above
     	{

     	name     = "YourSoundsName"; //Name for your sound, standard arma 3 cfg sounds entry
     	sound[]  = {"\PathToYourSound", 15, 1, 100}; //standard arma cfg sounds
     	titles[] = {};
     	soundLength = 10; //Length of your sound in seconds added for the radio chatter module, mandatory

     	};
     };

```

And here's an example sampled from the demo mission:

```
 class cfgSounds
    {
    		class MRH_DEMO_Russian1
    	{

    	name     = "MRH_DEMO_Russian1";
    	sound[]  = {"\RussianChatter\MRH_DEMO_Russian1.ogg", 15, 1, 100};
    	titles[] = {};
    	soundLength = 39;

    	};
    		class MRH_DEMO_Russian2
    	{

    	name     = "MRH_DEMO_Russian2";
    	sound[]  = {"\RussianChatter\MRH_DEMO_Russian2.ogg", 15, 1, 100};
    	titles[] = {};
    	soundLength = 25;

    	};
    		class MRH_DEMO_Russian3
    	{

    	name     = "MRH_DEMO_Russian3";
    	sound[]  = {"\RussianChatter\MRH_DEMO_Russian3.ogg", 15, 1, 100};
    	titles[] = {};
    	soundLength = 36;

    	};
    };

```

**II) List the sounds in a cfgMRHFactionsSounds class**

The sounds you use for a given station must then be listed in a class cfgMRHFactionsSounds each station must have its own class (which will be used in the function, (see above) and contain a list of the sounds that belong to this station between double quotes and separated by comas, listed in an

```
 allSounds[] = {};

```

entry.

Here's a template:

```
 class cfgMRHFactionSounds //Do not Change
  {
  	class YourRadioStation // this will be passed to the function to tell it what radio station to play
  	{
  	allSounds[] = {}; // list sound classnames here between "" and separated by ,
  	};
  };

```

And here is an example with the sounds listed above:

```
 class cfgMRHFactionSounds
 {
 	class DemoRussian
 	{
 	allSounds[] = {"MRH_DEMO_Russian1","MRH_DEMO_Russian2","MRH_DEMO_Russian3"};
 	};
 };

```

## Compatibility

CUP terrains core contains a neat radio object (classname "Vysilacka"). But unfortunately the object must not have a memory point because the ace turn on/off action does not show on this item. (The sounds are still played though).