Jump to content
brians200

Randomly generated roadside IEDs

Recommended Posts

August 2nd, 2018.

I'M BACK!!

 

 

Hello,

I am here to release a script I created that randomly generates IEDs. It is based off of the original work from Tankbuster and Mantls's update on that.

VIDEOS

Release v1.0 video -

Release v1.1 video -

Release v1.2 video -

Release v1.5 video -

Release v2.1 video -

Release v2.2 video -

v1.5 Tutorial video -

v2.3 Tutorial video -

IMAGES

http://i.imgur.com/tirV1Dk.jpg

http://i.imgur.com/ttIV6LX.jpg

http://i.imgur.com/nr2nbVM.jpg (556 kB)

Adding the script to your mission file is pretty simple, all you need to do is put the folder into your mission folder and add the following to your init.sqf

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

And copy the following into your description.ext

class CfgFunctions {
   #include "EPD\EPDcfgFunctions.hpp"
};
 

If you want to change where or how many IEDs are spawned when the mission starts, modify the variable called iedInitialArray in Ied_Settings.sqf.

There are several ways to define where you want the IEDs placed.

//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
 

The way it works is that it will use the markerName as the center and find all the roads within the radius of the marker (make sure you set it!), then it will randomly place real and fake IEDs somewhere within it.

There are several predefined locations for Altis in EPD\Ied_Settings.sqf that you can use if you don't feel like making your own markers. As of version 1.3, you can also use the names of locations in the game. If you want to share your predefined locations for other maps for others to use, feel free to, and I will post them here on the front post.

Here is a map of where each AltisRandom corresponds to.

If you do not specify how many to place, it will calculate an amount based on the size of the marker you gave it. If the marker has a size of 1, it will place exactly 1 IED in that exact spot, allowing you to pick where the IED is at, rather than a random road near the marker. There is an example of each type in EPD\Ied_Settings.sqf.

There are currently 4 types of IEDs

  • Secondary IED - Designed to kill first responders after the other IEDs goes off.
  • Infantry IED - Will kill the person who sets it off and injure most other squad members near him
  • Light Armor IED - Will destroy hunter type vehicles and usually disable marshall type vehicles.
  • Heavy Armor IED - Will destroy all vehicles and cause lots of mayhem

The type of IED also determines what size the object it is hiding in is. Heavy Armor IEDs will be hidden in things like trash piles and wrecked vehicles. Infantry IEDs will be hidden in things like buckets and tires.

IEDs are set off based on speed and proximity. If your horizontal velocity squared is higher than 2.8, and you are within 11 meters of it, you will set it off.

The IEDs can be disarmed if you have the appropriate items and are within 3 meters. If you fail while trying to disarm an IED, you will set it off.

Settings that can be changes as of version 2.0

  • EPD_IED_debug - If this is set to true, it will create map markers indicating where the IEDs and fakes are. It will create a message showing if a player is near an IED and give their distance and speed (see picture 2). It will also create a message if there are secondaries incoming. These will only show up to the person who is the server. This is mostly useful for testing while developing a map.
  • hideIedSectionMarkers - Set this to true if you want it to hide the marker you used to position the IED circle.
  • hideSafeZoneMarkers - Set this to true if you want it to hide the marker you used to position safezones.
  • itemsRequiredToDisarm - A player must have all of these items in order to have a disarm option.
  • betterDisarmers - Players of these classes have an increased chance of disarming IEDs
  • baseDisarmChance - Default chance of successfully disarming an IED
  • bonusDisarmChance - Players who are in the betterDisarmers array will have this amount added to their baseDisarmChance
  • secondaryChance - Chance that secondary explosions will spawn
  • smallChance - Chance that an IED will be small sized
  • mediumChance - Chance that an IED will be medium sized
  • largeChance - Chance that an IED will be large sized
  • iedSecondaryItems - Items secondary IEDs will hide in
  • iedSmallItems - Items Infantry IEDs will hide in
  • iedMediumItems - Items Light Armor IEDs will hide in
  • iedLargeItems - Items Heavy Armor IEDs will hide in
  • predefinedLocations - If you want to use the same locations over lots of missions without having to create markers over and over, define them here using the following format ["Name",[LocationX,LocationY,LocationZ],size]. Most of Altis has been provided as an example.
  • allowExplosiveToTriggerIEDs - If this is set to true explosions can set off the IEDs.
  • iedInitialArray - This is where you actually pick where the IEDs are spawned and how many when the mission starts. See the code above for the format
  • iedSafeZones - Place the mapLocations, predefinedLocations, and markerNames of places you don't want any random IEDs spawning

