Jump to content
brians200

Randomly generated roadside IEDs

Recommended Posts

Please post your init.sqf and Ied_Settings.sqf files or the whole mission

Edited by brians200

Share this post


Link to post
Share on other sites

is it possible to call your fabulous particle explosions somehow? It would be great to combine your large explosions effect centered on a collapsing building.

Share this post


Link to post
Share on other sites

init.sqf

waitUntil { isServer || !isNull player };

#ifndef execNow

#define execNow call compile preprocessfilelinenumbers

#endif

execVM "gvs\gvs_init.sqf";

_igiload = execVM "IgiLoad\IgiLoadInit.sqf";

[]execVM "R3F_ARTY_AND_LOG\init.sqf";

enableSaving [false,false];

// TcB AIS Wounding System --------------------------------------------------------------------------

if (!isDedicated) then {

TCB_AIS_PATH = "ais_injury\";

{[_x] execVM (TCB_AIS_PATH+"init_ais.sqf")} forEach (if (isMultiplayer) then {playableUnits} else {switchableUnits}); // execute for every playable unit

//{[_x] execVM (TCB_AIS_PATH+"init_ais.sqf")} forEach (units group player); // only own group - you cant help strange group members

//{[_x] execVM (TCB_AIS_PATH+"init_ais.sqf")} forEach [p1,p2,p3,p4,p5]; // only some defined units

};

// --------------------------------------------------------------------------------------------------------------

ztowninit = 0;

z_debug = false;

execNow "core\init.sqf";

execNow "ambience\init.sqf";

execNow "support\init.sqf";

execNow "enemy\init.sqf";

if (!isNull player) then { call compile preprocessFileLineNumbers "initClient.sqf"; };

diag_log format["Initialisation Completed", time];

[] spawn {call compile preprocessFileLineNumbers "EPD\Ied_Init.sqf";};

Ied_Settings.sqf

/***************SETTINGS***********************/

EPD_IED_debug = true;

hideIedSectionMarkers = true; //sets the alpha to 0 after spawning IEDs at a section

hideSafeZoneMarkers = true; //sets the alpha to 0 of a safezone

itemsRequiredToDisarm = ["MineDetector"]; //"MineDetector" or "ToolKit" for example

betterDisarmers = ["B_soldier_exp_F", "B_engineer_F", "B_diver_exp_F", "B_recon_exp_F","B_G_Soldier_exp_F","B_G_engineer_F"]; // people who are better at disarming

baseDisarmChance = 75; //how well everybody can disarm

bonusDisarmChance = 20; //increase that the "betterDisarmers" get

secondaryChance = 50; //Chance that a secondary IED will spawn.

smallChance = 40; //Chance that a small IED will be chosen.

mediumChance = 40; //Chance that a medium IED will be chosen.

largeChance = 20; //Chance that a large IED will be chosen.

iedSecondaryItems = ["Land_CanisterOil_F","Land_FMradio_F","Land_Canteen_F","Land_CerealsBox_F","Land_BottlePlastic_V1_F","Land_HandyCam_F","Land_PowderedMilk_F","Land_RiceBox_F","Land_TacticalBacon_F","Land_VitaminBottle_F","Land_BottlePlastic_V2_F"];

iedSmallItems = ["RoadCone_F","Land_Pallets_F","Land_WheelCart_F","Land_Tyre_F","Land_ButaneCanister_F","Land_Bucket_F","Land_GasCanister_F","Land_Pillow_F"];

iedMediumItems = ["Land_Portable_generator_F","Land_WoodenBox_F","Land_MetalBarrel_F","Land_BarrelTrash_grey_F","Land_Sacks_heap_F","Land_WoodenLog_F","Land_WoodPile_F"];

iedLargeItems = ["Land_Bricks_V2_F","Land_Bricks_V3_F","Land_Bricks_V4_F","Land_GarbageBags_F","Land_GarbagePallet_F","Land_GarbageWashingMachine_F","Land_JunkPile_F","Land_Tyres_F","Land_Wreck_Skodovka_F","Land_Wreck_Car_F","Land_Wreck_Car3_F","Land_Wreck_Car2_F","Land_Wreck_Offroad_F","Land_Wreck_Offroad2_F"];

//If you want to use locations without making markers on the map, define them here. Altis has been provided as an example. ***THESE ARE NOT WHERE THE ACTUAL IEDS ARE SPAWNED***

//["Name",[LocationX,LocationY,LocationZ],size]

