Jump to content
rebel12340

[Release] Radio Jamming Script for Task Force Radio

Recommended Posts

About

This is a multiplayer compatible script that jams the radios of players that are in range of the jamming device(s).

The script supports multiple jammers and terminates once all of the jammers have been destroyed.

This script affects each player individually, so a person standing inside the radius will have their radio jammed, while someone else standing outside of the radio will not have their radio jammed.

 

Usage

An example mission is included in the download.

 

To use this script simply place down the object(s) you want to act as the jammer(s) in the editor and give the object(s) a variable name (Ex: Jammer1)

create a file in the mission folder called: initPlayerLocal.sqf

put the following line into initPlayerLocal.sqf: radioJammer = [[Jammer1]] execVM "TFARjamRadio.sqf";

 

You can also change the radius and strength of the jamming signal if you wish.

 

Download

Available for download on Google Drive.
Sample mission available on Steam Workshop.

This script requires Task Force Arrowhead Radio in order to function.

Edited by rebel12340
Updated link to Google Drive
  • Like 14

Share this post


Link to post
Share on other sites

Nice one! 

 

Is it possible to jam Blufor radios only? Planning to use this in a tvt where opfor can choose this as a perk...

Share this post


Link to post
Share on other sites

Cool mod!  I can see some potential missions.....like your mission is to first destroy the jammer....etc.  Awesome, thanks for sharing the script with the community!

 

You say multiplayer, but to confirm does it work on a dedicated?

Edited by kman_(kya)
Add question

Share this post


Link to post
Share on other sites
2 hours ago, Azza FHI said:

Nice one! 

 

Is it possible to jam Blufor radios only? Planning to use this in a tvt where opfor can choose this as a perk...

This could be accomplished in a few ways, depending on how you execute the script. One way would be to add a side check to the script such as:

if (side player != WEST) exitWith {};

 

2 hours ago, kman_(kya) said:

Cool mod!  I can see some potential missions.....like your mission is to first destroy the jammer....etc.  Awesome, thanks for sharing the script with the community!

 

You say multiplayer, but to confirm does it work on a dedicated?

 

Yes, the script does work on a dedicated server. The script itself is only executed on each client locally and is never actually ran on the dedicated server (as there would be no point).

 

2 hours ago, callofmarty said:

Would be nice to have option to turn ON/OFF the jammer via interaction menu.

 

While that would be useful, I can't really think of any way of easily adding such a feature to the script at this time. I may look into it, but no promises.

  • Like 2

Share this post


Link to post
Share on other sites

@rebel12340

Is it based on nkeys script? I ask because I see similarity and I don't see any info.

If I understand properly you use multiple jammers but you count only the closest one. I think this is not the way jamming works.

 

Long time ago I've also made similar script based on nkeys work:

Spoiler

//put code below into init.sqf (radioPole can be any object pre-placed in editor and called radioPole)
//you can made any variation of names
//it is not testet with many jammers but probably it will work

some_fnc_jamTfar = compile loadFile "scripts\jamTfar.sqf";
[] spawn {
	[[radioPole, 5000, 60000]] call some_fnc_jamTfar;
};

=======================

//put code below into scripts\jamTfar.sqf
private	["_multiplier", "_receive", "_func_calcMultiplier", "_interferenceObjects"];

_interferenceObjects = _this;
if (count _this == 0) exitWith {};
if (isDedicated) exitWith {};

_func_calcMultiplier = 
{
	private ["_return"];
	_return = 0;	
	{
		private ["_jammer", "_distance", "_radius", "_terrainInterception", "_distCoef", "_mult", "_jammForce"];
		
		_jammer = _x select 0;
		_radius = _x select 1;		
		_jammForce = _x select 2;
		_distance = _jammer distance player;
	
			
		if(alive _jammer) then 
		{	
			if (_distance < _radius) then 
			{
				if (_radius != 0 && _jammForce != 0 && jammingStarted) then 
				{						
					_terrainInterception = _jammer call TFAR_fnc_calcTerrainInterception;
					_distCoef = (_distance + _terrainInterception * TF_terrain_interception_coefficient + _terrainInterception * TF_terrain_interception_coefficient * (_distance / _jammForce)) / _radius;
					_mult = 1.0 - _distCoef;												
					_return = _return + _mult;
				};
			};
		};
	} forEach _this;

	if (_return > 1.0) then {
		_return = 1.0;
	}; 
	_return
};

sleep 1;

