Jump to content

Recommended Posts

Hey guys,

 

I was recently thinking of something that I saw in a separate mod, which is unfortunately not being developed any more, strictly speaking, radio jammer for radio controlled IED detonations.

 

There is a mod which comes with a backpack item that has that option but it naturally only works for the explosives provided by that specific mod. I would, however, like to try and incorporate the same mechanism but to the ACE Explosives.

 

Turns out there is a function for that but I am not skilled enough to implement it using my scripting skills. I have found this:
https://ace3mod.com/wiki/framework/explosives-framework.html#53-detonation-handler

 

At the very bottom of the page there is a section which seems to be doing what I need it to do, which is block all the detonations of radio controlled explosives (such as the cellphone). I was thinking about using this code possibly in a form of a switch that the player could use. Similarly to the backpack from the other mod, it could be whatever item that the player can have (possibly some kind of a backpack as well) that would have the ON and OFF switch. Those switches would then control whether the Cellphone detonation of an IED is possible or not.

 

Another thing I found was that Achilles actually seems to have a similar functionality but it appears to be restricted to Zeus-placed objects via this specific module as well as looks to be "jammable" only by an actual vehicle. I will need to test this one today tho.

https://github.com/ArmaAchilles/Achilles/wiki/Module-Information

 

I would be very grateful for any help in terms of how to achieve that result possibly using that first bit of code. 

 

Thanks a lot!

Adam

Share this post


Link to post
Share on other sites
Quote

[{
    params ["_unit", "_range", "_explosive", "_fuzeTime", "_triggerItem"];
    
    private _nearbyUnits = allPlayers select {_x distance _explosive < (INSERT JAMMER RANGE HERE)};
    
    private _unitHasJammer = _nearbyUnits findIf {
        (INSERT JAMMER ITEM CLASSNAME HERE) in backpackItems _x    
    } != -1;
    
    !_unitHasJammer //Only trigger if there is not a jammer nearby
}] call ace_explosives_fnc_addDetonateHandler;

Something like this probably. I assume it would go into init.sqf or initPlayerLocal.sqf

Make sure to replace the allcaps things. Performance of this is not optimal, but considering how often someone triggers a explosive it shouldn't matter much.

 

That code assumes you just want to make that existing mod compatible with all ace explosives.
You can also use the classname of any other item if you want.
There is not really a on-off switch. But moving the item from backpack to vest or uniform would "turn it off" and moving it into backpack would "turn it on" so I guess it kinda has a switch? Maybe that's enough for what you need.

Share this post


Link to post
Share on other sites

Thansk for the quick response @Dedmen.

 

To be honest I am not planning on using the other mod, just used it as an example which I got the idea from and then found the function in the ACE 3 Framework page.

 

I am still curious as to how the original mod creators managed to add that turn on option. It is literally a backpack with a few replacable antennaes all of which stand for the jamming range. Once you have that backpack you have a scroll wheel option to turn it on and off. It even blocks TFAR comms (as it's RF jam in the end).

 

I sure will try your solution today too. Will see how it goes but I am still open for any other suggestions.

 

Thanks!

Share this post


Link to post
Share on other sites
5 hours ago, Dj Rolnik said:

I am still curious as to how the original mod creators managed to add that turn on option.

Maybe just scripted. Or they switch out the items for a on/off version

Share this post


Link to post
Share on other sites

Ok, so for now I have tried the code provided in the ACE3 Framework wiki, copied below:

[{
    params ["_unit", "_range", "_explosive", "_fuzeTime", "_triggerItem"];
    if (_triggerItem == "ace_cellphone") exitWith { systemChat "Blocking Cell Phone"; false };  // always block cell phones
    if (_triggerItem == "ace_m26_clacker") exitWith {
        _range = _range / 1000;
        private _actualRange = _unit distance _explosive;
        systemChat format ["Limited Range For RF Clacker [%1m / %2m]", _actualRange toFixed 1, _range toFixed 1];
        (_actualRange < _range) // return bool
    };
    // allow anything else (like timers / wired clackers)
    true
}] call ace_explosives_fnc_addDetonateHandler;

I have copied all that into a separate .sqf which I run on a simple addAction - works just fine.

However, I cannot seem to revert the process. I would still like to turn the jammer off but cannot understand which parameter I would need to change in order to do so.

 

Any advice?

 

Thanks!

Share this post


Link to post
Share on other sites

 

23 hours ago, Dj Rolnik said:

 


[{
    params ["_unit", "_range", "_explosive", "_fuzeTime", "_triggerItem"];
    if (_triggerItem == "ace_cellphone") exitWith { systemChat "Blocking Cell Phone"; false };  // always block cell phones
    if (_triggerItem == "ace_m26_clacker") exitWith {
        _range = _range / 1000;
        private _actualRange = _unit distance _explosive;
        systemChat format ["Limited Range For RF Clacker [%1m / %2m]", _actualRange toFixed 1, _range toFixed 1];
        (_actualRange < _range) // return bool
    };
    // allow anything else (like timers / wired clackers)
    true
}] call ace_explosives_fnc_addDetonateHandler;

 

 

 

Interesting. Might use this for my group. Anyway try creating an "off" action and apply this.

 

[{
    params ["_unit", "_range", "_explosive", "_fuzeTime", "_triggerItem"];
    if (_triggerItem == "ace_cellphone") exitWith { systemChat "Unblocking Cell Phone"; false };  // always block cell phones
    if (_triggerItem == "ace_m26_clacker") exitWith {
        _range = _range / 0;
        private _actualRange = _unit distance _explosive;
        systemChat format ["Jammer Disabled", _actualRange toFixed 1, _range toFixed 1]; //Don't know if this is needed or if it can be cut.
        (_actualRange < _range) // return bool
    };
    // allow anything else (like timers / wired clackers)
    true
}] call ace_explosives_fnc_addDetonateHandler;

 

 

 

Anyway, I don't have a lot of knowledge of systemchat but I assume that it's the chat menu. Please feel free to correct me. Knowledge is power yo!

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

×