Jump to content

Photo
- - - - -

New advanced IED script is out


  • Please log in to reply
52 replies to this topic
Thread Starter
00dc15
00dc15

    Lance Corporal

  • Members
  • 49 posts

#1

Posted 19 September 2010 - 22:18

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.co...tation.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, 20 September 2010 - 11:33.
Errors in documentation document


kylania
kylania

    Lieutenant Colonel

  • Members
  • 8281 posts

#2

Posted 19 September 2010 - 22:24

Congrats! :)

gnarly_rider
gnarly_rider

    Staff Sergeant

  • Members
  • 319 posts

#3

Posted 19 September 2010 - 22:37

Awesome, will play with tonight!

Thread Starter
00dc15
00dc15

    Lance Corporal

  • Members
  • 49 posts

#4

Posted 19 September 2010 - 22:45

@ 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

binkowski
binkowski

    cranky old vet

  • Members
  • 3441 posts

#5

Posted 19 September 2010 - 22:45

sounds good, im going to try it.
Spoiler
Posted ImagePosted Image
Posted Image
A3: SP Revenge!, SP Infantry

meade95
meade95

    Gunnery Sergeant

  • Members
  • 576 posts

#6

Posted 19 September 2010 - 22:57

Thank you......Will DL for sure once I get home....

kylania
kylania

    Lieutenant Colonel

  • Members
  • 8281 posts

#7

Posted 19 September 2010 - 23:00

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. :)

meade95
meade95

    Gunnery Sergeant

  • Members
  • 576 posts

#8

Posted 20 September 2010 - 00:20

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

kylania
kylania

    Lieutenant Colonel

  • Members
  • 8281 posts

#9

Posted 20 September 2010 - 02:17

It should work without BAF, but the IED's will be smudgy. :)

meade95
meade95

    Gunnery Sergeant

  • Members
  • 576 posts

#10

Posted 20 September 2010 - 02:42

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

kylania
kylania

    Lieutenant Colonel

  • Members
  • 8281 posts

#11

Posted 20 September 2010 - 02:58

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

gnarly_rider
gnarly_rider

    Staff Sergeant

  • Members
  • 319 posts

#12

Posted 20 September 2010 - 08:17

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

Thread Starter
00dc15
00dc15

    Lance Corporal

  • Members
  • 49 posts

#13

Posted 20 September 2010 - 09:14

@ 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

gnarly_rider
gnarly_rider

    Staff Sergeant

  • Members
  • 319 posts

#14

Posted 20 September 2010 - 10:25

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:

Thread Starter
00dc15
00dc15

    Lance Corporal

  • Members
  • 49 posts

#15

Posted 20 September 2010 - 10:51

@ 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

gnarly_rider
gnarly_rider

    Staff Sergeant

  • Members
  • 319 posts

#16

Posted 20 September 2010 - 10:55

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, 20 September 2010 - 11:02.


Thread Starter
00dc15
00dc15

    Lance Corporal

  • Members
  • 49 posts

#17

Posted 20 September 2010 - 11:06

@ 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

Antigoon
Antigoon

    Sergeant

  • Members
  • 192 posts

#18

Posted 20 September 2010 - 21:39

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?

gnarly_rider
gnarly_rider

    Staff Sergeant

  • Members
  • 319 posts

#19

Posted 20 September 2010 - 21:45

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)!

Antigoon
Antigoon

    Sergeant

  • Members
  • 192 posts

#20

Posted 20 September 2010 - 22:04

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!