while {true} do
{	
	_multiplier = _interferenceObjects call _func_calcMultiplier;

	player setVariable ["tf_sendingDistanceMultiplicator", 1.0 - _multiplier];

	if (_multiplier > 0) then 
	{
		if (_multiplier > 0.99) then 
		{
			_receive = 50;
		} 
		else 
		{
			_receive = 1 / (1 - _multiplier);
		};			
	} 
	else 
	{
		_receive = 1.0;
	};
	player setVariable ["tf_receivingDistanceMultiplicator", _receive];	
	sleep 3;
};

 

 

If you want turn it off/on:

Spoiler

//put code below in initLocalPlayer.sqf (if you will be close enough of radioPole, menu will appear)

fnc_jamming_start = 
{
	jammingStarted = true;
	publicVariable "jammingStarted";
};

fnc_jamming_stop = 
{
	jammingStarted = false;
	publicVariable "jammingStarted";
};

player addAction ["<t color=""#FFFF00"">start jam", fnc_jamming_start, [], 7, true, true, "", "[radioPole, player] call BIS_fnc_inTrigger && !jammingStarted"];
player addAction ["<t color=""#FFFF00"">stop jam", fnc_jamming_stop, [], 7, true, true, "", "[radioPole, player] call BIS_fnc_inTrigger && jammingStarted"];
  
//add in init.sqf
jammingStarted = false;
 

 

 

@callofmarty

AFAIK in real life jammers are not selective (just jam everything). But in script it is possible to add it. You need to introduce additional side checking.

  • Like 2

Share this post


Link to post
Share on other sites
3 hours ago, kromka said:

 

@callofmarty

AFAIK in real life jammers are not selective (just jam everything). But in script it is possible to add it. You need to introduce additional side checking.

 

 

you probably mistaken me with the other guy, i just wanted to turn it on and off.

For example, i put the script in some car with antena and drive it to destination, set it up and turn it on.

Thx for the content

Share this post


Link to post
Share on other sites
3 hours ago, Crielaard said:

Superb!

Great job.

 

Any chance you will make an ACRE version aswell?

 

Not likely to happen anytime soon, unfortunately.

 

3 hours ago, KokaKolaA3 said:

Awesome!

Could you upload this to Steam Workshop

 

Yes, I can upload the example mission.

 

2 hours ago, kromka said:

@rebel12340

Is it based on nkeys script? I ask because I see similarity and I don't see any info.

If I understand properly you use multiple jammers but you count only the closest one. I think this is not the way jamming works.

 

Long time ago I've also made similar script based on nkeys work:

  Reveal hidden contents


//put code below into init.sqf (radioPole can be any object pre-placed in editor and called radioPole)
//you can made any variation of names
//it is not testet with many jammers but probably it will work

some_fnc_jamTfar = compile loadFile "scripts\jamTfar.sqf";
[] spawn {
	[[radioPole, 5000, 60000]] call some_fnc_jamTfar;
};

=======================

//put code below into scripts\jamTfar.sqf
private	["_multiplier", "_receive", "_func_calcMultiplier", "_interferenceObjects"];

_interferenceObjects = _this;
if (count _this == 0) exitWith {};
if (isDedicated) exitWith {};

_func_calcMultiplier = 
{
	private ["_return"];
	_return = 0;	
	{
		private ["_jammer", "_distance", "_radius", "_terrainInterception", "_distCoef", "_mult", "_jammForce"];
		
		_jammer = _x select 0;
		_radius = _x select 1;		
		_jammForce = _x select 2;
		_distance = _jammer distance player;
	
			
		if(alive _jammer) then 
		{	
			if (_distance < _radius) then 
			{
				if (_radius != 0 && _jammForce != 0 && jammingStarted) then 
				{						
					_terrainInterception = _jammer call TFAR_fnc_calcTerrainInterception;
					_distCoef = (_distance + _terrainInterception * TF_terrain_interception_coefficient + _terrainInterception * TF_terrain_interception_coefficient * (_distance / _jammForce)) / _radius;
					_mult = 1.0 - _distCoef;												
					_return = _return + _mult;
				};
			};
		};
	} forEach _this;

	if (_return > 1.0) then {
		_return = 1.0;
	}; 
	_return
};

sleep 1;

while {true} do
{	
	_multiplier = _interferenceObjects call _func_calcMultiplier;

	player setVariable ["tf_sendingDistanceMultiplicator", 1.0 - _multiplier];

	if (_multiplier > 0) then 
	{
		if (_multiplier > 0.99) then 
		{
			_receive = 50;
		} 
		else 
		{
			_receive = 1 / (1 - _multiplier);
		};			
	} 
	else 
	{
		_receive = 1.0;
	};
	player setVariable ["tf_receivingDistanceMultiplicator", _receive];	
	sleep 3;
};

 

 