Explosives Requirements

  • Planted explosives and Bombs have a 100% chance of setting off IEDs if they are within 6 meters
  • Hand grenades have a 35% chance of setting off IEDs if they are within 6 meters
  • Rockets, Missiles, Shells, and Submunitions have a 100% chance of setting off IEDS if they are a direct hit
  • Launched grenades have a 50% chance of setting off IEDs if they are a direct hit
  • Explosive bullets have a 40% chance of setting off IEDs if they are a direct hit

Creating IEDs after the mission has started

Version 2.0 introduced the ability to create IEDs in the middle of a mission. Create an array similar to how you did for the iedInitialArray then call the CREATE_IED_SECTION function. For example,

[["OreoKastro", "West"]] call CREATE_IED_SECTION; 
 

This will return a randomly generated string of the new section created, hold onto this if you plan on doing any other functions with this section.

OR

["sectionName", ["OreoKastro", "West"]] call CREATE_IED_SECTION; 
 

This will return the sectionName string you passed in, hold onto this if you plan on doing any other functions with this section.

Checking the status of a section of IEDs

If you want to know how many IEDS have been blown up or disarmed in a section, use the GET_IED_SECTION_INFORMATION function.

"sectionName" call GET_IED_SECTION_INFORMATION;
//Returns [#iedsExploded, #iedsDisarmed]
 

If you want to know how many IEDs remain in a section, use the GET_REMAINING_IED_COUNT function.

"sectionName" call GET_REMAINING_IED_COUNT;
 

Removing sections of IEDs

If you want to remove a section of IEDs, use the REMOVE_IED_SECTION function.

 "sectionName" call REMOVE_IED_SECTION; 
 

Getting the last IED explosion location

If you would like to set up ambushes and the like, you can check the value of lastIedExplosion to get the location of the last IED to go off. Then have your units react appropriately.

Change Log:

Version 2.3

  • Triggers are now created and deleted as they are needed to reduce the strain on the server. Only IEDs with a soldier or vehicle within 250 meters of them will have a trigger actively checking for victims.
  • Fixed the "bucket bug". This should remove the lag the explosions were creating on servers with more than a few players. Special thanks to serjames
  • Smoke plumes now travel much faster.
  • Reduced the number of plumes for each IED.
    1. Small IED: 0-7
    2. Medium IED: 5-19
    3. Large IED: 15-34

    [*] Rocks are now flung a little bit farther so you can see them outside of the smoke.

    [*] Other small particle tweaks.

    [*] Fixed shrapnel logic so it produces different amounts based on the size of the IED. (The code was in the wrong order in the last release, causing it to produce the same amount for every IED)

 

Version 2.2

  • New smoke for small IEDs
  • New smoke for medium IEDs
  • New smoke for large IEDs
  • Small IEDs should more more deadly for infantry and less deadly for vehicles now. Started using anti personnel explosions
  • Cleaned up the description.ext entry.
  • Single IED constructor can now specify chances ["marker", [fakeChance, smallIedChance, mediumIedChance, largeIedChance] , side]
  • Reordering of explosion events to make it seem more natural.
  • Removed some potential race conditions.

