00dc15

New advanced IED script is out

54 posts in this topic

Well it's been a long time coming but my advanced IED script is ready, Ive packaged it with a small test mission ( in editor format, so you can see how it's done ).

Note: The test mission requires Operation Arrowhead & the script is designed for OA as well but could be changed to work with ARMA2, the buildings part of the script will only work with the OA buildings.

About the script

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

This script provides you with an easy way to have the AI place an IED & then semi intelligently find an observation location that they can see it from.

They will place the IED at there current location either at the start of the mission (if the random time put in by you is 0) or sometime up to the maximum random time you put in. If they have waypoints these will now be deleted.

Next they will run to a random position, the type of location depends on where they are & what options you set, they will 1st try buildings (only OA buildings & only the common town/village buildings), next they will try objects & finally random positions all within a pre-defined minimum & maximum range of the IED. If there are no buildings or you set a limit of 0 on buildings, they will search objects, again if there are no objects or you set the object limit to 0 then they will try random positions.

When they get to a building they will move to different building positions (not all of them) as defined by the script, they will also try different stances at each building position where appropriate (1st prone, then crouched & finally standing) if they spot the IED in a specific stance then they will remain in that stance. The building positions & stance types are all configured in the script, for example some buildings may have 10 building positions but the IED men will only try 6 of them, this is to speed up the time it takes for them to find a suitable position & also because some building positions are either too close to another one or don't provide enough of a view outside. Likewise there stances are limited by building position, for example If the IED man is inside by a window he will only stand or if he's on a roof without a wall he will try all 3 stances or if there is a wall he will just try crouched & standing. When trying object locations or random positions they will always try all 3 stances.

Once at a building position, object or random location a hidden dead body is placed by the IED, this body is then made visible for 5 seconds at every stance & then hidden before they move onto the next building or position, once they can see the IED the body is deleted. The body is the only way I could get them to detect the IED, in fact they don't detect the IED they detect the body, I tried objects both buried & on the surface but they can spot them through walls, the only things I found that work are men alive or dead & static weapons ( though they don't work as well as men do ), if anyone can come up with a better solution please do.

Once a position is found they stay there & observe the IED ( using binoculars ( if this option is selected )) until BLUFOR get in range of the IED, at this point if the IED trigger man has knowledge of the BLUFOR unit the IED will be detonated after a random time of up to 5 seconds.

Once the IED is detonated the IED triggerman is given a negative rating of 10000 meaning if he's civilian BLUFOR may now shoot him, also at this point his captive status is removed so if He's OPFOR, BLUFOR will now engage him. Also his never fire condition is now set to Hold fire, so if he's engaged he will shoot back. There is also an option you can set for him to run away, if set he will now sneak off to a randomly picked location within a certain minimum & maximum range, therefore giving you the option to chase him if you weren’t killed by the IED.

Finally some other quick notes, there are 4 BAF IED's he can either use 1 of the 4 types or you can set it to random. There is a limit you can put on how many objects or buildings he'll try. There are 2 types of movement you can select when he's looking for an observation position, the first he will run to different locations & the second teleports him to each position (this is the quickest way). There is an option for him to use binoculars when observing the IED waiting for BLUFOR, this makes him more identifiable as an IED triggerman ( he will use binoculars for a few seconds every 20 or so seconds ). In order for him to use all the stances when detecting the IED, I found it problematic if he didn't have a gun, so the script gives him a Makarov pistol & ammo but if you want him to be unarmed you can set it so when he's spotted the IED the pistol is removed.

I think that's about it, I'm no expert in scripting so the more experienced scripters may have a fit about the way I've coded it, but from my point of view it works. I will continue to improve the script & add further options, but if any one wants to re-write sections or adapt it to there requirements please feel free. Finally please feel free to post any comments or questions & I'll try to answer them, if you do change the script or have a better idea please post it in this topic.

About the included mission

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

The included mission ( well a few units thrown into the editor & some hints to tell you what to do) will show you some of the features of the IED script, due to the random operation of the script and the AI it will play differently each time to a degree, the first 3 IED’s will always be at the same position but the location the IED trigger men hide at will vary to a degree. The 2 IED’s in the town are deployed at a random time so the IED’s position will vary & determine where the trigger men may hide. Also due to the AI sometimes they will not notice the BLUFOR units approaching the IED & the way the triggers work, this leads to the IED not going off, to be honest I like this chance as it sort of simulates a failed detonation. In testing I’ve found this to not happen very frequently.