predefinedLocations = [["AltisRandom1",[4941.03,20430.1,0],2000],["AltisRandom2",[5796.45,16578.8,0],2000],["AltisRandom3",[5435.57,12633.9,0],2000],["AltisRandom4",[9579.01,20978.4,0],2000],["AltisRandom5",[10020.1,16859.6,0],2000],["AltisRandom6",[9779.5,12901.4,0],2000],["AltisRandom7",[13749.2,21392.9,0],2000],["AltisRandom8",[13048.1,18153.4,0],2000],["AltisRandom9",[17677.8,17309.3,0],2000],["AltisRandom10",[26097.5,22777.3,0],2000],["AltisRandom11",[23259.9,19904.4,0],2000],["AltisRandom12",[21356.9,17014.4,0],2000],["AltisRandom13",[19267,13716.4,0],2000],["AltisRandom14",[17033.2,10641.5,0],2000],["AltisRandom15",[20342.5,8704.69,0],2000],["AltisRandom16",[11108.5,8551.36,0],2000]];

iedPredefinedLocationsSize = count predefinedLocations;

/***************EXPERIMENTAL***********************/

// This is still being worked on and may contain bugs, please report them on the forums.

allowExplosiveToTriggerIEDs = true;

/***************END EXPERIMENTAL*******************/

//These are the actual IEDs that will spawn. Add them using one of the following formats.

//mapLocations must have their type defined as one of "NameCityCapital","NameCity","NameVillage", "NameLocal"

//["All", side]

//["AllCities", side]

//["AllVillages", side]

//["AllLocals", side]

//["mapLocation", side]

//["mapLocation", amountToPlace, side];

//["mapLocation", iedsToPlace, fakesToPlace, side]

//["mapLocation", amountToPlace, [fakeChance, smallIedChance, mediumIedChance, largeIedChance], side]

//["predefinedLocation", side]

//["predefinedLocation", amountToPlace, side];

//["predefinedLocation", iedsToPlace, fakesToPlace, side]

//["predefinedLocation", amountToPlace, [fakeChance, smallIedChance, mediumIedChance, largeIedChance], side]

/*********Marker size > 1**********************/

//["marker", amountToPlace, [fakeChance, smallIedChance, mediumIedChance, largeIedChance], side]

//["marker", iedsToPlace, fakesToPlace, side]

//["marker", amountToPlace, side]

//["marker", side]

/*********Marker size = 1**********************/

//["marker", side]

//["marker", chanceToBeReal, side]

//["marker", [fakeChance, smallIedChance, mediumIedChance, largeIedChance] , side]

//The side can be a single side, or an array of sides

//Ex. "West" or ["West,"East"]

//http://community.bistudio.com/wiki/side

iedInitialArray = [

["AllCities","West"],

["AllVillages","West"],

/*["AltisRandom1",6,"West"],

["AltisRandom2",6,"West"],

["AltisRandom3",6,"West"],

["AltisRandom4",6,"West"],

["AltisRandom5",6,"West"],

["AltisRandom6",6,"West"],

["AltisRandom7",6,"West"],

["AltisRandom8",6,"West"],

["AltisRandom9",6,"West"],

["AltisRandom10",6,"West"],

["AltisRandom11",6,"West"],

["AltisRandom12",6,"West"],

["AltisRandom13",6,"West"],

["AltisRandom14",6,"West"],

["AltisRandom15",6,"West"],

["AltisRandom16",6,"West"],*/

//["Gravia", 20, [0, 30, 0, 0], "West" ],

//["Lakka", 2, 8, ["West","East"] ],

//["OreoKastro", "West"],

//["Athira", 2, "West" ],

["IEDSINGLE1", ["West","East"]],

["IEDSINGLE2", 50 ,"West"],

["IEDSINGLE3", [0,0,0,100], "West"]

];

//Place the mapLocations, predefinedLocations, and markerNames of places you don't want any IEDs spawning

iedSafeZones = ["SafeZone"];

Edited by Disab

Share this post


Link to post
Share on other sites
is it possible to call your fabulous particle explosions somehow? It would be great to combine your large explosions effect centered on a collapsing building.

Sure. Are you talking about just the smoke and rock particle effects or the actual explosions?

You will need to have this file compiled. https://github.com/Brians200/EPD-IED/blob/master/EPD/IED/ExplosionEffects.sqf

Then you can call the various ones, changing _iedPosition to the location you care about.

[[_iedPosition] , "IED_SMOKE_LARGE", true, false] spawn BIS_fnc_MP;

[[_iedPosition] , "IED_SMOKE_MEDIUM", true, false] spawn BIS_fnc_MP;

[[_iedPosition] , "IED_SMOKE_SMALL", true, false] spawn BIS_fnc_MP;

