[Release] Player Fired Sound Realism (Configurable Zed Response)

BDC

Well-Known Member
Hey guys, I whipped this mod up a few days ago as a way of being able to configure several values that modify the distances at which zed will hear gunfire. It modifies Init.SQF and Player_Fired.SQF only. The idea here is to modify the audibility of gunshots to zed based upon a global modifier (to increase or decrease overall by magnitude, by variances in rain, etc.

This mod's pretty easy.

Step 1) Modify Compiles.SQF

On or about line 28, we find this:

Code:
player_fired = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_fired.sqf";            //Runs when player fires. Alerts nearby Zeds depending on calibre and audial rating

Let's modify it to make it look like this with this addition:

Code:
//player_fired = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_fired.sqf";            //Runs when player fires. Alerts nearby Zeds depending on calibre and audial rating
        player_fired = compile preprocessFileLineNumbers "scripts\compiles\player_fired.sqf"; // Modified - ^bdc

Notice the path we point to for the new player_fired.SQF -- scripts\compiles. Make sure you place the new file in the proper spot and modify this path accordingly.

Step 2) Grab a new Player_Fired.SQF

I've posted mine here on pastebin --> http://pastebin.com/GNh4eisr

Step 3) Modify Init.SQF for config options

Let's add this chunk at the bottom of the file to keep things nice and orgamanized (yes, orgamanized):

Code:
// Player Fired Sound Realism - Modify the distance that zed will hear a shot based on magnitude multipler - Modifies player_fired.SQF - ^bdc
dayz_PlayerFiredSoundRealism_Enabled = true; // Enable/Disable this check
dayz_PlayerFiredSoundRealism_Logging = false; // Enable/Disable client side logging when player fires
dayz_PlayerFiredSoundRealism_Magnitude = 2.5; // (default 1.00) - multipler of final distance check for range of zed to respond
dayz_PlayerFiredSoundRealism_RainSoundDampening = true; // (default: true) Enable/Disable reduction of sound distance to zed awareness when raining
dayz_PlayerFiredSoundRealism_VeryHeavyRainMagnitude = 0.40; // Magnitude reduction of sound distance under severe rainfall (default: 0.40)
dayz_PlayerFiredSoundRealism_HeavyRainMagnitude = 0.55; // Magnitude reduction of sound distance under heavy rainfall (default: 0.55)
dayz_PlayerFiredSoundRealism_ModerateRainMagnitude = 0.70; // Magnitude reduction of sound distance under moderate rainfall (default: 0.70)
dayz_PlayerFiredSoundRealism_LightRainMagnitude = 0.85; // Magnitude reduction of sound distance under light rainfall (default: 0.85)
dayz_PlayerFiredSoundRealism_MaximumDisAudialRange = 500; // (default: 500) - total range in meters a shot will be heard by zed

A description of each variable:

dayz_PlayerFiredSoundRealism_Enabled: True or false (default true), enables magnitude variable

dayz_PlayerFiredSoundRealism_Logging: true or false (default false), logs when a player fires to the client PC's arma2oa.RPT file

dayz_PlayerFiredSoundRealism_Magnitude: This number represents the overall multiplier done to the final figure after corrections for rain are applied. If, say, a distance of 100 is what's leftover for zed awareness/aggro, and a magnitude is set to 2.0, then the overall distance will be 200 meters. It's a multiplication of the final number. Default is 1.00 which means no overall correction factor. If under, then sound awareness to zed is reduced. Over, then the opposite.

dayz_PlayerFiredSoundRealism_RainSoundDampening: True or false, default is true, this enables or disables the check for rain and correcting distance based upon magnitude of rainfall

dayz_PlayerFiredSoundRealism_VeryHeavyRainMagnitude: Degree by which we multiply the audial distance factor of the firearm's caliber: 0.40 is default

dayz_PlayerFiredSoundRealism_HeavyRainMagnitude: Multiplication for heavy rain. Default 0.55

dayz_PlayerFiredSoundRealism_ModerateRainMagnitude: Moderate rainfall modifier; default is 0.70

dayz_PlayerFiredSoundRealism_LightRainMagnitude: Light rain; default is 0.85.

dayz_PlayerFiredSoundRealism_MaximumDisAudialRange: This is the maximum range after all corrections and multipliers that zed could possibly hear gunfire. This should realistically not exceed maximum spawn area. Default can be 250, 300, etc. Mine is set to 500 because I want to make some noise.

The idea here is to balance this out in a manner which compels less use of firearms. I've noticed that some zed don't respond to pistol shots which, in reality, they would hear (if zed were real, of course). If you want a server where you want zed to hear gunshots from far away, and thereby motivate the use of melee or crossbow weapons, then this will work.

B
 
Back
Top