Version 2.1

  • Fixed small bug with creating IEDs
  • Removed potential race case
  • Fixed incorrect copy paste error that appeared in version 2.0. Thanks Badger1815!
  • Reduced the number of particles in the IED smoke/rocks
  • Reduced to number of explosives used in each IED explosion
  • Changed the small IEDs. Their primary purpose is to kill infantry and damage hunter type vehicles.
  • Changed the medium IEDs. Their primary purpose is to take out infantry and hunter type vehicles. They can disable marshall type vehicles fairly easily.
  • Changed the large IEDs. These are bad for your health.
  • Changed secondary IEDs. Should not damage vehicles as much as before.

Version 2.0

  • Projectile detection now looks in the config to see if a bullet is explosive, rather than maintaining a list of explosive projectiles.
  • Merged files that do similar things, to help make it easier to maintain. Refactored a lot of code.
  • All IED information is now stored in a dictionary, rather than ied_#. This means less variables being created. See the iedModel.sqf file if you are interested on a certain aspect. Special thanks to Sanjo http://www.armaholic.com/page.php?id=19449
  • IEDs now produce a simple form of fragmentation/shrapnel to make them deadlier.
  • Debug markers are now deleted when an IED gets blown up or disarmed
  • Increased the disarm action to 2 animations.
  • Added functions to create and remove sections of IEDs during a mission. People that are smarter than me can come up with a caching scheme if they want to.
  • Added the ability to not remove safeZone markers.
  • Added the ability to choose the ied size percentages on a case by case basis
  • Modified the way to check on the status of IED sections
  • Added lastIedExplosion variable that holds the last location of an IED explosion for people that want to do something special when an IED goes off. Ambush?
  • Faster initializiation
  • Other small things that I can't remember
  • Uploaded my repo to github https://github.com/Brians200/EPD-IED

Version 1.6

  • Added a tinnitus and disorientation effect, based on how far away you are from the IED. Special Thanks to IndeedPete
  • Renamed the debug variable so it is unique to the script to prevent conflicts with other scripts.

Version 1.5

  • Multiple sides can now set off IEDs
  • In an attempt to overcome the inaccurate reporting of speed in the game, players crawling will not be able to set it off, even if the game inaccurately reports them going over the max speed.

Version 1.4

  • The script now generates strings of code that you can use to check if an IED from a section has exploded
  • The script now generates strings of code that you can use to check if ALL IEDs from a section have been disarmed

Version 1.3

  • You can now reference places in the game without making markers or having to define them. Hat tip to KevsnoTrev for pointing me to the config.
  • Added a safeZone section to the settings. Randomly created IEDs will not spawn in here, but specific ones will. Large safeZones and lots of safeZones will slow down the initialization.

Version 1.2

  • IEDs can now be set off by explosives
  • Secondaries now create a secondary IED, rather than just randomly making an explosion a short time later
  • Changed the predefined location setup to make it easier to edit
  • Added percentage sized options
  • Tweaked smoke particle effects
  • Fixed a bug with the speed check that allowed you to go as fast as you wanted backwards
  • Moved all the settings out of the init to make it easier to modify
  • Added a percentage chance to the single IED creation mode

Version 1.1

  • New smoke cloud particles that produce significantly less particles than the original.
  • New smoke plume effects
  • Your screen will now only shake if you are within 200 meters of the explosion
  • Fixed JIP issue where they could disarm already disarmed IEDs
  • Disarm option is now colored and has a higher priority in the list
  • Fixed a bug with the detection of the road direction
  • Added more variance with where IEDs spawn along the road
  • You can now specify how many real IEDs and fake IEDs you want in an area
  • Added a check to see if the marker exists before attempting to place IEDs there
  • Added option to hide the marker used to place the IEDs
  • Added option to set what items are required to disarm the IED
  • Added option to set the percentage regular players can disarm at
  • Added option to set what classes are better at disarming
  • Added option to set the percentage increase knowledgeable players get while disarming
  • Moved the items that IEDs hide in to Ied_Init.sqf for easier editing

Known Issues:

  • Sometimes the IEDs will spawn behind a wall.
  • Deactivating a charge near an IED will set off the IED.