If you want the rock effects,

[[_iedPosition] , "IED_ROCKS", true, false] spawn BIS_fnc_MP;

For obvious reasons, the particles are not transferred across the network and are local to each client.

init.sqf

waitUntil { isServer || !isNull player };

<snip>

[] spawn {call compile preprocessFileLineNumbers "EPD\Ied_Init.sqf";}; //It is possible that this line is never being reached with all your if statements and waits. Try moving this line to the top of the init.sqf file. It runs in a separate thread, so it will not block the rest of the init.sqf code anyways.

I am not sure how the script handles item names that don't exist (You have a lot of random spaces in the items below)

Ied_Settings.sqf

<snip>

Why do you have spaces in "Land_Ric eBox_F" and "Land_VitaminBottle _F"?

iedSecondaryItems = ["Land_CanisterOil_F","Land_FMradio_F","Land_Cantee n_F","Land_CerealsBox_F","Land_BottlePlastic_V1_F" ,"Land_HandyCam_F","Land_PowderedMilk_F","Land_Ric eBox_F","Land_TacticalBacon_F","Land_VitaminBottle _F","Land_BottlePlastic_V2_F"];

Why do you have spaces in "Land_Bucket_ F"?

iedSmallItems = ["RoadCone_F","Land_Pallets_F","Land_WheelCart_F"," Land_Tyre_F","Land_ButaneCanister_F","Land_Bucket_ F","Land_GasCanister_F","Land_Pillow_F"];

Why do you have spaces in "La nd_MetalBarrel_F" and "Land_ Sacks_heap_F"?

iedMediumItems = ["Land_Portable_generator_F","Land_WoodenBox_F","La nd_MetalBarrel_F","Land_BarrelTrash_grey_F","Land_ Sacks_heap_F","Land_WoodenLog_F","Land_WoodPile_F"];

Why do you have spaces in "Land_Bricks _V4_F" and "Land_Wreck _Car_F" and "L and_Wreck_Offroad_F"?

iedLargeItems = ["Land_Bricks_V2_F","Land_Bricks_V3_F","Land_Bricks _V4_F","Land_GarbageBags_F","Land_GarbagePallet_F" ,"Land_GarbageWashingMachine_F","Land_JunkPile_F", "Land_Tyres_F","Land_Wreck_Skodovka_F","Land_Wreck _Car_F","Land_Wreck_Car3_F","Land_Wreck_Car2_F","L and_Wreck_Offroad_F","Land_Wreck_Offroad2_F"];

<snip>

iedInitialArray = [

["AllCities","West"],

["AllVillages","West"],

/*["AltisRandom1",6,"West"], //You should remove these commented lines if you aren't using them.

["AltisRandom2",6,"West"], //..

["AltisRandom3",6,"West"], //..

["AltisRandom4",6,"West"], //..

["AltisRandom5",6,"West"], //..

["AltisRandom6",6,"West"], //..

["AltisRandom7",6,"West"], //..

["AltisRandom8",6,"West"], //..

["AltisRandom9",6,"West"], //..

["AltisRandom10",6,"West"], //..

["AltisRandom11",6,"West"], //..

["AltisRandom12",6,"West"], //..

["AltisRandom13",6,"West"], //..

["AltisRandom14",6,"West"], //..

["AltisRandom15",6,"West"], //..

["AltisRandom16",6,"West"],*/ //..

//["Gravia", 20, [0, 30, 0, 0], "West" ], //..

//["Lakka", 2, 8, ["West","East"] ], //..

//["OreoKastro", "West"], //..

//["Athira", 2, "West" ], //..

["IEDSINGLE1", ["West","East"]], //Do you have a marker on the map called "IEDSINGLE1"? If not, you should remove this line.

["IEDSINGLE2", 50 ,"West"], //Do you have a marker on the map called "IEDSINGLE2"? IIf not, you should remove this line.

["IEDSINGLE3", [0,0,0,100], "West"] //Do you have a marker on the map called "IEDSINGLE3"? If not, you should remove this line. Make sure the last line does not have a comma

];

//Place the mapLocations, predefinedLocations, and markerNames of places you don't want any IEDs spawning

iedSafeZones = ["SafeZone"]; //Do you have a marker on the map called "SafeZone"? If not, you should make this iedSafeZones = [];

Share this post


Link to post
Share on other sites

brians200 Thank you very much for your help! The problem was resolved by - " [] spawn {call compile preprocessFileLineNumbers "EPD\Ied_Init.sqf";}; //It is possible that this line is never being reached with all your if statements and waits. Try moving this line to the top of the init.sqf file. It runs in a separate thread, so it will not block the rest of the init.sqf code anyways. " :yay:

