Jump to content
phronk

[Release] Simple IED Script

Recommended Posts

T5Ajvhk.png

 

DESCRIPTION:

'Simple IED Script' will spawn IEDs on / alongside random road segments within predetermined IED area markers setup by the mission designer.  The position, direction, appearance, and blast magnitude of the IEDs are all random.  The script also spawns random trash along the roads.  The script is tiny, optimized, and works in SP, MP, Dedi. Does not require any addons and is compatible with any map that has roads.

 

 

VIDEO:

 

 

FEATURES:

  • Tiny filesize! 2KB
  • Fast performance
  • Compatible with SP, MP, and Dedicated
  • Works on any map with roads
  • Doesn't require any mods or additional scripts
  • Easy to implement!
  • Randomized Results:
    -IED type spawned
    -IED blast magnitude is random (damage / radius)
    -IED position & direction
    -Chance for trash to spawn with IED
    -Trash appearance variety
     
  • IEDs are proximity based:
    -IED will detonate if player is within 10 meters of it and is moving too quickly
     
  • IEDs can be disarmed:
    -Explosive Specialist with a ToolKit can slowly crawl up to an IED to safely disarm it
    -IEDs can be detected with a Mine Detector

 

 

TO DO LIST:

  • Add blacklist marker support
  • Add option for script to auto-detect areas to spawn IEDs in

 

KNOWN BUGS:

Completely bug free!

 

INSTALLATION:

  1. Move the "ied.sqf" from the downloaded file, to your mission folder.
  2. Copy & Paste below line into your mission's "init.sqf":
execVM"ied.sqf";

Create rectangular area markers in your mission and name them.
3a. Make sure the A and B values of that marker is the same! Example: 500x500 In the "ied.sqf", add the names of your IED area markers to the array in line 1.  For example:

iedMkr=["myMkr0","myMkr1","myMkr2"];

In the "ied.sqf", you can change the number of IEDs to spawn per marker, on line 5.  For example:

iedNum=8; //Will spawn 8 IEDs per IED marker

Optional Debug Toggle:

  1. If you want to see the IED markers in-game, set Dbug to true.  For example:
Dbug=true;

 

Done!


DOWNLOAD LINK (Google Drive)

DOWNLOAD LINK (Armaholic)

v0.1 (Jul 1, 2017)

Change-Log:

 

 


(01.JUL.2017) - v0.2

 

  • Added: Debug setting
  • Added: Setting to disable damage to IED
  • Added: Comments to each setting
  • Added: Array variable containing IED ammo classes
  • Added: Crater decal
     
  • Tweaked: IED markers are visible if Dbug = true
  • Tweaked: IED is deleted only if it is invulnerable via script settings
     
  • Optimized: Replaced set command with pushBack
  • Optimized: Simplified deletion of IED objects upon activation
  • Optimized: Simulation of junk is disabled globally, instead of only on server
     
  • Replaced: remoteExec, with a simple trigger
  • Removed: _iedDel variable


(16.FEB.2017) - v0.1

  • Initial release
  • Like 10
  • Thanks 2

Share this post


Link to post
Share on other sites

This is really interesting.

Something you could do is sink the IEDS lower into the ground.

Otherwise, they are sort of obvious on the roadside.

I've seen some military clips of Pakistanis that actually bury the damn thing all the way under the ground,

and the tripwire or trigger is barely visible up on the top.

Just a suggestion, otherwise this is cool.

Edit:

Why not just use a Boolean for debug? markers on and off concept.

 

 

Share this post


Link to post
Share on other sites

nice job, will probably give it a try the next days. Can anyone confirm ACE Support(minedetectors?)

Share this post


Link to post
Share on other sites

The IED detection/disarming is not scripted; the IEDs are actually items already in the game and are classified as "mines" which, by default in ArmA 3, can be detected with a mine detector and disarmed by an explosive specialist with a toolkit.  It's a basic ArmA 3 functionality and, if ACE takes vanilla ArmA 3 mines and remote explosives into account, the IEDs spawned by this script SHOULD work as intended.  Hope that makes sense.

Share this post


Link to post
Share on other sites