You may find at the start of the mission nothing happens for a few minutes, this is to be expected as I've stopped the vehicles moving until the 1st 3 IED men are ready, this is normaly under 5 minutes. If & When you play the mission, once you've been dropped off & follow the patrol squad, don't be too realistic in your combat, just leave your unit at there origanal settings (formation, combat mode etc.) & follow the squad infront of you, don't target anyone or worry about scanning the horizon, you will get a chance to do that later.

Finally, I never intended to upload this script, but because a few people wanted a more advanced script I've decided to, I have tested this version some 40 times & to me it seems to work well, but problems may come to light when more people use it, so think of it as testing it. I have never uploaded a file to the internet before so it could have gone wrong but this should be the link:

http://rapidshare.com/files/420037637/IED_Script_mission_and_documentation.rar.html

Warning read this: It has been brought to my attention (thanks to Gnarly Rider) that there are several errors in the Script documentation, these are as follows:

1) Put this in his Init Line: null= [this,10,5,Rnd,Sw,0,"bin","noGun","Run",I] execVM "IED_Man_v6.sqf";

The Rnd & Sw both need to be in quote marks ( "Rnd" "Sw" ).

The I shouldn't be there (don't put it in).

2) Where ever you see either Rnd , GrndS , GrndL , GarbS, GarbL, Sw or Mo put the names in Quote marks.

3) null= [this,5,2,GrndL,Mo,60,"bin","","run"] execVM "IED_Man_v6.sqf"

Again in this line the GrndL should be "GrndL" (in quote marks) & Mo should be "Mo" (in quote marks).

I would just like to add that this script would not have been possible without all the tutorials out there & the information provided on the forums, I would like to thank everbody who has submitted information & taken the time to write these great tutorials.

Regards

James

Edited by 00dc15
Errors in documentation document

Share this post


Link to post
Share on other sites

@ Kylania,

Thanks, it's been a nightmare but I think it's working well now, once again thanks for your help & for posting your scripts & little missions. Having not edited & scripted since the old Operation Flaspoint Days, things have changed a little & I've forgotten alot, but your scripts & missions coupled with some great tutorials around & this forum made it possible.

Regards

James

---------- Post added at 11:45 PM ---------- Previous post was at 11:40 PM ----------

@ Gnarly Rider,

You may be the first test subject, good luck & let me know how you get on.

Regards

James

Share this post


Link to post
Share on other sites

That was a really fun mission! Those IED men hide WELL! They got me at the last IED, but at least my guy didn't die.

Sent you a PM about your code too. :)

Share this post


Link to post
Share on other sites

Do you have to have the BAF upgrade / patch? Or will this work in A2/OA without the latest BAF??

Share this post


Link to post
Share on other sites
It should work without BAF, but the IED's will be smudgy. :)

Nope. Won't load without BAF it seems. Get an error message when I go to call it up within the editor...

Share this post


Link to post
Share on other sites

Odd. Can you make missions with BAF content normally in the editor? I pre-ordered it, so never have had a non-BAF client. :)

Share this post


Link to post
Share on other sites

James, could you PM me another link, the first download somehow got corrupted, and I cannot now redownload (only one DL for free user).

Share this post


Link to post
Share on other sites

@ Gnarly Rider,

I've sent you a PM, let me know if you didn't get it.

@ Meade95,

I've sent you a PM, let me know if you didn't get it.

Regards James

Share this post


Link to post
Share on other sites

Holey Cow Batman! Those are some serious notes you've included, and they are VERY informative and useful, as is the very effective and informative mission! Very nice work! ::459::icon_dj:

Will start tinkering myself, but loving your work!

Why has this not front-paged Armaholic yet???????:pistols::yay:

Share this post


Link to post
Share on other sites

@ Gnarly Rider,

Glad you like it, I've not looked into putting the file up with any of the sites yet, I thought for now I'll let people test it , see if they like it & that it works as expected. Also I plan to sort parts of it out a little better & add more function to it. Once I have a good enough version, I will look into hosting it with other sites.

Regards

James

Share this post


Link to post
Share on other sites

1/. Subtle but important typo. In the readme:

Place a unit (civilian or OPFOR).

Put this in his Init Line: null= [this,10,5,Rnd,Sw,0,"bin","noGun","Run",I] execVM "IED_Man_v6.sqf";