Download Here v2.3

Armaholic Mirror

Older versions

  • Thanks 1

Share this post


Link to post
Share on other sites
Are the AI able to set off the IEDs without the player being present ?

Whichever side it is set to will set them off. For example, if it is set to "WEST" anybody (including AI) on the blufor team will set it off

Original? Yeah.

I don't know what you mean, but I took the broken code from here and ran with it. You will find very little of his code in there and I gave credit inside the files.

http://forums.bistudio.com/showthread.php?154744-Roadside-IED-Script

Edited by brians200

Share this post


Link to post
Share on other sites

Just tried it out, I'm liking it a lot. One question, does the script put anything out when you disarm all ied/ieds in the area that could be used in a trigger? That way a mission could be to clear all IEDs in a town or area then have the mission complete when you've done it.

Share this post


Link to post
Share on other sites
Just tried it out, I'm liking it a lot. One question, does the script put anything out when you disarm all ied/ieds in the area that could be used in a trigger? That way a mission could be to clear all IEDs in a town or area then have the mission complete when you've done it.

Hi, the script deletes the trigger when you disarm it or set it off. You could check to see if the set of IEDs are null using isNull.

All the triggers follow the naming convention of t_#. So the first one to spawn is t_0.

So if you spawn 3, have a check along the lines of isNull t_0 && isNull t_1 && isNull t_2

Share this post


Link to post
Share on other sites
Anyone give this a try with an ALiVE server yet?

I am not sure how ALiVE handles triggers, but I have a feeling simulated units would not set them off or be damaged by it. However, this is a guess, so feel free to try it out!

Share this post


Link to post
Share on other sites
Hi, the script deletes the trigger when you disarm it or set it off. You could check to see if the set of IEDs are null using isNull.

All the triggers follow the naming convention of t_#. So the first one to spawn is t_0.

So if you spawn 3, have a check along the lines of isNull t_0 && isNull t_1 && isNull t_2

Hey there! Question for that..is there any possibility that the trigger differntiates between a disarmed IED and a exploded IED? AND Is it possible to make the explosion a little bit smaller? I get massive frame problems when an IED sets off...

Share this post


Link to post
Share on other sites

Release frontpaged on the Armaholic homepage.

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

You are not registered on Armaholic, or at least not that we are aware of. In the future we offer the possibility to authors to maintain their own pages.

If you wish to be able to do this as well please register on Armaholic and let me know about it.

This is not mandatory at all! Only if you wish to control your own content you are welcome to join, otherwise we will continue to follow your work like we have always done ;)

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

how hard would this be to port to the Arma 3 Map Pack for maps like Takistan and Chernarus?

Share this post


Link to post
Share on other sites
Hey there! Question for that..is there any possibility that the trigger differntiates between a disarmed IED and a exploded IED? AND Is it possible to make the explosion a little bit smaller? I get massive frame problems when an IED sets off...

If the IED gets disarmed, the object the IED is "hidden" in will still be there. If it gets set off, it will be deleted. You can use the isNull check on that item as well. The items follow the naming convention of ied_#.

You are probably getting frame rate issues because of all the particles. I am not happy with the smoke cloud either and will work on making a new one in a couple of days.

I would try reducing the number of particles first, before reducing the size of the explosion.

Open up IedSmoke.sqf

Find these lines for _smoke1, _smoke2,_smoke3.

_smoke1 setDropInterval 0.001;

Doubling this number will spawn half as many particles, tripling this number will spawn 1/3 as many particles, etc.

If you are still having trouble, you can increase the time between explosions to give your computer a chance to catch up.

Open up Ied.sqf

Look for the function called INITIAL_EXPLOSION

Inside the for loop, you will see a

sleep .01;

Increase that number to .04 or .05.

And finally, if you are still having trouble, you can actually weaken the explosion by deleting some of the items in the arrays called _explosiveSequence.

Fantastic news!