Great work ArmaPhronk and thanks for sharing it!  I've tested this on a dedicated which runs ACE and the script itself works.  I haven't used mine detectors, but if someone can confirm that would be great.  I would test it now, but it's spend time with the wife now.  :)  Also, I haven't tested it with any JIP players. Thanks again ArmaPhronk for sharing!

Share this post


Link to post
Share on other sites
20 hours ago, kman_(kya) said:

Great work ArmaPhronk and thanks for sharing it!  I've tested this on a dedicated which runs ACE and the script itself works.  I haven't used mine detectors, but if someone can confirm that would be great.  I would test it now, but it's spend time with the wife now.  :)  Also, I haven't tested it with any JIP players. Thanks again ArmaPhronk for sharing!

I think there is a specific type of mine the ACE detectors have to have, I think it's just the fact that they're mines.

Share this post


Link to post
Share on other sites

i like the idea of lowering the height on the IEDs, another thought is to have an option of making a random civ be a IED too. I may try to include a civ in the list and see what happens.

Share this post


Link to post
Share on other sites
Just now, jandrews1 said:

i like the idea of lowering the height on the IEDs, another thought is to have an option of making a random civ be a IED too. I may try to include a civ in the list and see what happens.

 

If you add a civ and it works, let us know!  That is a great idea.

Share this post


Link to post
Share on other sites

Nice job mate.   Pretty soon dogs will be detecting those also.  ;)

  • Like 4

Share this post


Link to post
Share on other sites

I use this for my Invade & Annex mission it work perfect make more fun in AO haha. Thank you.

  • Like 1

Share this post


Link to post
Share on other sites

Hey phronk, love the script!  Do you know if the 64-bit ArmA going to break it? 

Share this post


Link to post
Share on other sites

I use it in my Takistan Insurgency mission and I haven't had any noticeable conflicts yet.  As far as I know, it's pretty bug-free.

Share this post


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

I use it in my Takistan Insurgency mission and I haven't had any noticeable conflicts yet.  As far as I know, it's pretty bug-free.

 

Cool, thanks!

Share this post


Link to post
Share on other sites

hey guys, nice mod!

but: ive tried it local, it worked. but on my dedi-server the script will not spawn any IED´s.. the areas are there, but no IED´s?!

 

heres my ied.sqf, did i make something wrong!?

 

iedMkr=["iedMkr0","iedMkr1","iedMkr2","iedMkr3"];
iedBlast=["Bo_Mk82","Rocket_03_HE_F","M_Mo_82mm_AT_LG","Bo_GBU12_LGB","Bo_GBU12_LGB_MI10","HelicopterExploSmall"];
iedList=["IEDLandBig_F","IEDLandSmall_F","IEDUrbanBig_F","IEDUrbanSmall_F"];
iedJunk=["Land_Garbage_square3_F","Land_Garbage_square5_F","Land_Garbage_line_F"];
iedNum=5;
//{_x setMarkerAlpha 0;}forEach iedMkr;
if(!isServer)exitWith{};

iedAct={_iedObj=_this;
waitUntil{sleep 1;player distance _iedObj<=10&&speed player>4};
if(mineActive _iedObj)then{
_iedBlast=selectRandom iedBlast;
createVehicle[_iedBlast,(getPosATL _iedObj),[],0,""];
_iedDel=nearestObjects[getPosATL _iedObj,["IEDLandBig_F","IEDLandSmall_F","IEDUrbanBig_F","IEDUrbanSmall_F","Land_Garbage_square3_F","Land_Garbage_square5_F","Land_Garbage_line_F"],4];{deleteVehicle _x}forEach _iedDel;};};