Share this post


Link to post
Share on other sites
Sure. Are you talking about just the smoke and rock particle effects or the actual explosions?

You will need to have this file compiled. https://github.com/Brians200/EPD-IED/blob/master/EPD/IED/ExplosionEffects.sqf

Then you can call the various ones, changing _iedPosition to the location you care about.

[[_iedPosition] , "IED_SMOKE_LARGE", true, false] spawn BIS_fnc_MP;

[[_iedPosition] , "IED_SMOKE_MEDIUM", true, false] spawn BIS_fnc_MP;

[[_iedPosition] , "IED_SMOKE_SMALL", true, false] spawn BIS_fnc_MP;

If you want the rock effects,

[[_iedPosition] , "IED_ROCKS", true, false] spawn BIS_fnc_MP;

For obvious reasons, the particles are not transferred across the network and are local to each client.

Yup, that is what I was inquiring about. Thank you so much!

Just for clarity, I would call this script with something like:

_boom = [[_iedPosition] , "IED_SMOKE_SMALL", true, false] execVM "ExplosionEffects.sqf" spawn BIS_fnc_MP;

Is my order correct?

OK I can see things are wrong above. What's the proper way to call the script with only using ExplosionEffects.sqf? Assuming I just want the smoke / rocks and don't have the rest of your script package included.

Edited by AccuracyThruVolume

Share this post


Link to post
Share on other sites

You will need to compile the file first. Put this in your init.sqf. Replace the location with where you are saving the file.

call compile preprocessFileLineNumbers "EPD\IED\ExplosionEffects.sqf";

Then you can call it like this.

[[_iedPosition] , "IED_SMOKE_SMALL", true, false] spawn BIS_fnc_MP;

execVM won't work because it is a not a script file, it is a function file. IE, there is no code for it to run, just a bunch of functions that can be called.

Share this post


Link to post
Share on other sites
You will need to compile the file first. Put this in your init.sqf. Replace the location with where you are saving the file.

call compile preprocessFileLineNumbers "EPD\IED\ExplosionEffects.sqf";

Then you can call it like this.

[[_iedPosition] , "IED_SMOKE_SMALL", true, false] spawn BIS_fnc_MP;

execVM won't work because it is a not a script file, it is a function file. IE, there is no code for it to run, just a bunch of functions that can be called.

Thank you for taking the time to explain this. It makes sense to me now. Tested it out as you instructed and it works. Much appreciation for your replies sir!

--JS

Share this post


Link to post
Share on other sites

im trying to sync this with I&A to know avail has anyone had anyluck?

Share this post


Link to post
Share on other sites

I'm not sure if this has been answered yet, but I guess it has, but does the markers on the map of the placed out IED's show up in multiplayer? Or is there any way to turn that off?

Share this post


Link to post
Share on other sites

They're hidden in the config - if you set it that way :-)

Share this post


Link to post
Share on other sites
They're hidden in the config - if you set it that way :-)

I am somewhat new to scripting and stuff, I know some of the basics, but can you help me out where to find that? :rolleyes:

EDIT: I actually happened to find it myself, so no help needed... Yet.. c;

Edited by STiNkYh

Share this post


Link to post
Share on other sites
im trying to sync this with I&A to know avail has anyone had anyluck?

I am assuming you mean invade and annex? If you look in \mission\main\region, you will see there are 5 regions which spawn the main AOs at various places.

In my IED tutorial video here, I talk about how to create and delete ieds during the mission.

Inside the region loop, after it has picked a new AO, you can spawn the ieds there. Then after that AO is finished, you can have it clean up and remove the ieds. You can even have it wait a few minutes before it removes them to make the extraction dangerous.

Share this post


Link to post
Share on other sites

Hey, I am getting this spam and not sure how to fix. are these no longer useable? Should I change them to something else?

21:01:52 Cannot create entity with abstract type IEDLandSmall_F (scope = private?)
21:01:52 Cannot create non-ai vehicle IEDLandSmall_F,
21:01:52 Unrecognized CfgVehicles simulation  in config.bin/CfgVehicles/IEDLandBig_F/
21:01:52 Cannot create entity with abstract type IEDLandBig_F (scope = private?)
21:01:52 Cannot create non-ai vehicle IEDLandBig_F,

Share this post


Link to post
Share on other sites

I am not sure what you mean by these are no longer usable, as they weren't apart of the script I released.