This script was not based off of another script.

 

Share this post


Link to post
Share on other sites
1 hour ago, callofmarty said:

you probably mistaken me with the other guy, i just wanted to turn it on and off.

For example, i put the script in some car with antena and drive it to destination, set it up and turn it on.

Thx for the content

 

Yep. Thats what the piece of code in initLocalPlayer.sqf does: give to character an action in action menu when you are near (or in the car).

Just name your car somehow eg. someCar and change radioPole to someCar.

Now when you will be near the car you will have additional action start/stop jamming. You can drive wherever you want and then trun on/off radio.

 

But this is not my topic. If you want details just PM.

Share this post


Link to post
Share on other sites

If it helps, I can confirm, this works AMAZINGLY on a dedicated server box. Had about 20-22 guys and once they got within range, only local worked. Radios were jammed and then unjammed once disabled. I added a little twist and had my guys "shutdown" the jammers instead of blowing them up:

this was just a little test: TFAR Radio Jammers with 3D sounds

 

  • Like 3

Share this post


Link to post
Share on other sites

Hi,
Just a little improvement here (to make this more realistic, technically speaking). Your jammer strengh effect is lineal depending on the distance of the jammer, an electronic jammer emit a wave which sature a range of the bandwidth (not simulated in this script) avoiding comms to be properly demodulated and decrypted, this is an eletronic wave and according to the laws his effect is exponential depending on the distance..


In short, you could change the line 50 of the TFARjamRadios.sqf to this:

// Interferencia exponencial decreciente con lambda = 2
_interference = _strength * exp ( - _distPercent * 2 ) ;
// Interferencia lineal
// _interference = _strength - (_distPercent * _strength) + 1;

 

Greetings! :)

Share this post


Link to post
Share on other sites

Hi,

 

i made a test with TFAR version 1.0.261 and it seem the script does not work with this version. No error message or something else. It is possible to use TFAR without any problems if the script is active. Is it possible to fix this ?

Share this post


Link to post
Share on other sites
14 hours ago, neodyn said:

Hi,

 

i made a test with TFAR version 1.0.261 and it seem the script does not work with this version. No error message or something else. It is possible to use TFAR without any problems if the script is active. Is it possible to fix this ?

I'm not sure what the issue is. I haven't tested any of the developmental builds for TFAR. Have you tried your test mission with the latest stable version of TFAR (0.9.12) or tried the mission I included with the download?

Share this post


Link to post
Share on other sites

I would suggest talking to deadman a bunch of function names ect were changed in 1.0+, I had to get help from him to fix radio settings being saved when using one of the old Backpackonchest mods made for the old version of tfr, @rebel12340 would be awesome if you could look at making a tfr 1.0+ compatible version, if its anything like the backpacks its a very small change, the "stable" release of tfr is over a year old now and 1.0 fixes a lot of errors and is more stable/has better performance IMO, and the bonus is it adds a lot of new features and fixes broken ones.

Share this post


Link to post
Share on other sites
8 hours ago, SnakeDocc said:

I would suggest talking to deadman a bunch of function names ect were changed in 1.0+, I had to get help from him to fix radio settings being saved when using one of the old Backpackonchest mods made for the old version of tfr, @rebel12340 would be awesome if you could look at making a tfr 1.0+ compatible version, if its anything like the backpacks its a very small change, the "stable" release of tfr is over a year old now and 1.0 fixes a lot of errors and is more stable/has better performance IMO, and the bonus is it adds a lot of new features and fixes broken ones.

I just tested the script using the mission that I provided in the download with TFR version 1.0.264 and my radio was definitely being jammed. Are you having issues with the script as well? If so, have you tried the sample mission that comes with the script download? 

Share this post


Link to post
Share on other sites

Not yet personally, was just basing it on some other tfr compat issues I've had between the old and new tfr. I've just been watching the thread cause I'm planning on using the script soon. 

Share this post


Link to post
Share on other sites
1 minute ago, SnakeDocc said:

Not yet personally, was just basing it on some other tfr compat issues I've had between the old and new tfr. I've just been watching the thread cause I'm planning on using the script soon. 

Gotchya. Well, if you have any issues, feel free to let me know!

Share this post


Link to post
Share on other sites

Can you provide more information? What does the error say, exactly? What code are you using to execute the script?

  • Like 1

Share this post


Link to post
Share on other sites
14 hours ago, rebel12340 said:

Can you provide more information? What does the error say, exactly? What code are you using to execute the script?

I will tkae screenshot later one and post it :)

Here is the message i keep getting
https://ibb.co/fCO8p7



 

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

×