{private["_ieds"];_ieds=[];_iedArea=getMarkerSize _x select 0;_iedRoad=(getMarkerPos _x)nearRoads _iedArea;
	for "_i" from 1 to iedNum do{
	if(count _ieds==iedNum*4)exitWith{};
	_iedR=selectRandom _iedRoad;
	_ied=selectRandom iedList;_junk=selectRandom iedJunk;
	_ied=createMine[_ied,getPosATL _iedR,[],8];_ied setPosATL(getPosATL _ied select 2+1);_ied setDir(random 359);
	if(round(random 2)==1)then{_iedJunk=createVehicle[_junk,getPosATL _ied,[],0,""];_iedJunk setPosATL(getPosATL _iedJunk select 2+1);_iedJunk enableSimulation false;};
	_jnkR=selectRandom _iedRoad;_junk=createVehicle[_junk,getPosATL _jnkR,[],8,""];_junk setPosATL(getPosATL _junk select 2+1);
	_junk enableSimulation false;[_ied,iedAct]remoteExec["spawn",0,true];
	_ieds set[count _ieds,_ied];
		iedMkrs=[];
		_mkrID=format["m %1",getPosATL _ied];
		_mkr=createMarker[_mkrID,getPosATL _ied];
		_mkr setMarkerShape "ICON";_mkr setMarkerType "mil_dot";_mkr setMarkerBrush "Solid";_mkr setMarkerAlpha 1;_mkr setMarkerColor "ColorEast";
		iedMkrs set[count iedMkrs,_mkr];
	};
}forEach iedMkr;
sleep 5;
{civilian revealMine _x;east revealMine _x;}forEach allMines;

 

Share this post


Link to post
Share on other sites

Did you name the markers "iedMkr0" up to "iedMkr3?  Also, some garbage collection scripts which delete remote explosives may delete the IEDs.  No idea how it works in SP and not in MP.  Works fine for me.

Share this post


Link to post
Share on other sites

AggbzaO.jpgQQjV2tx.jpg953KMyG.jpg

Is there any way to fix flying IEDs?? I really don't know why they spawn 1m above ground (CUPTerrains-Full)

Share this post


Link to post
Share on other sites

I've never seen that before, but it probably has to do with this:

_ied setPosATL(getPosATL _ied select 2+1);

 

The + 1 at the end adjusts the elevation.  What's weird is I've never seen this in my tests, but I'll investigate more.  To fix it, try to change the + 1 to a 0.

Share this post


Link to post
Share on other sites

Thx phronk

 

works a treat on my  dedicated a3 epoch server, just had to add this within the class Functions of the CfgRemoteExec.hpp in the mission file.

to make things go BOOOOOOOOOOOOOOOOMMMMMMMM.

		class iedAct					//	IED'S Thx phronk
		{
			allowedTargets = 2;
		};

cheers

natoed

  • Like 1

Share this post


Link to post
Share on other sites

Works for me just fine.  Look at natoed's post, you're most likely using a mission or mod which prohibits the undefined use of remoteExec.  Some mods that do that are Exile, Epoch, Life, etc.

Share this post


Link to post
Share on other sites

DOWNLOAD LINK (Google Drive)

DOWNLOAD LINK (Armaholic)

Version: v0.2

Size: 3kb

 

ADDITIONS:

  • Added: Debug setting
  • Added: Setting to disable damage to IED
  • Added: Comments to each setting
  • Added: Array variable containing IED ammo classes
  • Added: Crater decal

ADJUSTMENTS:

  • Tweaked: IED markers are visible if Dbug = true
  • Tweaked: IED is deleted only if it is invulnerable via script settings

OPTIMIZATIONS:

  • Optimized: Replaced set command with pushBack
  • Optimized: Simplified deletion of IED objects upon activation
  • Optimized: Simulation of junk is disabled globally, instead of only on server

REMOVALS:

  • Replaced: remoteExec, with a simple trigger
  • Removed: _iedDel variable

_________________________________________________________________

Installation and setup is easier and more straight forward.  I removed the remoteExec reference to avoid conflicts with popular mods/missions which prohibit/restrict its use.

Enjoy!

  • Like 3

Share this post


Link to post
Share on other sites

I've implemented phronk's Simple IED script into a few missions of mine and it works great.  Thanks for updating it phronk!!

  • Like 1

Share this post


Link to post
Share on other sites

Hi @phronk

 

I see the potential for your script and was wondering if there is anything I can do about my situation.

 

I need 1 x IED in one specific (small) area. So I've placed 1 x marker named iedMkr0 and the first test successfully spawned an IED exactly where I wanted. However the second test spawned some inert rubbish, no doubt intended to demonstrate that not all rubbish is an IED! However is there something I can change in the script make the probability that an IED will spawn be 100%?

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

×