how hard would this be to port to the Arma 3 Map Pack for maps like Takistan and Chernarus?

As long as they use the Arma 3 commands and return valid roads with nearRoads commands, I don't think there would be a problem. Just create a marker with a size and then point Ied_Init.sqf to it. I have not used the packs, so I cannot say for sure, but I will check when I am back on my computer tomorrow.

Share this post


Link to post
Share on other sites
how hard would this be to port to the Arma 3 Map Pack for maps like Takistan and Chernarus?

It works fine, I've already put it to use. As long as there is a road you're good to go.

Question, can you set the number of dummy ieds placed? Like have a bunch of crap littering the road but only one of them being an actual ied.

Share this post


Link to post
Share on other sites
It works fine, I've already put it to use. As long as there is a road you're good to go.

Question, can you set the number of dummy ieds placed? Like have a bunch of crap littering the road but only one of them being an actual ied.

At the moment, no. If you use the random generator, it spawns 1 fake and 1 real. If you use the specific location one, it only spawns a real one.

I will add that in the next version though.

Share this post


Link to post
Share on other sites
It works fine, I've already put it to use. As long as there is a road you're good to go.

Question, can you set the number of dummy ieds placed? Like have a bunch of crap littering the road but only one of them being an actual ied.

could you link me to your already made script for takistan and chernarus or just takistan?

Share this post


Link to post
Share on other sites

Oh. I haven't gone that far into it. I've just made my own makers and used those, haven't set up the automatic map-wide ones like his sample mission. Shouldn't be hard to do, though I'm at work right now and far from my Arma.

Share this post


Link to post
Share on other sites
Oh. I haven't gone that far into it. I've just made my own makers and used those, haven't set up the automatic map-wide ones like his sample mission. Shouldn't be hard to do, though I'm at work right now and far from my Arma.

Alright. thanks anyway though

Share this post


Link to post
Share on other sites

Your script is not working. Same for your sample mission. I end up running around all over and nothing happens. I am not getting any script errors.

Here is my init.sqf

[]execVM "EOS\OpenMe.sqf";

MAC_fnc_switchMove = {
   private["_object","_anim"];
   _object = _this select 0;
   _anim = _this select 1;

   _object switchMove _anim;

};
call compile preprocessFile "EPD\Ied_Init.sqf";

I am adding markers with the name random1....etc and setting the radius to 500 and or 1000 on some.

Am I missing something? I am following the directions as they are and nothing is going on.

Share this post


Link to post
Share on other sites
Your script is not working. Same for your sample mission. I end up running around all over and nothing happens. I am not getting any script errors.

Here is my init.sqf

[]execVM "EOS\OpenMe.sqf";

MAC_fnc_switchMove = {
   private["_object","_anim"];
   _object = _this select 0;
   _anim = _this select 1;

   _object switchMove _anim;

};
call compile preprocessFile "EPD\Ied_Init.sqf";

I am adding markers with the name random1....etc and setting the radius to 500 and or 1000 on some.

Am I missing something? I am following the directions as they are and nothing is going on.

Hello,

In the file called Ied.sqf, near the top, there is a variable called "debug". Set that to true. This will show where all the IEDs are on the map if you are on single player or the host of the server. I can't offer more help without seeing your mission. You can send me a pm if you don't want to share it publicly.

You should see markers like this HNDtiK8.jpg

Edited by brians200

Share this post


Link to post
Share on other sites
Still one problem. The IED isn't detected by the mine detector..tried it several times :/

If the item is an ied AND you have a mine detector, you will get a disarm option. There is no magic red triangle.

Share this post


Link to post
Share on other sites
If the item is an ied AND you have a mine detector, you will get a disarm option. There is no magic red triangle.

Then it works perfectly! :) Really looking forward to use this script and blow my squad into heaven :D

Share this post


Link to post
Share on other sites

Glad I could help. Here is a sneak peak at the next release. I have created new particles for the explosions.

9Q6eCyG.jpg

TcHQ5Us.jpg

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

×