[Atmosphere] Radio Chatter

Stuff and Junk

Well-Known Member
What it does....
When it comes to atmosphere in dayz I become very sad 8( there is almost zero atmosphere. For this reason i have created alot of scripts to add depth to the mod. This one has a random chance to generate a client only sound clip from the original night of the living dead(which was a great film btw). This is a very small snippet of a numbers station mini game mod i made for our server.

Requirements
Easy = Blue <10
A PBO program to unpack and repack. I use PBO manager.
A text editing program. I use notepad++.

Step 1
Create a new folder named scripts inside your mission pbo then create a new file and name it radioChatter.sqf and copy this text into it and place it in the folder you created called scripts:
Code:
waitUntil {!isNil ("dayz_animalCheck")};
sleep 10;

While {alive player} do {

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Init Variables
_msgChance =         _this select 0;
_sleepTimer =         _this select 1;
vanillaDayz =         _this select 2;


_itemsPlayer =         items player;
_hasRadio =         "ItemRadio" in _itemsPlayer;
_radioOff =         player getVariable ["radioOn",false];
_vanillaMsg =         ["radio_static","radio_transmission_russian","radio_transmission_wombat"] call BIS_fnc_selectRandom;
_crueMsg =             ["radio1","radio2","radio3","radio4","radio5"] call BIS_fnc_selectRandom;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//Make sure player has a radio
if (_hasRadio) then {

    //Make sure the radio is turned on
    if (!_radioOff) then {
    
        //Chance Variables
        _spawnRoll = random 1;
        
        //Roll chance to see if message will be played
        if (_spawnRoll <= _msgChance) then {
        
            //Message is going to be played. Notify the player. Comment out to disable notification.
            cutText ["Your radio is picking up a transmission.","PLAIN DOWN"];
            sleep 3;
            
            //message counter
            _msgCounter = 0;
            
            //Change < Num to make sound play more than once. Also adjust sleep time after each message played if you play more than once.
            While {_msgCounter < 1} do {
                
                //Play message for default
                if (vanillaDayz) then {
                    //Play message to player only
                    playSound _vanillaMsg;
                    sleep 60;
                } else {
                    //Play message to player only
                    playSound _crueMsg;
                    sleep 60;
                };
            //Plus one to counter after each loop. 
            _msgCounter = _msgCounter + 1;
            };
        };
    };
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//Sleep timer. Set in init.sqf
sleep _sleepTimer;
};
};//end loop and restart

Step 2
Next open your init.sqf file located in the mission pbo and add in the line to activate the script like this:
Code:
if (!isDedicated) then {
 
    //Conduct map operations
    0 fadeSound 0;
    waitUntil {!isNil "dayz_loadScreenMsg"};
    dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");
 
    //Run the player monitor
    _id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
    _playerMonitor =    [] execVM "\z\addons\dayz_code\system\player_monitor.sqf";
    _void = [] execVM "R3F_Realism\R3F_Realism_Init.sqf";
  ////////////////////////////////ADD THIS ADD THIS ADD THIS///////////////////////////
 //msgChance,sleepTimer,DayZ 1.8 users set to true
    [0.15, 600, false] execVM "scripts\radioChatter.sqf";
  ////////////////////////////////ADD THIS ADD THIS ADD THIS///////////////////////////
    //Lights
    //[0,0,true,true,true,58,280,600,[0.698, 0.556, 0.419],"Generator_DZ",0.1] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";
};

Step 3
If you use daiymo base building open your define.hpp, if you do not then open your description.ext and in the cfgsounds section add this, if you do not have a cfg sounds then add the whole block:
Code:
class CfgSounds
{
sounds[] ={radio1,radio2,radio3,radio4,radio5};
 
class radio1
{
    name="radio1";
    sound[]={sounds\radio1.ogg, 0.3, 1};
    titles[] = {};
};
class radio2
{
    name="radio2";
    sound[]={sounds\radio2.ogg, 0.3, 1};
    titles[] = {};
};
class radio3
{
    name="radio3";
    sound[]={sounds\radio3.ogg, 0.3, 1};
    titles[] = {};
};
class radio4
{
    name="radio4";
    sound[]={sounds\radio4.ogg, 0.3, 1};
    titles[] = {};
};
class radio5
{
    name="radio5";
    sound[]={sounds\radio5.ogg, 0.3, 1};
    titles[] = {};
};
};

Step 4
Now create a folder named sounds in you mission pbo and put these files inside of that folder:
https://www.dropbox.com/sh/s6ns846m256n9pc/vyP-rUFFXb



FAQ -
http://opendayz.net/threads/atmosphere-radio-chatter-help.15333/

Credits -
Dango
 
Back
Top