Needs ...[this,10,5,"Rnd",Sw,0..... otherwise get a CfgMagazines.any error, and no IED placed.

2/. Also, what is the 'I' for?:

..."noGun","Run",I]

3/. Also, if NoGun enabled, binocular option doesn't work ( I think its an ARMA engine limitation?)

Hilarious watching him run around trying to find a viable position!!

Edited by gnarly_rider

Share this post


Link to post
Share on other sites

@ Gnarly Rider,

Oh, sorry, thanks for pointing that out, that's what happens when you rush out documentation at past midnight & don't test what you've written, I'll post a revised version link ASAP.

I have no idea what the I is, another typing error I guess, don't put it in there.

So much for your statement: Those are some serious notes you've included, and they are VERY informative and useful.

Thanks again

Regards

James

Share this post


Link to post
Share on other sites

Tried this out in the middle of a village and he lays the IED but then just stands there, occasionally taking out his binoculars and then putting them away again....?

I used null= [this,5,2,"GrndL",Mo,0,"bin","","run"] execVM "IED_Man_v6.sqf" in his init line.

Any idea what I did wrong?

Share this post


Link to post
Share on other sites
Tried this out in the middle of a village and he lays the IED but then just stands there, occasionally taking out his binoculars and then putting them away again....?

I used null= [this,5,2,"GrndL",Mo,0,"bin","","run"] execVM "IED_Man_v6.sqf" in his init line.

Any idea what I did wrong?

Need quotations around the Mo as well, ie:

null= [this,5,2,"GrndL","Mo",0,"bin","","run"] execVM "IED_Man_v6.sqf"

However,

null= [this,5,2,"GrndL","Sw",0,"bin","","run"] execVM "IED_Man_v6.sqf"

will be quicker, but less entertaining (while observing in the editor)!

Share this post


Link to post
Share on other sites

Tried it just now, and it works flawlessly:D

Only (minor) thing is, he took a position that didn't really have line of sight to the IED. But that's no biggie since you would need to look for the IED itself and the spotter. Spotting either of them forces you to look for the other (spot the IED, go look for the spotter and vice versa).

Thx for this, 00dc15, real nice script. And thx gnarly rider for the help!

Share this post


Link to post
Share on other sites

@ Antigoon,

Glad you got it working, sorry about the error in my documentation, when you say he didn't have line of sight, how far out was he, I must have tested this 60 or so times in the early stages & I thought that alot but I had him as a Team switch option, so I was able to switch over & look through his eyes.

The only small problem I had was with trees and bushes he could see a little more through them than he should have been able to, apart from that he was spot on every time. Because he has to detect the body spawned by the IED he should have to have line of sight.

The only thing that will cock it all up is if you as a player were to reveal the body whilst it's there but even then you have to be part of the same faction as him, so if he's OPFOR you have to be OPFOR, the reason for this is by revealing the body you broadcast it to all units of your faction & at that point he knows everthing about the body, hence the IED, even if he's on the moon I think.

Regards

James

Share this post


Link to post
Share on other sites

Hi 00dc15,

As you said, when testing , I followed him around as a member of the same faction. That probably explains why he didn't have line of sight to the IED and still detonated it at the wright moment. I'll test again as a civvie, but , hey, I'm glad it works as it is now! Working on an ambush type mission atm, so your script definately comes in handy.

Thx again, 00dc15!

Share this post


Link to post
Share on other sites

Wish someone would try this without an AI placing it, although we know someone placed it often they could also be long gone, it's not very difficult to make a trigger so it really does not have to be in line of site and in missions which do not have civs running around it becomes an obvious indicator when you spot the civ that hid the IED. I've also been wondering if it's possible to actually burry them some and still have an effect since most are not so easy to spot.

Share this post


Link to post
Share on other sites

@ Callihn,

If I understand you correctly, you don't want an AI to place or detonate the IED & you want the IED underground. If I'm correct then all you need to do is have a BLUFOR trigger that spawns an explosion.

Regards

James

Share this post


Link to post
Share on other sites
@ Callihn,

If I understand you correctly, you don't want an AI to place or detonate the IED & you want the IED underground. If I'm correct then all you need to do is have a BLUFOR trigger that spawns an explosion.

Regards

James

How do you go about this? How to you place just an explosion to take place? And can you place that with a wide placement radius (say 150 m) so you don't know exactly where that would be?

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