To answer your question, I am not sure that ever would have worked at all because it is considered a mine. This script usages createVehicle to spawn the objects and that has never played well with mines. You would need to use createMine if you want to use that object. Just a heads up though, you will have 2 disarm actions if you do this. The default arma 3 mine disarm and the one this script adds for ieds. Using the default disarm will not stop the script.

Share this post


Link to post
Share on other sites
I am not sure what you mean by these are no longer usable, as they weren't apart of the script I released.

To answer your question, I am not sure that ever would have worked at all because it is considered a mine. This script usages createVehicle to spawn the objects and that has never played well with mines. You would need to use createMine if you want to use that object. Just a heads up though, you will have 2 disarm actions if you do this. The default arma 3 mine disarm and the one this script adds for ieds. Using the default disarm will not stop the script.

I must have a bad version, probably using something from someone else at some time.... who knows. I will DL most recent version. Thanks.

Share this post


Link to post
Share on other sites

I started a brand new mission and put in this IED script. It seems to work but I get two annoying script errors.

k3tAeVA.jpg

TyRBjwp.jpg

Neither files have been modified in those areas. Any idea on the issue?

Thanks

Share this post


Link to post
Share on other sites

The sample mission doesn't have those errors. Can you post your init.sqf and Ied_Init.sqf and Ied_Settings.sqf?

Edited by brians200

Share this post


Link to post
Share on other sites

I can't seem to get this script to work on All in Arma Takistan, any ideas why? I've seen this script before and I really like it, and i copied the Init.sqf and Description.ext configs exactly into my mission (minus the authorname and multiplayer variable configs) so I haven't an idea why this isn't working.

never mind. After 6 hours of working and finally deciding to make a post, the issue resolved itself AFTER I made a post about it.

Edited by Tablesalt

Share this post


Link to post
Share on other sites

Hi. Nice ied system.

Spaming server RPT by :

015/06/20, 23:27:37 Error in expression <ED_ARRAY; 

_iedPos = getpos (_iedArray select 0);

_minDistance = 10000;
_minHe>
2015/06/20, 23:27:37   Error position: <select 0);

_minDistance = 10000;
_minHe>
2015/06/20, 23:27:37   Error select: Type Object, expected Array,String,Config entry
2015/06/20, 23:27:37 File mpmissions\__cur_mp.Takistan\EPD\IED\TriggerFunctions.sqf, line 48
2015/06/20, 23:27:37 Error in expression <ED_ARRAY; 

_iedPos = getpos (_iedArray select 0);

_minDistance = 10000;
_minHe>
2015/06/20, 23:27:37   Error position: <select 0);

_minDistance = 10000;
_minHe>
2015/06/20, 23:27:37   Error Generic error in expression
2015/06/20, 23:27:37 File mpmissions\__cur_mp.Takistan\EPD\IED\TriggerFunctions.sqf, line 48

Is there any chance to fix it?

Share this post


Link to post
Share on other sites

The sample mission doesn't have those errors. Can you post your init.sqf and Ied_Init.sqf and Ied_Settings.sqf?

Share this post


Link to post
Share on other sites

lovely spam. any ideas?

