Nielsen 10 Posted September 1, 2010 (edited) After reading Kylanias astute description on how to use the BAF IEDs here, I found myself in the need of a way to randomize this process. So, I've wipped up a script that will make this easier. Realizing that someone else (even less versed in scripting than myself) might find this usefull, I thought I might as well throw it up here on the forum. To be honest I'm kinda hoping that someone better at scripting *cough*Kylania*cough*Shk*cough* will be appalled by my crude code and/or method, and decide to make something solid :D. Well here goes. It's just a simple script doing the exact thing that Kylania showed. An ai sets an ied, moves of and blows it when the target side gets within 10m. I use it to place random IEDs by placing a civilian or opfor (execVM the script in init), and grouping him to several markers to make it random. I have added some control over the type of IED to set. Parameters are explained at the top of the script. I have tested it SP and it seems to work fine. I have not had a chance to test it in MP though. It should work I guess. BAF_iedScript.sqf // --------------------------------------------------------------------------------------------------------- // BAF IED Script // Author: Nielsen // Credit: // Kylania @ bisforums for describing how to use the BAF IEDs. // Shk @ bisforums for helping me debug the script (and several others). // Please feel free to modify or distribute this code as you see fit. Any recognition will be appreciated. // --------------------------------------------------------------------------------------------------------- // USAGE: // Place this script in your mission directory. Place an ai in the editor AND NAME HIM. // It is important to name him, what you name him is not important. // In the init line put: // ied = [this,"type","size","side"] execVM "BAF_iedScript.sqf"; // The ai will set an ied of the chosen type, move of a certain random distance and hide. // When the chosen side are within 10m of the IED, if still alive the ai will detonate it. // // Required parameters: // unit = Unit to set the IED (i.e. this). // type = Type of IED set. Options are "garbage", "ground" and "random". // size = Size of the IED. Options are "small", "big" and "random". // side = Side that will make the IED explode. Options are "west", "east", "civ" and "guer". // // Init line examples: // ied = [this,"garbage","big","WEST"] execVM "BAF_iedScript.sqf"; // ied = [this,"random","small","CIV"] execVM "BAF_iedScript.sqf"; // ied = [this,"random","random","EAST"] execVM "BAF_iedScript.sqf"; // --------------------------------------------------------------------------------------------------------- if !(isServer) exitWith {}; private ["_ai","_ied","_iedSize","_randomIED","_position","_hidePos"]; _ai = _this select 0; _ied = _this select 1; _iedSize = _this select 2; _randomIED = floor (random 2); _position = getPos _ai; //Set IED type private ["_iedType"]; switch (_ied) do { case "garbage": { switch (_iedSize) do { case "small": { _iedType = "BAF_ied_v1"; }; case "big": { _iedType = "BAF_ied_v2"; }; case "random": { if (_randomIED == 0) then { _iedType = "BAF_ied_v3"; }; if (_randomIED == 1) then { _iedType = "BAF_ied_v4"; }; }; }; _hidePos = [(getpos vehicle _ai select 0) + ( 50 + ((random(50)))*sin(getdir vehicle _ai - 180)), (getpos vehicle _ai select 1) + ( 50 + ((random(50)))*cos(getdir vehicle _ai - 180))]; }; case "ground": { switch (_iedSize) do { case "small": { _iedType = "BAF_ied_v3"; }; case "big": { _iedType = "BAF_ied_v4"; }; case "random": { if (_randomIED == 0) then { _iedType = "BAF_ied_v3"; }; if (_randomIED == 1) then { _iedType = "BAF_ied_v4"; }; }; }; _hidePos = [(getpos vehicle _ai select 0) + ( 100 + ((random(100)))*sin(getdir vehicle _ai - 180)), (getpos vehicle _ai select 1) + ( 100 + ((random(100)))*cos(getdir vehicle _ai - 180))]; }; case "random": { switch (_iedSize) do { case "small": { if (_randomIED == 0) then { _iedType = "BAF_ied_v1"; }; if (_randomIED == 1) then { _iedType = "BAF_ied_v3"; }; }; case "big": { if (_randomIED == 0) then { _iedType = "BAF_ied_v2"; }; if (_randomIED == 1) then { _iedType = "BAF_ied_v4"; }; }; case "random": { private ["_randomType"]; _randomType = round random 3; switch (_randomType) do { case 0: { _iedType = "BAF_ied_v1"; }; case 1: { _iedType = "BAF_ied_v2"; }; case 2: { _iedType = "BAF_ied_v3"; }; case 3: { _iedType = "BAF_ied_v4"; }; }; }; }; _hidePos = [(getpos vehicle _ai select 0) + ( 50 + ((random(150)))*sin(getdir vehicle _ai - 180)), (getpos vehicle _ai select 1) + ( 50 + ((random(150)))*cos(getdir vehicle _ai - 180))]; }; }; //set IED muzzle private ["_iedMuzzle"]; _iedMuzzle = format ["%1_muzzle",_iedType]; //Debug //diag_log format ["iedType: %1 - IedMuzzle: %2",_iedType,_iedMuzzle]; //Add and set IED removeAllWeapons _ai; _ai addMagazine format ["%1",_iedType]; _ai playmove "amovpercmstpsraswrfldnon_gear"; _ai Fire format ["%1",_iedMuzzle]; //Create proximity trigger private ["_tgtSide"]; _tgtSide = _this select 3; IEDtrigger = createTrigger["EmptyDetector", position _ai]; IEDtrigger setTriggerActivation [format["%1",_tgtSide], "PRESENT", false]; IEDtrigger setTriggerArea [5, 5, 45, false]; IEDtrigger setTriggerStatements ["this",format["%1 action [""TOUCHOFF"",%1]",_ai],""]; //Run and hide _ai doMove _hidePos; sleep 10; _ai setBehaviour "STEALTH"; Sample mission: here Everyone is more than welcome to improve on this. I would appreciate any thoughts on the code or related. I'm especially interested in advice on a better way to make the ai hide and watch for opfor. I'm thinking that a 'BLUEFOR - Detected by OPFOR' trigger might be cooler for detonation but that would require some more clever control of where the ai hides to be effective. Well anyways. I hope someone finds it usefull. Regards, Edited September 4, 2010 by Nielsen Fixed error in Init examples Share this post Link to post Share on other sites
DarkEclip 10 Posted September 2, 2010 Hi Nielsen nice script, but i try it and the guy never touchoff the bomb. I place a TK militia machigunner with: ied = [this,"random","random","west"] execVM "iedScript.sqf"; He place the bomb but never activate it, if you can help me with this thank a lot. Share this post Link to post Share on other sites
meade95 0 Posted September 2, 2010 Can you upload a practice mission/folder that shows this working......where one could open it in the editor and see how it is done? Thanks Share this post Link to post Share on other sites
Nielsen 10 Posted September 2, 2010 I have put a link to a sample mission in my first post. I hosted it on rapidshare, as I dont know where else to host it. @DarkEclip: Just to be sure, the 'exeVM "filename"' have to match the filename. If you have named your script BAF_iedScript.sqf as I have above, then your init line should read: ied = [this,"random","random","west"] execVM "BAF_iedScript.sqf";. If this is not the problem then I'm not sure why this happens. But if you use an Opfor unit, then remember that Bluefor will engage him if they spot him, and may take him down before he sets of the bomb (i.e. Bluefor within 10m). Give the sample mission a try :) Share this post Link to post Share on other sites
DarkEclip 10 Posted September 2, 2010 I try your sample mission AI never put the bomb on ground and ..... :) I dont understand what happend. On my mission AI put the bomb but never activate it. Share this post Link to post Share on other sites
Nielsen 10 Posted September 2, 2010 Hmm. Thats weird. The script and mission are so simple that I am not sure what can be wrong. You do have Arrowhead and the BAF DLC right? Do you get any errors? As soon as the mission begins both the ai should put an IED on the ground and move of. If you start the mission and just watch, then nothing happens and the bluefor vehicles just pass by? Share this post Link to post Share on other sites
DarkEclip 10 Posted September 4, 2010 (edited) Sorry bud all work fine now i think i have tried with bad addons i don't know wicht one but now i try with nothing and all work fine Thank you :) Edited September 4, 2010 by DarkEclip Share this post Link to post Share on other sites
callihn 10 Posted September 4, 2010 (edited) Interesting, now do we have to have the DLC for this or are they in the light and if so where? EDIT: Never mind I found the answer, should work with light since all components are there, units/empty/ammo/explosives stash gives access to some of them. Have not got the script to actually work yet though, so apparently there is a step missing. EDIT2: Silly me, maybe if I put the right side in, DOH! On another note, it would be interesting to have the ai hide in the nearest building, anyone done that? Edited September 4, 2010 by callihn Share this post Link to post Share on other sites
Nielsen 10 Posted September 4, 2010 @DarkEclip: No worries, glad you got it working. @Callihn: Yeah, I made that mistake myself when testing the script. I started to debug before i realized I had the wrong side :P... Nice idea with the building btw, and that is something that my limited abilities does actually allow me to do. I figure that often I want IED's in the open, and the nearest building would be too far away. I'm propably gonna add another parameter for the AI to either hide in the open, or hide in nearest building. Share this post Link to post Share on other sites
gnarly_rider 0 Posted September 4, 2010 (edited) @DarkEclip: No worries, glad you got it working.@Callihn: Yeah, I made that mistake myself when testing the script. I started to debug before i realized I had the wrong side :P... Nice idea with the building btw, and that is something that my limited abilities does actually allow me to do. I figure that often I want IED's in the open, and the nearest building would be too far away. I'm propably gonna add another parameter for the AI to either hide in the open, or hide in nearest building. I have noticed that the Ai will at times hide in a location he can't possibly see the IED (for him to validly trigger it, like in a yard with two buildings and a fence between him and the marker...); which means say BLUFOR has no chance of detecting the triggerman. Anyway of implementing a LOS type thing in the script, so that he hides so that he can always see and faces the marker location? This would then work in better with this: I'm thinking that a 'BLUEFOR - Detected by OPFOR' trigger might be cooler for detonation but that would require some more clever control of where the ai hides to be effective. Loving the script though! Edited September 4, 2010 by gnarly_rider Share this post Link to post Share on other sites
00dc15 0 Posted September 4, 2010 Hi, @Neilsen - Good script, thanks for sharing it with us. It may interest everone to know that since Kylania discovered the muzzle data for BAS IED's, I've been experimenting with a script for placing & detonating them. There are a few things I want from my script: 1) For a person to be able to place an IED randomly but ideally in a good position (i.e not on the road or in a building) & also where the Enemy are likely to walk in the mission. 2) For the person to hide nearby ideally in or on the roof of a building (but out of the blast range) & watch the IED. 3) For him to only activate it if he knows about the enemy near the IED. 4) For there to be a possible delay (failed detonation), so your engineer can defuse it. 5) Ideally the person would have hold of a visible detonator in his hand, that way if you scan buildings as you move through the town, you may see he is the detonator man & kill him before he sets of the IED (I plan to use civilians as they blend in to the surroundings better). With all the above I think you could have a good, random script, I have done anvanced testing of most of the above & just need to finish the script. I don't think there's an easy way of making sure the detonator man can see the IED but with the added knows about & him being positioned by a window or on a roof watching the IED we should get some results. However if your mission requires that an IED will go off you would need to use Neilsen's script. I am hoping to have the script finished in a few days, just reserching house types, positions & ratios of houses in villiages/towns. If anyone has any suggestions please feel free to post. Once complete I will post it here, in this thread. Regards James Share this post Link to post Share on other sites
gnarly_rider 0 Posted September 4, 2010 Hi, @Neilsen - Good script, thanks for sharing it with us. It may interest everone to know that since Kylania discovered the muzzle data for BAS IED's, I've been experimenting with a script for placing & detonating them. There are a few things I want from my script: 1) For a person to be able to place an IED randomly but ideally in a good position (i.e not on the road or in a building) & also where the Enemy are likely to walk in the mission. 2) For the person to hide nearby ideally in or on the roof of a building (but out of the blast range) & watch the IED. 3) For him to only activate it if he knows about the enemy near the IED. 4) For there to be a possible delay (failed detonation), so your engineer can defuse it. 5) Ideally the person would have hold of a visible detonator in his hand, that way if you scan buildings as you move through the town, you may see he is the detonator man & kill him before he sets of the IED (I plan to use civilians as they blend in to the surroundings better). With all the above I think you could have a good, random script, I have done anvanced testing of most of the above & just need to finish the script. I don't think there's an easy way of making sure the detonator man can see the IED but with the added knows about & him being positioned by a window or on a roof watching the IED we should get some results. However if your mission requires that an IED will go off you would need to use Neilsen's script. I am hoping to have the script finished in a few days, just reserching house types, positions & ratios of houses in villiages/towns. If anyone has any suggestions please feel free to post. Once complete I will post it here, in this thread. Regards James Sounds awesome mate, keep us in the loop! Share this post Link to post Share on other sites
Nielsen 10 Posted September 5, 2010 I have noticed that the Ai will at times hide in a location he can't possibly see the IED (for him to validly trigger it, like in a yard with two buildings and a fence between him and the marker...); which means say BLUFOR has no chance of detecting the triggerman. Anyway of implementing a LOS type thing in the script, so that he hides so that he can always see and faces the marker location? Yeah. Thats the reason i didnt put the 'detected by' trigger in there. It is easy to make him face the IED, but I do not know how to ensure that he can see it.@00dc15: Sounds great. I was hoping someone would make a better script. I initially had those same criteria in mind, but 4 and especially 5 are somewhat out of my scope atm. Have you figured out how you are going to achieve 5? Some feedback: 1: I would not want you to restrict IEDs from roads. The garbage IED models are quite nice on roads. Essentially I would like garbage on the road and ground/dirt models on the side of the road. 2: In my script the (random) distance the AI runs of is dependent on the object type. I think it would be cool to make something a bit more advanced, so that you you place an IED out in the open, he will run to the edge of detonation range and prone. Alternatively it would be cool to have them seek sufficient cover in the terrain, I guess that could be achieved by having them in 'combat'. 3: It would be cool if the user was able to specify an array of AI's that could detonate the IED, so that you could have several civilians around the site watching it. That way you would also be able to decrease the chance having no detonation. 4: It would be great if engineers did not trigger the detonation by default, but instead had a slight chance of detonating it regardless of it being observed, ideally when trying to defuse it. If this is not allready a feature in the game that is. Havent seen it yet though. 5: That would be just plain awesome! I'm really looking forward to your script. Sounds promising :) Share this post Link to post Share on other sites
00dc15 0 Posted September 5, 2010 @ Neilsen Well in my 1st version the failed detonation would just be some random lines of script that set the detection to detonation times randomly, as for him holding a detonator I have run some tests attaching an Explosive charge (small box with wires found under Empty/Objects (small)) to his hand & then locking the person into a switchmove so it he has his hands visible (not by his side), that part is fairly easy, I already have civilians walking about with document folders or briefcases under there arms or in there hands. In an Ideal world I'd make an object that is better and would be a hand gun class so he would pull it out when in danger mode. However that is out of my scope in the 10 years or so of writing missions for OFP/ARMA, I've never got into addon making. Thanks for the feedback: 1) IED placement won't be restricted at all, what I have at present is you set a person of any faction in the editor (or it could use ALICE generated civilians) & set up some waypoints, at a random time he will deploy the IED, scrap his current task(s) & move to a detonation position. That way it could be placed where the mission builder wants it or on a route, in a building etc, he could even be on a bike or in a car & get out to place it. Note: the random time delay in placing the charge would be user selectable (put in 300 & it will be placed between 0 & 300 seconds, put in 0 & he will place it then). 2) It's possible, is that not what your script does now. 3) I like the idea of an array of observers, I would need to script some suspicious behavior for them, one possible would be them having & using binoculars to watch the IED from a rooftop at distance. 4) In my early tests with a simple random detonation time trigger, if you sighted the IED & sent your engineer to defuse it sometimes he would or other times he would get blown up by it. I hope that helps clear up my plan, now I must get back to the scripting. Regards James Share this post Link to post Share on other sites
Nielsen 10 Posted September 5, 2010 That sounds great. Looks like you've got it pretty much locked down. I like your approach to no. 5. I was wondering how you would achieve it without making an addon. 1: I see. If he places the IED at a (somewhat) random time, wont that be a potential problem. With waypoints wouldnt I have to ensure that the AI was at a good IED spot all the time? Or do you have some sort of failsafe? 2: No exactly. My script makes the AI run of a certain random distance dependant on the object type. What I wanted was some way of defining for example either a city- or a rural IED. In a city you would want the AI to stay relatively close to the IED - maybe in a building - for him to be able to see it. On the other hand, if the IED is set out on the open road, then you want the AI to move of somewhat further and take cover (maybe even spawn a bush for him to hide behind). The point is different behaviour dependant on the environment. I guess you could just check the distance to nearest house object to infer if the AI is in a city, and set the behaviour accordingly. 3: Yeah, I figure since the detonate command allows anybody to set of the IED, it wouldnt be that hard to implement. I guess passing the array as a parameter and doing some forEach would take care of it. I really like the idea of civs watching with binoculars from rooftops! 4: Guess that feature is build in then. Great. In that case it would be cool if the engineers did not trigger the detonation. Still looking forward to your script. Share this post Link to post Share on other sites
manzilla 1 Posted September 5, 2010 (edited) Sorry bud all work fine now i think i have tried with bad addons i don't know wicht one but now i try with nothing and all work fine Thank you :) I got this same issue now. Any clue which ones you were using? EDIT: http://dev-heaven.net/issues/13541 It's ACE2. I created a ticket at their bug tracker. Edited September 5, 2010 by Manzilla Share this post Link to post Share on other sites
DarkEclip 10 Posted September 9, 2010 I got this same issue now. Any clue which ones you were using?EDIT: http://dev-heaven.net/issues/13541 Yea i make a mission atm with ace2 and i can't place ied. I've just realize this is because ACE2. thx mate to have found it. Share this post Link to post Share on other sites
00dc15 0 Posted September 10, 2010 Hi All, I'm afraid this will be a long post on the progress of my IED script (which has been an up hill battle), but worth reading. The script has got a lot more complicated than I first intended it to be, it does the following: 1) You place a man in the editor & in his init field execute the script. 2) The script now waits for a random time (put in by you). 3) When the time kicks in the man abandons what he was doing & places a random IED, then finds a building within a minimum & maximum range. 4) He runs to the picked building & starts working his way through the different positions (Some positions he doesn't bother with (for the reason that he could never see outside or it's to close to another position)) until he finds a position that he can see the IED from, if however this doesn't happen (which is quite often the case) he will move onto the next building (determined by the IED position) And so on until he finds a position that he can see the IED from. If he can't find any buildings (either there are none in range or he can't view the IED from them) then he will start searching for a position (within the minimum & maximum range) out in the open. Also note for each position he will 1st try prone, then crouched & finally standing up (his options are pre programmed by building type & position, to ensure he doesn't lay down by a window or behind a wall). 5) Having selected his position he waits & observes the IED area (using binoculars if over a certain range) until an enemy (to him) are spotted by him within 25m of of the IED, at this point if his knowlege of the enemy is high enough & they get closer than 15m to the IED he will detonate it within a random time of between 5 & 10 seconds. 6) He will now run to another random building/position & hide. The above code is all done apart from finding a position in the open (which shouldn't take long) but at present I've only got 2 building types in. Now I've spent about a week or more ( the reason for dedicating so much time to this is that I've got a serious leg indury, so I can't work, drive or walk until after an operation some time in the future) reserching buildings, positions & knowsabout values, I kid you not I have over 50 different spreadsheets & graphs of Knowsabout vs distance vs house position tests & this is all to do with him knowing about the IED. If anyone is interested here is my brief outline of what I've found. Firstly let me explain the mechanics of the script, when the man has placed an IED & got to his 1st building position a danger sign is created under the IED ( a danger sign seemed after extensive tests to be the best object), the man is then made to watch that sign for a specific amount time, when the time is up the sign is deleted & the man moves to the next position, where again the sign is created. The reasons for doing this is 1) he needs something to know about, because at each position the script asks if he knows enough to detemine if he can see the IED area. 2) The reason it gets deleted after every position is because I found in early tests if you leave it there his knowlege of it builds up at each position (so by position 5 he may well know enough to stop hunting for other positions & go onto the next part of the script but more than likely from this position he could never see the IED), also bear in mind that as far as I can tell from all my data he will have some knowledge of the sign through walls and all sorts, but it appears to be higher when he's got a good line of sight (like a player would need to see the IED). Another thing to note is that if the object is close his knowsabout value is higher than if it is further away, so I've had to alter his required knowsabout value based on 2m intervals up to 96m where it is nothing (unless he uses binoculars or a scoped weapon in which case it jumps up dramaticlly). Now I've been testing the script at a number of locations & it seems fairly good most of the time but at odd times it just falls apart and he sees the IED through a wall (where I would have to move a good 3m to see out of a window) so now I am currently adding the ability for him to only observe certain angles from a specific building position to allow for windows and doors. With this function added it should make the script 100% reliable which is what I striving to do. A quick example of how good the current fuctionality is the following test I conducted: The IED man hid in a building looking out of a window (infront of him) accross the road at the IED, due to the placement he couldn't see down the road to the right but could see to the left (due to another window), when I approached from the right I almost got up to the IED without it going off because he couldn't see me till the last second. However when I approached from the left he saw me alot earlier & was able to detonated the IED in time. Lastly a few notes about what I'm doing: 1) I'm the 1st to admit that I don't know alot about .sqf, in the OFP days I used .sqs so people may well look at the script (when it's ready) & say o.k it works but what a mess. 2) I am always open to suggestions & have had a few that I may implement once the base script is finished, tested & working. 3) When I set out to make this script it was for a specific mission I was making, where UK forces had to patrol a town (so that is why I'm currently focusing on buildings). 4) I have no idea how demanding the script is on different systems & with larger missions with more units etc. 5) I don't play multiplayer so I have not coded that in if it's required. 6) The code at present (for buildings), is only for OA buildings & I intend only to code 50% of the most common buildings in, however the code is in blocks so you could add other buildings if you know some .sqf basics. 7) I hope when the script is finished people will test it & use it, or modify it to be better, it's up to you, I would like to think of it as my script, for my requirements & if your requirements are different feel free to modify it & re-post it. God knows if anyone is still reading this but that's about it for now, I'm fairly sure that I will get it all done within another week & will post it in this thread. Regards James Share this post Link to post Share on other sites
Nielsen 10 Posted September 10, 2010 (edited) Hey James.. You bet. I have been checking the thread for your updates on a day-to-day basis ;) Seems like the scipt is comming along. Sounds great! I'm looking forward to trying it out. Edited September 10, 2010 by Nielsen Share this post Link to post Share on other sites
Janat 10 Posted September 10, 2010 A lot of text. Sounds awesome, can't wait for you to get it finished and released Btw, I have a little problem with OP's ied script. It works when I put it in a pre-placed unit's init field. But I'm trying to get it working with randomly generated units and it doesn't seem to fully work. The IED man spawns in the desired area, places the ied and then something else happens. He doesn't run away but either goes prone or gets stuck in some random animations (as if he's putting a weapon on his back and then readying it, all the animations happen really fast and won't get completed and then the animation changes to some other weapon animations, he doesn't carry a weapon). The ied doesn't blow up when I approach it. Here's my script where iedscript.sqf is OP's script: _rOrig = getPos player; _rDir = round (random 360); _rDist = 10 + (round (random 10)); _rPos = [(_rOrig select 0)+(sin _rDir)*_rDist,(_rOrig select 1)+(cos _rDir)*_rDist,0]; _skill = [0.1, 0.5]; _side = EAST; _units = ["TK_CIV_Takistani01_EP1"]; _iedgroup = [_rPos, _side, _units, [], [], _skill, [], [1], _rDir] call BIS_fnc_spawnGroup; _iedman = leader _iedgroup; [_iedman,"random","random","WEST"] execVM "iedscript.sqf"; Share this post Link to post Share on other sites
00dc15 0 Posted September 10, 2010 @ Janat, Hi, I think I remember reading somewhere in Neilsen's notes that the IED placing man must have a global name & I don't know why, something to do with his code I guess. I've not had a good enough look to see why he must be nammed but I suspect that could be your problem, if I'm correct in my thinking. Regards James Share this post Link to post Share on other sites
Nielsen 10 Posted September 10, 2010 Yes that is indeed the problem. The ai setting the IED must be named, because the trigger cant identify the ai otherwise. Shk pointed this out to me here. Share this post Link to post Share on other sites
Janat 10 Posted September 10, 2010 Well, I also tried giving the unit a name, with no luck. Here's my code: _iedgroup = [_rPos, _side, _units, [], [], _skill, [], [1], _rDir] call BIS_fnc_spawnGroup; _iedman = leader _iedgroup; _iedman setVehicleVarName "bomber"; [_iedman,"random","random","WEST"] execVM "iedscript.sqf"; also tried this: _iedgroup = [_rPos, _side, _units, [], [], _skill, [], [1], _rDir] call BIS_fnc_spawnGroup; iedman = leader _iedgroup; iedman setVehicleVarName "bomber"; [iedman,"random","random","WEST"] execVM "iedscript.sqf"; Still doesn't work properly. Share this post Link to post Share on other sites
00dc15 0 Posted September 10, 2010 @ Janat, I think I have a way round it for you, which is the way I've scripted it: You will need to change Neilsen's script, find the line below (near the bottom of his script) IEDtrigger setTriggerStatements ["this",format["%1 action [""TOUCHOFF"",%1]",_ai],""]; And change it to this: IEDtrigger setTriggerStatements ["this","",""]; Then below that put in these lines: WaitUntil {TriggerActivated IEDtrigger}; _ai action ["touchoff", _ai]; That should make the unit detonate the IED despite being nammed or not, but note I've not tested this in Neilsen's script as I can't exit my testing at present to try it, but that's how my script works. Share this post Link to post Share on other sites
Janat 10 Posted September 11, 2010 (edited) @00dc15 Thanks, now the blowing up part works, though they're suicide bombers as they still don't know how to run away from the IED. But hey, I have use for suicide bombers, too :D If only they didn't randomly get stuck in stupid looking animations :( Edited September 11, 2010 by Janat Share this post Link to post Share on other sites