Jump to content
XianGrim

Radio Jammer's with Sounds!

Recommended Posts

Using @rebel12340 's Radio Jammer script, I wanted to add a little life to them. I updated to his latest version and made it much easier to use them mid-mission with any Zeus:

 

 

Again, all credit to @rebel12340 for his work, I made 0 edits to his script, just added the effects and Zeus function. You can grab Rebel's original script here: 

 

You can download everything from here: 
https://github.com/phoenixdowngaming/Xians-Scripts/tree/master/Radio_Jammer

 

 

 

 

Inside the Init of your Zeus Module:

this addEventHandler ["CuratorObjectPlaced",   
 {  
 params ["_curator", "_entity"];    
 [_entity]execVM "RadioJammer\jammer_Check.sqf";  
 }  
];

RadioJammer\jammer_Check.sqf:

private _jammer = _this select 0;//the jammer
if (typeof _jammer == "Land_DataTerminal_01_F") then //check if the object Zeus placed is a Data Terminal aka Jammer
	{
		[_jammer,3] call BIS_fnc_dataTerminalAnimate;//Animate the jammer to be open and "on"
		[[_jammer]] execVM "RadioJammer\TFARjamRadios.sqf";//activate Rebel's radio Jamming script, ALL CREDIT TO HIM FOR THIS, I MADE 0 EDITS TO HIS WORK
		
		_jamPos = getPos _jammer;//get the position of the jammer
		_jamSource = "Land_HelipadEmpty_F" createVehicle [0,0,0];//create an invisible helipad to use as our sound source
		_jamSource setPos _jamPos;
		_Zeus = allCurators;//get a list of Zeus's incase multiple are being used
		{_x addCuratorEditableObjects [[_jamSource],false ];} forEach _Zeus;//make sure to add the helipad to Zeus incase he wants to move or delete the jammer after its been placed
		_jamDamage = getDammage _jammer;//in order to loop the sound, I chose to use a damage check
		[_jammer,["Shutdown Jammer","RadioJammer\jammer_shutdown.sqf",[_jammer,_jamSource],1,false,true,"","_this distance _target < 3"]] remoteExec ["addAction",0];
		while {_jamDamage < 0.10} do
		{
			[_jamSource,["jammer_loop",25,1]] remoteExec ["say3D",0];
			sleep 3;
		};
		//this while loop checks the damage of the jammer every 3 seconds. apparently it can't be shot or blown up so we apply the damage manually in the shutdown script which ends the sound effects
};

RadioJammer\jammer_shutdown.sqf

private _jammer = _this select 0;											//The Jammer device itself
private _jamsource = nearestObject [_jammer,"Land_HelipadEmpty_F"];			//the sound effect source
private _jamDamage = getDammage _jammer;									//the jammers current damage

deleteVehicle _jamsource;													//stops the sound regardless of loop or length of sound effect
_jammer setDamage 0.75;														//set damage, can be any value really but I chose 75%
[_jammer,"green","green","green"] call BIS_fnc_DataTerminalColor;			//change the colors from red to green to let player now its "safe"
[_jammer,0] call BIS_fnc_dataTerminalAnimate;								//animate the box to Close, giving visually feedback to the player
[_jammer,["power_down",25,1]] remoteExec ["say3D",0];						//play the power down sound effect directly from the jammer itself

player setVariable ["tf_receivingDistanceMultiplicator", 1];				//variable used to turn radios back on
player setVariable ["tf_transmittingDistanceMultiplicator", 1];				//variable used to turn radios back on



};

Description.ext

enableDebugConsole = 1;
respawn = "BASE";
respawnDelay = 5;

//This is the section that is most important. All the sounds are 'declared' here to be used in game
class CfgSounds
{
	class jammer_loop
	{
		name = "jammer_loop";
		sound[] = {"\sound\jammer_Effect.ogg", db+2, 1};
		titles[] = {1,""};
	};
	class power_down
	{
		name = "power_down";
		sound[] = {"\sound\power_down.ogg", db+6, 1};
		titles[] = {1,""};
	};
};

 

1 Known Bug so far:

I've had a few people tell me that the sound effect is very low which is odd because on my machine, its loud. A quick workaround/fix is to just turn up the db+# in the description.ext to a higher number and that should get it working

 

Any questions, suggestions or feedback, let me know! I learned most my scripting knowledge back in Arma 2 so if its old or if anything can be done an easier/better way, I'd love to know about it!

Edited by XianGrim
Fixed error in jammer_Check.sqf: forgot to include the jammer name inside an array which was causing it to break
  • Like 3
  • Thanks 2

Share this post


Link to post
Share on other sites

Fixed an oversight bug where ONLY the Zeus who placed the box could shut it down. Silly.

Edited by BohemiaBeck
no all bold

Share this post


Link to post
Share on other sites

@SSG-Kalle Is there already a jamming script for ACRE? I never used it so never bothered looking. I didn't' make the actual jamming part, just the effects, and Zeus part.

Share this post


Link to post
Share on other sites

Updated - Fixed another error, the jammer name needed to be inside an array.

  • Thanks 1

Share this post


Link to post
Share on other sites

@XianGrim Hi! It is a very interesting project, I would like to implement this in the my mission but I don't know how to do this. Could you add a README.txt with instructions or write in the comments how to do it?

Share this post


Link to post
Share on other sites

Don't want to sound rude, but he explains everything in the post and try to read the right side description of what each line of code does, because this would be a too long post to explain it, so if you want I can give you a hand through discord.

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

×