22:48:45 Error in expression <");
if(_type in _placesToKeep) then
{	
[iedAllMapLocations, _name , [_name, _pos>
22:48:45   Error position: <iedAllMapLocations, _name , [_name, _pos>
22:48:45   Error Undefined variable in expression: iedallmaplocations
22:48:45 File C:\Users\Andrews\Documents\Arma 3\missions\Invade_Annex_PUBLICv2.Altis\EPD\IED\CreationAuxiliaryFunctions.sqf, line 24
22:48:45 Error in expression <c_set;
};
if(_type in _locals) then
{	
[iedLocalMapLocations, _name , [_name, _p>
22:48:45   Error position: <iedLocalMapLocations, _name , [_name, _p>
22:48:45   Error Undefined variable in expression: iedlocalmaplocations
22:48:45 File C:\Users\Andrews\Documents\Arma 3\missions\Invade_Annex_PUBLICv2.Altis\EPD\IED\CreationAuxiliaryFunctions.sqf, line 36
22:48:45 Error in expression <in select 1;
} else {

_dictLocation = [iedAllMapLocations,  toUpper(_origin)] c>
22:48:45   Error position: <iedAllMapLocations,  toUpper(_origin)] c>
22:48:45   Error Undefined variable in expression: iedallmaplocations
22:48:45 File C:\Users\Andrews\Documents\Arma 3\missions\Invade_Annex_PUBLICv2.Altis\EPD\IED\CreationAuxiliaryFunctions.sqf, line 160
22:48:46 Error in expression <h _keys;
};
case "ALLCITIES": {
_keys = iedCityMapLocations call Dictionary_fnc_>
22:48:46   Error position: <iedCityMapLocations call Dictionary_fnc_>
22:48:46   Error Undefined variable in expression: iedcitymaplocations
22:48:46 File C:\Users\Andrews\Documents\Arma 3\missions\Invade_Annex_PUBLICv2.Altis\EPD\Ied_Init.sqf, line 64
22:48:46 Error in expression <_keys;
};
case "ALLVILLAGES": {
_keys = iedVillageMapLocations call Dictionary_f>
22:48:46   Error position: <iedVillageMapLocations call Dictionary_f>
22:48:46   Error Undefined variable in expression: iedvillagemaplocations
22:48:46 File C:\Users\Andrews\Documents\Arma 3\missions\Invade_Annex_PUBLICv2.Altis\EPD\Ied_Init.sqf, line 72
22:48:46 Error in expression <in select 1;
} else {

_dictLocation = [iedAllMapLocations,  toUpper(_origin)] c>
22:48:46   Error position: <iedAllMapLocations,  toUpper(_origin)] c>
22:48:46   Error Undefined variable in expression: iedallmaplocations
22:48:46 File C:\Users\Andrews\Documents\Arma 3\missions\Invade_Annex_PUBLICv2.Altis\EPD\IED\CreationAuxiliaryFunctions.sqf, line 160
22:48:46 Error in expression <Name = _this;
_sectionDictionary = call Dictionary_fnc_new;
[iedDictionary, _sec>
22:48:46   Error position: <Dictionary_fnc_new;
[iedDictionary, _sec>
22:48:46   Error Undefined variable in expression: dictionary_fnc_new
22:48:46 File C:\Users\Andrews\Documents\Arma 3\missions\Invade_Annex_PUBLICv2.Altis\EPD\IED\DictionaryFunctions.sqf, line 90
22:48:47 Error in expression <count _this == 0) then {
_sectionKeys = iedDictionary call Dictionary_fnc_keys;
>
22:48:47   Error position: <iedDictionary call Dictionary_fnc_keys;
>
22:48:47   Error Undefined variable in expression: ieddictionary
22:48:47 File C:\Users\Andrews\Documents\Arma 3\missions\Invade_Annex_PUBLICv2.Altis\EPD\IED\DictionaryFunctions.sqf, line 162

Share this post


Link to post
Share on other sites

The sample mission doesn't have those errors. Can you post your init.sqf and Ied_Init.sqf and Ied_Settings.sqf?

Share this post


Link to post
Share on other sites
The sample mission doesn't have those errors. Can you post your init.sqf and Ied_Init.sqf and Ied_Settings.sqf?

I have the code popping off an in game trigger to ease start up on server. So at approx 90 sec in the code runs.

below is Ied_init.sqf

/* Written by Brian Sweeney - [EPD] Brian*/

if(isserver) then {
iedsAdded = false;
publicVariable "iedsAdded";

iedDictionary = call Dictionary_fnc_new;
publicVariable "iedDictionary";

lastIedExplosion = [0,0,0];
publicVariable "lastIedExplosion";
};

ehExplosiveSuperClasses = ["RocketCore", "MissileCore", "SubmunitionCore", "GrenadeCore", "ShellCore"];
publicVariable "ehExplosiveSuperClasses";

explosiveSuperClasses = ["TimeBombCore","BombCore", "Grenade"];
publicVariable "explosiveSuperClasses";

projectilesToIgnore = ["SmokeShell", "FlareCore", "IRStrobeBase", "GrenadeHand_stone", "Smoke_120mm_AMOS_White", "TMR_R_DG32V_F"];
publicVariable "projectilesToIgnore";

call compile preprocessFileLineNumbers "EPD\Ied_Settings.sqf";
call compile preprocessFileLineNumbers "EPD\IED\ExplosionFunctions.sqf";
call compile preprocessFileLineNumbers "EPD\IED\CreationFunctions.sqf";
call compile preprocessFileLineNumbers "EPD\IED\ExplosionEffects.sqf";
call compile preprocessFileLineNumbers "EPD\IED\CreationAuxiliaryFunctions.sqf";
call compile preprocessFileLineNumbers "EPD\IED\ExplosivesHandler.sqf";
call compile preprocessFileLineNumbers "EPD\IED\DisarmFunctions.sqf";
call compile preprocessFileLineNumbers "EPD\IED\DictionaryFunctions.sqf";
call compile preprocessFileLineNumbers "EPD\IED\TriggerFunctions.sqf";


iedSecondaryItemsCount = count iedSecondaryItems;
iedSmallItemsCount = count iedSmallItems;
iedMediumItemsCount = count iedMediumItems;
iedLargeItemsCount = count iedLargeItems;

if(isserver) then {

call GET_PLACES_OF_INTEREST;

iedSafeRoads = [];
{
	_locationAndSize = (_x) call GET_CENTER_LOCATION_AND_SIZE;
	_roads = ((_locationAndSize select 0) nearRoads (_locationAndSize select 1));
	iedSafeRoads = (iedSafeRoads - _roads) + _roads; //removes duplicates first
} foreach iedSafeZones;

_handles = [];
_nextHandleSpot = 0;

{
	switch(toUpper(_x select 0)) do {
		case "ALL": {
				_keys = iedAllMapLocations call Dictionary_fnc_keys;
				_side = _x select 1;
				{
					_handles set [_nextHandleSpot, [[_x,_side]] spawn CREATE_IED_SECTION];
					_nextHandleSpot = _nextHandleSpot + 1;
				} foreach _keys;
			};
		case "ALLCITIES": {
				_keys = iedCityMapLocations call Dictionary_fnc_keys;
				_side = _x select 1;
				{
					_handles set [_nextHandleSpot, [[_x,_side]] spawn CREATE_IED_SECTION];
					_nextHandleSpot = _nextHandleSpot + 1;
				} foreach _keys;
			};
		case "ALLVILLAGES": {
				_keys = iedVillageMapLocations call Dictionary_fnc_keys;
				_side = _x select 1;
				{
					_handles set [_nextHandleSpot, [[_x,_side]] spawn CREATE_IED_SECTION];
					_nextHandleSpot = _nextHandleSpot + 1;
				} foreach _keys;
			};
		case "ALLLOCALS": {
				_keys = iedLocalMapLocations call Dictionary_fnc_keys;
				_side = _x select 1;
				{
					_handles set [_nextHandleSpot, [[_x,_side]] spawn CREATE_IED_SECTION];
					_nextHandleSpot = _nextHandleSpot + 1;
				} foreach _keys;
			};
		default	{
			_handles set [_nextHandleSpot, [_x] spawn CREATE_IED_SECTION];
			_nextHandleSpot = _nextHandleSpot + 1;
		};
	};

} foreach iedInitialArray;

waituntil{sleep .5; [_handles] call CHECK_ARRAY;};

//_script = iedArray call IED;
publicVariable "iedDictionary";

iedsAdded = true;
publicVariable "iedsAdded";


};

waituntil{sleep .5; (!isnull player and iedsAdded)};
player sidechat "Synching IEDs... You may experience lag for a few seconds";

[] call ADD_DISARM_AND_PROJECTILE_DETECTION;

below is Ied_setting.sqf


/***************SETTINGS***********************/
EPD_IED_debug = false;
hideIedSectionMarkers = true;  //sets the alpha to 0 after spawning IEDs at a section
hideSafeZoneMarkers = true;  //sets the alpha to 0 of a safezone

itemsRequiredToDisarm = ["ToolKit"];   //"MineDetector" or "ToolKit" for example
betterDisarmers = ["B_soldier_exp_F"]; // people who are better at disarming

baseDisarmChance = 50; //how well everybody can disarm
bonusDisarmChance = 35; //increase that the "betterDisarmers" get

secondaryChance = 50; //Chance that a secondary IED will spawn.

smallChance = 60; //Chance that a small IED will be chosen.
mediumChance = 40; //Chance that a medium IED will be chosen.
largeChance = 20; //Chance that a large IED will be chosen.

iedSecondaryItems = ["Land_CanisterOil_F","Land_FMradio_F","Land_Canteen_F","Land_CerealsBox_F","Land_BottlePlastic_V1_F","Land_HandyCam_F","Land_PowderedMilk_F","Land_RiceBox_F","Land_TacticalBacon_F","Land_VitaminBottle_F","Land_BottlePlastic_V2_F"];

iedSmallItems = ["RoadCone_F","Land_Pallets_F","Land_WheelCart_F","Land_Tyre_F","Land_ButaneCanister_F","Land_Bucket_F","Land_GasCanister_F","Land_Pillow_F"];

iedMediumItems = ["Land_Portable_generator_F","Land_WoodenBox_F","Land_MetalBarrel_F","Land_BarrelTrash_grey_F","Land_Sacks_heap_F","Land_WoodenLog_F","Land_WoodPile_F"];

iedLargeItems = ["Land_Bricks_V2_F","Land_Bricks_V3_F","Land_Bricks_V4_F","Land_GarbageBags_F","Land_GarbagePallet_F","Land_GarbageWashingMachine_F","Land_JunkPile_F","Land_Tyres_F","Land_Wreck_Skodovka_F","Land_Wreck_Car_F","Land_Wreck_Car3_F","Land_Wreck_Car2_F","Land_Wreck_Offroad_F","Land_Wreck_Offroad2_F"];

//If you want to use locations without making markers on the map, define them here. Altis has been provided as an example. ***THESE ARE NOT WHERE THE ACTUAL IEDS ARE SPAWNED***
//["Name",[LocationX,LocationY,LocationZ],size]
predefinedLocations = [["AltisRandom1",[4941.03,20430.1,0],2000],["AltisRandom2",[5796.45,16578.8,0],2000],["AltisRandom3",[5435.57,12633.9,0],2000],["AltisRandom4",[9579.01,20978.4,0],2000],["AltisRandom5",[10020.1,16859.6,0],2000],["AltisRandom6",[9779.5,12901.4,0],2000],["AltisRandom7",[13749.2,21392.9,0],2000],["AltisRandom8",[13048.1,18153.4,0],2000],["AltisRandom9",[17677.8,17309.3,0],2000],["AltisRandom10",[26097.5,22777.3,0],2000],["AltisRandom11",[23259.9,19904.4,0],2000],["AltisRandom12",[21356.9,17014.4,0],2000],["AltisRandom13",[19267,13716.4,0],2000],["AltisRandom14",[17033.2,10641.5,0],2000],["AltisRandom15",[20342.5,8704.69,0],2000],["AltisRandom16",[11108.5,8551.36,0],2000]];

iedPredefinedLocationsSize = count predefinedLocations;

/***************EXPERIMENTAL***********************/
// This is still being worked on and may contain bugs, please report them on the forums.
allowExplosiveToTriggerIEDs = true; 

/***************END EXPERIMENTAL*******************/


//These are the actual IEDs that will spawn. Add them using one of the following formats.
//mapLocations must have their type defined as one of "NameCityCapital","NameCity","NameVillage", "NameLocal"
//["All", side]
//["AllCities", side]
//["AllVillages", side]
//["AllLocals", side]
//["mapLocation", side]
//["mapLocation", amountToPlace, side];
//["mapLocation", iedsToPlace, fakesToPlace, side]
//["mapLocation", amountToPlace, [fakeChance, smallIedChance, mediumIedChance, largeIedChance], side]
//["predefinedLocation", side]
//["predefinedLocation", amountToPlace, side];
//["predefinedLocation", iedsToPlace, fakesToPlace, side]
//["predefinedLocation", amountToPlace, [fakeChance, smallIedChance, mediumIedChance, largeIedChance], side]
/*********Marker size > 1**********************/
//["marker", amountToPlace, [fakeChance, smallIedChance, mediumIedChance, largeIedChance], side]
//["marker", iedsToPlace, fakesToPlace, side]
//["marker", amountToPlace, side]
//["marker", side]
/*********Marker size = 1**********************/
//["marker", side]
//["marker", chanceToBeReal, side]
//["marker", [fakeChance, smallIedChance, mediumIedChance, largeIedChance] , side]

//The side can be a single side, or an array of sides
//Ex. "West"   or ["West,"East"]
//http://community.bistudio.com/wiki/side

iedInitialArray = [
["All", "west"],
//["AllCities","West"],
//["AllVillages","West"],
//["AllLocals", side],
/*["AltisRandom1",6,"West"],
["AltisRandom2",6,"West"],
["AltisRandom3",6,"West"],
["AltisRandom4",6,"West"],
["AltisRandom5",6,"West"],
["AltisRandom6",6,"West"],
["AltisRandom7",6,"West"],
["AltisRandom8",6,"West"],
["AltisRandom9",6,"West"],
["AltisRandom10",6,"West"],
["AltisRandom11",6,"West"],
["AltisRandom12",6,"West"],
["AltisRandom13",6,"West"],
["AltisRandom14",6,"West"],
["AltisRandom15",6,"West"],
["AltisRandom16",6,"West"],*/
//["Gravia", 20, [0, 30, 0, 0], "West" ],
//["Lakka", 2, 8,  ["West","East"] ],
//["OreoKastro", "West"],
//["Athira", 2, "West" ],
["IED", 125, [0, 50, 35, 15], "West"]
];

//Place the mapLocations, predefinedLocations, and markerNames of places you don't want any IEDs spawning
iedSafeZones = ["safe"];

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

×