Jump to content
Sign in to follow this  
mantls

Roadside IED Script

Recommended Posts

What I'm doing wrong can't get this script working :confused:

http://img571.imageshack.us/img571/5906/ochh.jpg (344 kB)

Init.sqf

null = ["center", 12,500,"West", 1] execVM "IED\ied.sqf";

iedcounter = 0;

Disarm = {
        _unit = _this select 0;
	 _b = _this select 1;
	 _unit addAction ["Disarm", "IED\Disarm.sqf", ( _b), 0, false, true, "", "(_target distance _this) < 3"];

};		 

removeAct = {
            _unit = _this select 0;
		 _unit removeaction 0;
		 };

waitUntil {time > 0};
execVM "EtV.sqf";
waitUntil {!isNil "EtVInitialized"};
[player] call EtV_Actions;
execVM "grenadeStop.sqf";
execVM "briefing.sqf";
execVM "EtV.sqf";
setViewDistance 2500;
enableRadio false;
[] Spawn {
waitUntil{!(isNil "BIS_fnc_init")};
"Alpha1" setMarkerAlpha 0;

ied.sqf

//                                    |--------------------------------------------|  
//                                    | Dynamic IED script by - Mantis and MAD_T - |  
//                                    |        Version 2c - 12.6.2013              |  
//                                    | Check out TACO at www.nss-gamers.com       |  
//                                    |--------------------------------------------|  

// USAGE:
//        1. Create a Marker called "Center" somewhere on Map
//        2. Set Parameters in script.
//        3. Call it however you want (Init, trigger, addaction, etc...) 
//
//
//        NOTE: The more Roads in an area the higher the probability of IEDs spawning there.




//null = ["markername", amount, distance,side, cleanup(0 or 1)] execVM "IED\ied.sqf";


if (!isserver) exitwith {};


_centermrk = _this select 0;
_center = getmarkerpos _center;     // Your Centerpoint
_counter = 0;
_amount = _this select 1;                        // Amount of IEDS on Map        
_dist = _this select 2;
_check = _this select 4;
_side = _this select 3;
if (_check == 1) then {


while {_counter < _amount} do 
{
_force = random 100;
_rdist = 5.75;
_list = _center nearRoads _dist;
_iedarray =["Land_GarbagePallet_F","Land_CanisterFuel_F","Land_GarbageWashingMachine_F","Land_JunkPile_F","Land_CanisterPlastic_F","Land_Tyres_F","Land_GarbageBags_F","Land_Wreck_Truck_F"]; // Objects used as IEDs
_iedtype = _iedarray select (floor random (count _iedarray));
_road = _list select (round random (count _list));
_roadDir = getDir _road;
_chance = random 100;
_newDir = _roadDir;
if (_chance < 50) then {_newDir = (_NewDir + 180)};		
_dir = _newdir;
_pos = getpos _road;
_posx = _pos select 0;
_posy = _pos select 1;
_tx = (_posx + (_rdist * sin(_dir)));
_ty = (_posy + (_rdist * cos(_dir)));
_iedpos = [_tx,_ty,0];

Call compile format ['
ied_%1 = _iedtype createVehicle _iedpos;
ied_%1 setDir (random 360);
ied_%1 enableSimulation false;', iedcounter];



_junktype = _iedarray select (floor random (count _iedarray));
_road2 = _list select (round random (count _list));
 while { _road2 == _road} do
  { _road2 = _list select (round random (count _list));
   };   

_pos = getpos _road2;
_posx2 = _pos select 0;
_posy2 = _pos select 1;
_tx2 = (_posx2 + (_rdist * sin(_dir)));
_ty2 = (_posy2 + (_rdist * cos(_dir)));
_junkpos = [_tx2,_ty2,0];
_junk = _junktype createVehicle _junkpos;
_junk setdir (random 360);


if (_force >= 0 && _force < 33) then {

call compile format ['
t_%1 = createTrigger ["EmptyDetector", _iedpos]; 
t_%1 setTriggerArea [8,8,0,true]; 
t_%1 setTriggerActivation [_side,"PRESENT",false]; 
t_%1 setTriggerStatements ["this && {speed _x >= 4.8} foreach thislist && {((position  _x) select 2) < 3} foreach thislist && (alive ied_%1)","""M_Mo_82mm_AT_LG"" createVehicle %2;""M_Mo_82mm_AT_LG"" createVehicle %2; deletevehicle ied_%1",""];
', iedcounter, _iedpos];
};


if (_force >= 33 && _force < 70) then {

call compile format ['
t_%1 = createTrigger ["EmptyDetector", _iedpos]; 
t_%1 setTriggerArea [8,8,0,true]; 
t_%1 setTriggerActivation [_side,"PRESENT",false]; 
t_%1 setTriggerStatements ["this && {speed _x >= 4.8} foreach thislist && {((position  _x) select 2) < 3} foreach thislist && (alive ied_%1)","""M_Mo_82mm_AT_LG"" createVehicle %2;""M_Mo_82mm_AT_LG"" createVehicle %2;""M_Mo_82mm_AT_LG"" createVehicle %2; deletevehicle ied_%1",""];
', iedcounter, _iedpos];

};


if (_force >= 70 && _force <= 100) then {

call compile format ['
t_%1 = createTrigger ["EmptyDetector", _iedpos]; 
t_%1 setTriggerArea [8,8,0,true]; 
t_%1 setTriggerActivation [_side,"PRESENT",false]; 
t_%1 setTriggerStatements ["this && {speed _x >= 4.8} foreach thislist && {((position  _x) select 2) < 3} foreach thislist && (alive ied_%1)","""M_Mo_82mm_AT_LG"" createVehicle %2;""M_Mo_82mm_AT_LG"" createVehicle %2;""M_Mo_82mm_AT_LG"" createVehicle %2;""M_Mo_82mm_AT_LG"" createVehicle %2;""M_Mo_82mm_AT_LG"" createVehicle %2;""M_Mo_82mm_AT_LG"" createVehicle %2; deletevehicle ied_%1",""];
', iedcounter, _iedpos];

};





call compile format ['
[[ied_%1, t_%1],"Disarm", true, true] spawn BIS_fnc_MP;
[[ied_%1, t_%1],"explosive", true, true] spawn BIS_fnc_MP;', iedcounter];



call compile format ['                                             // DEBUG! comment out for full Mission
bombmarker_%1 = createmarker ["bombmarker_%1", _iedpos];
"bombmarker_%1" setMarkerTypeLocal "hd_warning";
"bombmarker_%1" setMarkerColorLocal "ColorRed";
"bombmarker_%1" setMarkerTextLocal "bomb";', iedcounter];
_counter = _counter + 1;
iedcounter = iedcounter + 1; 
};


}; 

if (_check == 0) then { 
   _counter = -1;
   while {iedcounter != _counter} do 
   {

    call compile format ['
    deletevehicle t_%1;
    deletevehicle ied_%1;
    deletemarker "bombmarker_%1";', iedcounter];



    iedcounter = iedcounter - 1;
  };
   _counter = 0;
iedcounter = 0;
 };

When the mission starts I receive errors.

http://img51.imageshack.us/img51/9830/zvvx.jpg (451 kB)

Can you please explain to me what I'm doing wrong I want to learn how you can setup this properly.

regards,

xjauntyx

Share this post


Link to post
Share on other sites

ied.sqf

//                                    |--------------------------------------------|  
//                                    | Dynamic IED script by - Mantis and MAD_T - |  
//                                    |        Version 2c - 12.6.2013              |  
//                                    | Check out TACO at www.nss-gamers.com       |  
//                                    |--------------------------------------------|  

// USAGE:
//        1. Create a Marker called "Center" somewhere on Map
//        2. Set Parameters in script.
//        3. Call it however you want (Init, trigger, addaction, etc...) 
//
//
//        NOTE: The more Roads in an area the higher the probability of IEDs spawning there.




//null = ["markername", amount, distance,side, cleanup(0 or 1)] execVM "IED\ied.sqf";


if (!isserver) exitwith {};


_centermrk = _this select 0;
_center = getmarkerpos _center;     // Your Centerpoint
_counter = 0;
_amount = _this select 1;                        // Amount of IEDS on Map        
_dist = _this select 2;
_check = _this select 4;
_side = _this select 3;
if (_check == 1) then {


while {_counter < _amount} do 
{
_force = random 100;
_rdist = 5.75;
_list = _center nearRoads _dist;
_iedarray =["Land_GarbagePallet_F","Land_CanisterFuel_F","Land_GarbageWashingMachine_F","Land_JunkPile_F","Land_CanisterPlastic_F","Land_Tyres_F","Land_GarbageBags_F","Land_Wreck_Truck_F"]; // Objects used as IEDs
_iedtype = _iedarray select (floor random (count _iedarray));
_road = _list select (round random (count _list));
_roadDir = getDir _road;
_chance = random 100;
_newDir = _roadDir;
if (_chance < 50) then {_newDir = (_NewDir + 180)};		
_dir = _newdir;
_pos = getpos _road;
_posx = _pos select 0;
_posy = _pos select 1;
_tx = (_posx + (_rdist * sin(_dir)));
_ty = (_posy + (_rdist * cos(_dir)));
_iedpos = [_tx,_ty,0];

Call compile format ['
ied_%1 = _iedtype createVehicle _iedpos;
ied_%1 setDir (random 360);
ied_%1 enableSimulation false;', iedcounter];



_junktype = _iedarray select (floor random (count _iedarray));
_road2 = _list select (round random (count _list));
 while { _road2 == _road} do
  { _road2 = _list select (round random (count _list));
   };   

_pos = getpos _road2;
_posx2 = _pos select 0;
_posy2 = _pos select 1;
_tx2 = (_posx2 + (_rdist * sin(_dir)));
_ty2 = (_posy2 + (_rdist * cos(_dir)));
_junkpos = [_tx2,_ty2,0];
_junk = _junktype createVehicle _junkpos;
_junk setdir (random 360);


if (_force >= 0 && _force < 33) then {

call compile format ['
t_%1 = createTrigger ["EmptyDetector", _iedpos]; 
t_%1 setTriggerArea [8,8,0,true]; 
t_%1 setTriggerActivation [_side,"PRESENT",false]; 
t_%1 setTriggerStatements ["this && {speed _x >= 4.8} foreach thislist && {((position  _x) select 2) < 3} foreach thislist && (alive ied_%1)","""M_Mo_82mm_AT_LG"" createVehicle %2;""M_Mo_82mm_AT_LG"" createVehicle %2; deletevehicle ied_%1",""];
', iedcounter, _iedpos];
};


if (_force >= 33 && _force < 70) then {

call compile format ['
t_%1 = createTrigger ["EmptyDetector", _iedpos]; 
t_%1 setTriggerArea [8,8,0,true]; 
t_%1 setTriggerActivation [_side,"PRESENT",false]; 
t_%1 setTriggerStatements ["this && {speed _x >= 4.8} foreach thislist && {((position  _x) select 2) < 3} foreach thislist && (alive ied_%1)","""M_Mo_82mm_AT_LG"" createVehicle %2;""M_Mo_82mm_AT_LG"" createVehicle %2;""M_Mo_82mm_AT_LG"" createVehicle %2; deletevehicle ied_%1",""];
', iedcounter, _iedpos];

};


if (_force >= 70 && _force <= 100) then {

call compile format ['
t_%1 = createTrigger ["EmptyDetector", _iedpos]; 
t_%1 setTriggerArea [8,8,0,true]; 
t_%1 setTriggerActivation [_side,"PRESENT",false]; 
t_%1 setTriggerStatements ["this && {speed _x >= 4.8} foreach thislist && {((position  _x) select 2) < 3} foreach thislist && (alive ied_%1)","""M_Mo_82mm_AT_LG"" createVehicle %2;""M_Mo_82mm_AT_LG"" createVehicle %2;""M_Mo_82mm_AT_LG"" createVehicle %2;""M_Mo_82mm_AT_LG"" createVehicle %2;""M_Mo_82mm_AT_LG"" createVehicle %2;""M_Mo_82mm_AT_LG"" createVehicle %2; deletevehicle ied_%1",""];
', iedcounter, _iedpos];

};





call compile format ['
[[ied_%1, t_%1],"Disarm", true, true] spawn BIS_fnc_MP;
[[ied_%1, t_%1],"explosive", true, true] spawn BIS_fnc_MP;', iedcounter];



call compile format ['                                             // DEBUG! comment out for full Mission
bombmarker_%1 = createmarker ["bombmarker_%1", _iedpos];
"bombmarker_%1" setMarkerTypeLocal "hd_warning";
"bombmarker_%1" setMarkerColorLocal "ColorRed";
"bombmarker_%1" setMarkerTextLocal "bomb";', iedcounter];
_counter = _counter + 1;
iedcounter = iedcounter + 1; 
};


}; 

if (_check == 0) then { 
   _counter = -1;
   while {iedcounter != _counter} do 
   {

    call compile format ['
    deletevehicle t_%1;
    deletevehicle ied_%1;
    deletemarker "bombmarker_%1";', iedcounter];



    iedcounter = iedcounter - 1;
  };
   _counter = 0;
iedcounter = 0;
 };

When the mission starts I receive errors.

http://img51.imageshack.us/img51/9830/zvvx.jpg (451 kB)

You need to change the line:

_center = getmarkerpos _center;

to:

_center = getmarkerpos "center";

its erroring because you're trying to get the marker pos for a nonexistent variable - _center. its only just being set for the first time. This would work fine if written like this (although illogical):

_center = "center";

_center = getmarkerpos _center;

Share this post


Link to post
Share on other sites
You need to change the line:

_center = getmarkerpos _center;

to:

_center = getmarkerpos "center";

its erroring because you're trying to get the marker pos for a nonexistent variable - _center. its only just being set for the first time. This would work fine if written like this (although illogical):

_center = "center";

_center = getmarkerpos _center;

@ xjauntyx

have you played with your ied.sqf?

It originally says:

_centermrk = _this select 0;
_center = getmarkerpos _centermrk; 

EDIT: Oops, quoted the wrong person :D

Share this post


Link to post
Share on other sites
You need to change the line:

_center = getmarkerpos _center;

to:

_center = getmarkerpos "center";

its erroring because you're trying to get the marker pos for a nonexistent variable - _center. its only just being set for the first time. This would work fine if written like this (although illogical):

_center = "center";

_center = getmarkerpos _center;

I love you! :D

I saw no quote marks in the readme file so basicly what I did was only filled in the name of my center point like this _variable didn't knew you needed to remove the underscore and add quote marks! :)

Thank you for pointing out my problem its working now.

---------- Post added at 14:16 ---------- Previous post was at 13:47 ----------

Having a problem with the disarm part of the script.. I have a toolkit and clean up set to 1 , when i approach the potential IED slow and mousewheel over the item I don't get an action to disarm. I figured it wasnt an IED so i ran to the other side and BOOM lol.. any ideas?

I experience exactly the same...

Plus the map shows where the IED's are located kinda weird.

http://img202.imageshack.us/img202/7050/w68z.jpg (929 kB)

Edited by xjauntyx

Share this post


Link to post
Share on other sites
Having a problem with the disarm part of the script.. I have a toolkit and clean up set to 1 , when i approach the potential IED slow and mousewheel over the item I don't get an action to disarm. I figured it wasnt an IED so i ran to the other side and BOOM lol.. any ideas?

Ok I've found the problem! Yesterday I experienced exactly the same problem. No action about disarm the explosive was in my menu when I approached the IED it was directly "kaaboom!" You'll be able to disarm it only when you are proned otherwise you'll trigger the IED.

The only problem what I encounter right now is that the IED's are marked on the map thats not really funny hopefully someone can tip me how to hide the IED's from visibilty on the map.

Share this post


Link to post
Share on other sites

I can't seem to get this working anymore with the latest dev build (as of 080813). The script throws several undefined variable errors and also an error with BIS_fnc_MPexec. Does anyone have this working? I really liked the script when it worked. Thanks in advance for any suggestions or help.

Z

Share this post


Link to post
Share on other sites
I can't seem to get this working anymore with the latest dev build (as of 080813). The script throws several undefined variable errors and also an error with BIS_fnc_MPexec. Does anyone have this working? I really liked the script when it worked. Thanks in advance for any suggestions or help.

Z

I think that might be due to the isPersistent param of it. Was using that, ill fix it eventually, got a few things to do though.

Share this post


Link to post
Share on other sites

mantls - Are you still supporting this script or have you moved on to bigger better things? If you are still developing it, I and a few other posters here are experiencing no DISARM action when trying to disarm an IED. The Toolkit is the inventory and when you go to walk away... BOOM!

I have edited the required item to the minedetector just to be sure that it was not a class specific thing and same thing. I have noticed that when the script is on a dedicated server is when this happens.

I have tried this in the editor preview and the local MP hosted and it works almost every time. Any ideas?

Share this post


Link to post
Share on other sites

yes, it was/is using the 'bis_fnc_mp' more specifically its isPersistent param. Said option has been disabled since last patch. It was not a nice solution anyway and i'll have to fix that.

I pretty much know how, just gotta get myself up. Can't give you an ETA though since i'm pretty busy with school.

Share this post


Link to post
Share on other sites
Said option has been disabled since last patch.

Huh? Where's that been documented? There's nothing in the discussion threads, wiki or patch notes stating that it's been removed.

Share this post


Link to post
Share on other sites

what? i'm sure i saw that in the changelog. Waaaaaait.

Share this post


Link to post
Share on other sites

I would like to humbly request that someone in the A,A2 & A3 scripting community recommend a fix or work around for this issue. I wrote an entire reward system to support the successful disarming of the IED, and this non function really hinders that effort.

Because of his busy schedule mantls, will not be able to get to this anytime soon, so any help would be most appreciated.

Thank you

Share this post


Link to post
Share on other sites
I would like to humbly request that someone in the A,A2 & A3 scripting community recommend a fix or work around for this issue.

Pretty Please? :butbut:

Share this post


Link to post
Share on other sites

Here it is with some updated ArmA3 function magic, no more error messages and I think it's working. Give it a shot. :)

IED\init.sqf:

iedcounter = 0;


IED_Disarm = {
   _unit = [_this, 0, objNull, [objNull]] call BIS_fnc_param;
_IED = [_this, 1, objNull, [objNull]] call BIS_fnc_param;
_unit addAction ["Disarm", "IED\Disarm.sqf", _IED, 0, false, true, "", "(_target distance _this) < 3"];
};		 

IED_removeAct = {
   _unit = [_this, 0, objNull, [objNull]] call BIS_fnc_param;
_unit removeaction 0;
};

IED\ied.sqf:

//                                    |--------------------------------------------|  
//                                    | Dynamic IED script by - Mantis and MAD_T - |  
//                                    |        Modified by kylania                 |  
//                                    |        Version 2cMod1 - 25.8.2013          |  
//                                    | Check out TACO at www.nss-gamers.com       |  
//                                    |--------------------------------------------|  

// USAGE:
//        1. Create a Marker called "Center" somewhere on Map
//        2. Set Parameters in script.
//        3. Call it however you want (Init, trigger, addaction, etc...) 
//
//
//        NOTE: The more Roads in an area the higher the probability of IEDs spawning there.

//null = [] execVM "IED\ied.sqf";
// Optionally:
// _null = ["myMarker", 100, 1000, "EAST", TRUE, TRUE] execVM "IED\ied.sqf";
// Would call 100 IEDs within 1000m of "myMarker" triggered by EAST units and all would be marked on the map.


if (!isserver) exitwith {};


_centermrk = [_this, 0, "center", [""]] call BIS_fnc_param;  // Your Centerpoint Default: "center"
_amount = [_this, 1, 10, [123]] call BIS_fnc_param;  // Amount of IEDS on Map Default: 10 IEDs    
_dist = [_this, 2, 500, [123]] call BIS_fnc_param; // distance from road Default: 500m
_side = [_this, 3, "WEST", [""]] call BIS_fnc_param;  // side to trigger IEDs Default: "WEST"
_cleanup = [_this, 4, TRUE, [TRUE]] call BIS_fnc_param;  // Clean up? true/false Default: TRUE
_debug = [_this, 5, FALSE, [FALSE]] call BIS_fnc_param;  // Debug Markers? true/false Default: FALSE

_center = getmarkerpos _centermrk;     
_counter = 0;
_rdist = 5.75;

// Objects used as IEDs
_iedarray =["Land_GarbagePallet_F","Land_CanisterFuel_F","Land_GarbageWashingMachine_F","Land_JunkPile_F","Land_CanisterPlastic_F","Land_Tyres_F","Land_GarbageBags_F","Land_Wreck_Truck_F"]; 


if (_cleanup) then {
 while {_counter < _amount} do {
   _force = random 100;
   _list = _center nearRoads _dist;
   //["list: %1",_list] call BIS_fnc_error;
   _iedtype = _iedarray select (floor random (count _iedarray));
   //_road = _list select (round random (count _list));
   _road = [_list, (round random (count _list)), objNull, [objNull]] call BIS_fnc_param;
   _roadDir = getDir _road;
   _chance = random 100;
   _newDir = _roadDir;
   if (_chance < 50) then {_newDir = (_NewDir + 180)};		
   _dir = _newdir;
   _pos = getpos _road;
   _posx = _pos select 0;
   _posy = _pos select 1;
   _tx = (_posx + (_rdist * sin(_dir)));
   _ty = (_posy + (_rdist * cos(_dir)));
   _iedpos = [_tx,_ty,0];


   _ied = createVehicle [_iedtype, _iedpos, [], 0, ""];
   _ied setDir (random 360);
   _ied setPos getPos _ied;
   _ied enableSimulation false;
   _iedName = format["ied%1", iedcounter];
   missionNameSpace setVariable [_iedName, _ied];

   _junktype = _iedarray select (floor random (count _iedarray));
   //_road2 = _list select (round random (count _list));
   _road2 = [_list, (round random (count _list)), objNull, [objNull]] call BIS_fnc_param;
   while { _road2 == _road} do {
     //_road2 = _list select (round random (count _list));
     _road2 = [_list, (round random (count _list)), objNull, [objNull]] call BIS_fnc_param;
   };   

   _pos = getpos _road2;
   _posx2 = _pos select 0;
   _posy2 = _pos select 1;
   _tx2 = (_posx2 + (_rdist * sin(_dir)));
   _ty2 = (_posy2 + (_rdist * cos(_dir)));
   _junkpos = [_tx2,_ty2,0];
   _junk = createvehicle [_junktype, _junkpos, [], 0, ""];

   if (_force >= 0 && _force < 33) then {

     call compile format ['
     t_%1 = createTrigger ["EmptyDetector", %2]; 
     t_%1 setTriggerArea [8,8,0,true]; 
     t_%1 setTriggerActivation [_side,"PRESENT",false]; 
     t_%1 setTriggerStatements ["this && {speed _x >= 4.8} foreach thislist && {((position  _x) select 2) < 3} foreach thislist && (alive ied%1)","""M_Mo_82mm_AT_LG"" createVehicle %2;""M_Mo_82mm_AT_LG"" createVehicle %2; deletevehicle ied%1",""];
     ', iedcounter, getPos _ied];
   };  


   if (_force >= 33 && _force < 70) then {

     call compile format ['
     t_%1 = createTrigger ["EmptyDetector", %2]; 
     t_%1 setTriggerArea [8,8,0,true]; 
     t_%1 setTriggerActivation [_side,"PRESENT",false]; 
     t_%1 setTriggerStatements ["this && {speed _x >= 4.8} foreach thislist && {((position  _x) select 2) < 3} foreach thislist && (alive ied%1)","""M_Mo_82mm_AT_LG"" createVehicle %2;""M_Mo_82mm_AT_LG"" createVehicle %2;""M_Mo_82mm_AT_LG"" createVehicle %2; deletevehicle ied%1",""];
     ', iedcounter, getPos _ied];
   };

   if (_force >= 70 && _force <= 100) then {

     call compile format ['
     t_%1 = createTrigger ["EmptyDetector", %2]; 
     t_%1 setTriggerArea [8,8,0,true]; 
     t_%1 setTriggerActivation [_side,"PRESENT",false]; 
     t_%1 setTriggerStatements ["this && {speed _x >= 4.8} foreach thislist && {((position  _x) select 2) < 3} foreach thislist && (alive ied%1)","""M_Mo_82mm_AT_LG"" createVehicle %2;""M_Mo_82mm_AT_LG"" createVehicle %2;""M_Mo_82mm_AT_LG"" createVehicle %2;""M_Mo_82mm_AT_LG"" createVehicle %2;""M_Mo_82mm_AT_LG"" createVehicle %2;""M_Mo_82mm_AT_LG"" createVehicle %2; deletevehicle ied%1",""];
     ', iedcounter, getPos _ied];
   };

   // Add disarm action.
   call compile format ['
   [[ied%1, t_%1],"IED_Disarm", true, true] spawn BIS_fnc_MP;', iedcounter];

   //[[ied_%1, t_%1],"explosive", true, true] spawn BIS_fnc_MP;

   // Print markers where IEDs are
   if (_debug) then {
     call compile format ['                                             
     bombmarker_%1 = createmarker ["bombmarker_%1", %2];
     "bombmarker_%1" setMarkerTypeLocal "hd_warning";
     "bombmarker_%1" setMarkerColorLocal "ColorRed";
     "bombmarker_%1" setMarkerTextLocal "Bomb %1";', iedcounter, getPos _ied];

     call compile format ['                                             
     tbombmarker_%1 = createmarker ["tbombmarker_%1", getPos t_%1];
     "tbombmarker_%1" setMarkerTypeLocal "hd_warning";
     "tbombmarker_%1" setMarkerColorLocal "ColorGreen";
     "tbombmarker_%1" setMarkerTextLocal "Trigger %1";', iedcounter];
   };

   // Increment
   _counter = _counter + 1;
   iedcounter = iedcounter + 1; 
 }; // end of while
}; // end of _cleanup

if (!_cleanup) then { 
 _counter = -1;
 while {iedcounter != _counter} do {
   call compile format ['
     deletevehicle t_%1;
     deletevehicle ied%1;
     deletemarker "bombmarker_%1";', iedcounter];

   iedcounter = iedcounter - 1;
 };
 _counter = 0;
iedcounter = 0;
};

IED\disarm.sqf:

//private ["t_%1"];

t = (_this select 0);

_array_item = items player;


if (_array_item find "ToolKit" > -1) then {

player switchMove "AinvPknlMstpSlayWrflDnon_medic";
sleep 5.5;
deletevehicle (_this select 3);
[[t],"IED_removeAct", true, true] spawn BIS_fnc_MP;
hint "Disarmed!";

}

else {


 player switchMove "AinvPknlMstpSlayWrflDnon_medic";
 sleep 2;
 "M_Mo_82mm_AT_LG" createVehicle (position t);
 "M_Mo_82mm_AT_LG" createVehicle (position t);
 "M_Mo_82mm_AT_LG" createVehicle (position t);
 deletevehicle (_this select 3);
 [[t],"IED_removeAct", true, true] spawn BIS_fnc_MP;
 deletevehicle t;
 };

Edited by kylania

Share this post


Link to post
Share on other sites

WOW thank you so much for answering the call kylania.

I made a simple mission to test and I have determined the following:

Pros:

Disarm now shows on IED's

Disarming action works with resulting HINT and disarmament

Debug mode works as expected

Disarming without the proper tool in inventory causing bomb to explode

Cons:

Proximity script does not appear to function. Player can run up to and around IED with no affect.

Please advise

Share this post


Link to post
Share on other sites

It was 5am so I didn't even look at the trigger stuff, I was just trying to make the errors go away. :) I'll take another peek at it later today.

Share this post


Link to post
Share on other sites

Ok, the triggers should work now. I'd not noticed that I forgot to update the IED names in them. I had a wrong argument in the createvehicle. For some reason I thought the placement radius was the direction, oops! :) So the triggers were spawning in the correct place but the actual IED was up to 360 meters away! All good now though.

Share this post


Link to post
Share on other sites
Ok, the triggers should work now. I'd not noticed that I forgot to update the IED names in them. I had a wrong argument in the createvehicle. For some reason I thought the placement radius was the direction, oops! :) So the triggers were spawning in the correct place but the actual IED was up to 360 meters away! All good now though.

Works like a charm :)

You sir are an angel! I worked on this script for over 20 hours trying to figure it out before I waved the flag. I did learn something though.............. I have SO much more to learn ;)

Thank you again kylania

---------- Post added at 04:02 PM ---------- Previous post was at 02:16 PM ----------

Sad face here..... Looks like I spoke to soon :(

It work perfect in the preview but the disarm option does not show on the dedicated server?

Any idea why?

Share this post


Link to post
Share on other sites

Hmm, you're sure you weren't checking junk piles? The script seems to create a junk item along with the actual IEDs but those won't get disarm options.

Share this post


Link to post
Share on other sites

hmm, my dedicated server is super out of date so it'll take forever to update. This code should be working not sure what's wrong. Maybe try changing the BIS_fnc_MP thing to nil, true instead of true, true?

Share this post


Link to post
Share on other sites

I made the nil, true change and no good.

Kylania I sent a PM with some option if you would.

Thank you

Share this post


Link to post
Share on other sites

Here's a working demo on dedi test mission Hajimoto made up. Functions weren't loading for the first guy in, so I moved them into preinit mode. Super sexy!

Share this post


Link to post
Share on other sites

@kylania and @Hajimoto

Hey guys, I've been following this thread and hoping someone could help with getting it working again. So, after the last couple of posts, what's the status? Is it working on dedicated server? If so, is there a way to get the updated scripts please?

Thanks Kylania for taking the time to work on this for those of us who really like it but can't fix it ourselves (aka: me) lol.

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
Sign in to follow this  

×