pierremgi 4853 Posted November 26, 2019 DETONATING CORD Hi all, This topic gave me the idea to script a little for a detonating cord. So, you can add this code in init.sqf or else. Just be sure your unit(s) created before running the code. Parameters: UNITS / PROJECTILE / SAFETY DISTANCE / CORD LENGTH Spoiler [ <object (unit) or array of units - player, single unit or arrays of any units>, // example: allPlayers default: [], so nothing occurs. This parameter is mandatory. <string - specific type of thrown projectile by the unit(s) > // example: "SmokeShellYellow" (optional) default: "SmokeShellOrange" <number - minimal distance from the start of the cord to fire a detonation> (optional) default: 15 <number - cord length> (optional) default: 60 ] MGI_fnc_detCord = { params [["_units",[],[objNull,[]]],["_thrownEnd","SmokeShellOrange"],["_safetyDist",15],["_cordLength",60]]; if (_units isEqualType objNull) then {_units = [_units]}; MGI_passToEhCord = [_thrownEnd,_safetyDist,_cordLength]; { _x addEventHandler ["firedMan", { params ["_unit", "", "", "", "", "_magazine", "_projectile"]; MGI_passToEhCord params ["_thrownEnd","_safetyDist","_cordLength"]; if (_magazine == _thrownEnd) then { [_unit,_projectile,_safetyDist,_cordLength] spawn { params ["_unit","_projectile","_safetyDist","_cordLength"]; private _veh = if (isNull objectParent _unit) then [{"B_UAV_01_F" createVehicleLocal getpos _unit},{objectParent _unit}]; if (_veh isKindOf "B_UAV_01_F") then {_veh hideObject true}; private _rope = ropeCreate [_veh,[0,0,0],_projectile,[0,0,0],_cordLength,["",[0,0,10]]]; uisleep 6; private _segs = (_veh nearObjects ["ropesegment",_cordLength]) select {_x distanceSqr _veh > _safetyDist^2}; if !(_segs isEqualTo []) then { _unit addAction ["detonate cord",{ params ["_target", "_caller", "_id", "_args","_exploEnd"]; _args params ["_rope","_veh","_segs","_projectile"]; _target removeAction _id; for "_i" from 0 to count _segs -1 do { _explo = createVehicle ["mini_grenade",getpos (_segs #_i),[],0,"CAN_COLLIDE"]; _explo hideObjectGlobal true; if (_i == count _segs -1) then {_exploEnd = _explo}; }; waitUntil {isNull _exploEnd}; if (_veh isKindOf "B_UAV_01_F") then {deleteVehicle _veh}; deleteVehicle _rope; deleteVehicle _projectile; },[_rope,_veh,_segs,_projectile],0,true,false,"","alive _target"]; }; }; }; }]; } forEach _units; }; player call MGI_fnc_detCord; // example Have fun! 3 4 Share this post Link to post Share on other sites
INF_MIke64 53 Posted November 26, 2019 Brilliant I love this. Think if you made a custom item config you could end up with a throwable detcord object. 2 Share this post Link to post Share on other sites
FenixDK 0 Posted August 26, 2023 Lovely script for APOBS. Any idea why the cord legth does not go beyond about 50 meters no matter what parameters are set? Share this post Link to post Share on other sites
pierremgi 4853 Posted August 27, 2023 17 hours ago, FenixDK said: Lovely script for APOBS. Any idea why the cord legth does not go beyond about 50 meters no matter what parameters are set? I don't have the full explanation but ropes are limited to 63 segments. ropeCreate And Arma's cabinet of curiosities : Arma_3:_Ropes Btw, this script works for smoke hand grenades, throwing a specific one (here orange) during game. In MGI advanced modules, things are little bit different. In "Blast and Fire" module, if you tick the "demine with det cord" option, the player(s) can throw rope when firing any smoke grenade (from GL) if holding ALT (left). If not, the smoke grenade is not replaced by rope. 2 Share this post Link to post Share on other sites
Harzach 2517 Posted August 27, 2023 I was fiddling with this earlier (it's neat!) and was able to "throw" det cord using GL and even bullets. I could not achieve a rope longer than 90 meters, however, which I assumed was a limitation of the rope system. 1 Share this post Link to post Share on other sites
Mirek 166 Posted January 14 How does one make this work? I added the code to my init.sqf, equipped myself with orange smoke, but nothing happend. Share this post Link to post Share on other sites