psychd 10 Posted July 15, 2009 Hello everyone. I'm currently using the IED Script made by Jeevz. Located here or check the spoiler just below. ; Improvised Explosive Device Script ; By Jeevz ; v1.2 12/13/06 ; This script will create an explosion of a ; selected size on any object when called ; The arguments are [objectName, explosionPower] ; Explosion Power will be 1 of 4 choices ; Small - Good for Anti-Personnel use ; Medium - Will usually disable a Humvee without killing the occupants ; Large - Will usually destroy a passing humvee and kill or severly injure all occupants, will disable the tracks and possibly engine on M1A1 ; Huge - Nothing will survive, I mean... it's HUGE :-) ; Example script call --> [theCar, "Small"] exec "IED.sqs" ;start script _theObject = _this select 0 _theExplosion = _this select 1 ;locate the Object to be blown up _bombLoc = GetPos _theObject _bombLocX = _bombLoc select 0 _bombLocY = _bombLoc select 1 _bombLocZ = _bombLoc select 2 ; Deterimine the ordinance used to create the explosion ? (_theExplosion == "Small") : _ammoType = "R_57mm_HE" ? (_theExplosion == "Medium") : _ammoType = "M_Sidewinder_AA" ? (_theExplosion == "Large") : _ammoType = "M_Sidewinder_AA" ? (_theExplosion == "Huge") : _ammoType = "Bo_GBU12_LGB" civvy1 globalchat _ammoType ; Get the explosion size and blow the object up ? (_theExplosion == "Small") : goto "SMALL" ? (_theExplosion == "Medium") : goto "MEDIUM" ? (_theExplosion == "Large") : goto "LARGE" ? (_theExplosion == "Huge") : goto "HUGE" #SMALL _ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ] _theObject setdammage 1 civvy1 globalchat "Small" exit #MEDIUM _ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ] _theObject setdammage 1 civvy1 globalchat "Medium" exit #LARGE _ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ] _ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ] _ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ] _ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ] _ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ] _ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ] _ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ] _ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ] _ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ] _ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ] _ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ] _ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ] _theObject setdammage 1 civvy1 globalchat "Large" exit #HUGE _ammoType createVehicle[_bombLocX, _bombLocY, _bombLocZ] _theObject setdammage 1 civvy1 globalchat "Huge" exit My problem is the following. I want the IED to go off once it passes a certain point, easily done. But then I only want the IED to go off if a man (Spotter for the IED) is alive, so that if you shoot him, you wont trigger the IED. I've tried setting this if (alive (civ1)) then {execVM "IED.sqs"}; into the Condition Field of my trigger, but then the game crashes upon starting the map. Can anyone help me find a solution for my problem? And I hope you all can understand me. Share this post Link to post Share on other sites
Inkompetent 0 Posted July 15, 2009 (edited) You can't execute a script in the condition field Only boolean conditions in the condition field, and the script-call in the on activation field :) So... Condition: alive civ1 On Activation: nul = [] exec "IED.sqs" (note it's only exec. Not execVM. The latter is only used for SQF scripts) Edited July 15, 2009 by Inkompetent Share this post Link to post Share on other sites
psychd 10 Posted July 15, 2009 You can't execute a script in the condition fieldOnly boolean conditions in the condition field, and the script-call in the on activation field :) So... Condition: alive civ1 On Activation: nul = [] exec "IED.sqs" (not it's only exec. Not execVM. The latter is only usef for SQF scripts) Might just be me failing, but I got an error: Type Nothing, expected Any. Thanks for the help though :) Share this post Link to post Share on other sites
Inkompetent 0 Posted July 15, 2009 Did you remember to add the parameter between the tags in the script-call? I.e.[objectToBlowUp, "ExplosionSize"] exec "IED.sqs" Share this post Link to post Share on other sites
psychd 10 Posted July 15, 2009 Forgot Explosionsize - But now the Humvee blows up as soon as I start, which isnt the wanted effect ;). Share this post Link to post Share on other sites
pclipse 10 Posted July 15, 2009 Medium and large are the same looking at the script :P Share this post Link to post Share on other sites
f2k sel 164 Posted July 15, 2009 I think all you need to do is group your man to the trigger and set it to present. You can then put whatever you want to activate in the On Act Box. Share this post Link to post Share on other sites
Inkompetent 0 Posted July 15, 2009 Well, if the civilian is alive the trigger will trigger instantly, so you'll need more conditions than that to make it true. If you want the players (say they are BLUFOR) to pass a certain point and the trigger is set up for that, then you can simply change the condition field to "this AND alive civ1" Share this post Link to post Share on other sites
pclipse 10 Posted July 15, 2009 You're making this really confusing it works perfectly fine for me :P Make a vehicle name it "car1" Make a trigger on a road or wherever you want the IED to blow. then Group the vehicle to the trigger and in the On Act put: [car1, "Medium"] exec "IED.sqs" Share this post Link to post Share on other sites
f2k sel 164 Posted July 15, 2009 You're making this really confusing it works perfectly fine for me :PMake a vehicle name it "car1" Make a trigger on a road or wherever you want the IED to blow. then Group the vehicle to the trigger and in the On Act put: [car1, "Medium"] exec "IED.sqs" I think he want to check that the spotter is alive too so he would need in the condition this and alive unitname Share this post Link to post Share on other sites
psychd 10 Posted July 15, 2009 Well, if the civilian is alive the trigger will trigger instantly, so you'll need more conditions than that to make it true.If you want the players (say they are BLUFOR) to pass a certain point and the trigger is set up for that, then you can simply change the condition field to "this AND alive civ1" Thank you Inkompetent, your name suits me instead ;) I really appreciate your help, never would've been able to do this without you. :) Share this post Link to post Share on other sites
Inkompetent 0 Posted July 15, 2009 Just glad ya get it to work! Sitting over 700km from my own ArmA2, so since I can't make my own missions I'll do my best to help you new people make them :) Share this post Link to post Share on other sites
Killy_McMurder 10 Posted July 15, 2009 Just out of interest, i just discovered you can use the IED script on people as well... Bit sick to be honest, but could be useful in a suicide bomber scenario i suppose. Share this post Link to post Share on other sites
g-man-853 10 Posted July 28, 2009 Hi all, Does anyone know if there is a way of deactivating the IED. for example: If an engineer approaches device in a prone position the device will deactivate. something to think about:) Share this post Link to post Share on other sites
JDog 11 Posted July 28, 2009 That's an interesting idea I'm gonna keep in mind G-Man :) It would be possible, but the IED script/trigger would have to be modified. Think along the lines of this: IED script remains the same, edit as you wish Trigger grouped to vehicle that you want to go boom Trigger condition: alive spotter AND alive IEDname "IEDname" is the name of a physical object you place on the ground (like a satchel, mine, suitcase, etc) where the bomb will go off On act: execute the script as normal Add an action to the physical IED object called "Disable" which kills the object, in turn preventing the trigger condition from ever being met and the bomb from going off. Not sure if you can detect someone's stance, might be possible. I'm gonna have to try this out sometime later :P Share this post Link to post Share on other sites
Inkompetent 0 Posted July 28, 2009 Hi all, Does anyone know if there is a way of deactivating the IED. for example: If an engineer approaches device in a prone position the device will deactivate. something to think about:) I think you'll have to check the unit's animation-state for that. The command unitPos only checks what the unit is ordered to be in, but otherwise returns "auto" regardless of stance, so pretty useless I'm afraid :( Animation-states will make it tricky and cumbersome to code, but I think it'll be possible. Share this post Link to post Share on other sites
g-man-853 10 Posted July 30, 2009 Would it be better and easier to write a script where a certain role ie. EOD can approach the device with out triggering it. This will be simulating a counter measure device carried by that role. I'm just firing ideas at you guys with the know how. I'm not so clued up when it comes to scripting:confused: I am learning however. Share this post Link to post Share on other sites
Inkompetent 0 Posted July 30, 2009 That would be much easier indeed. You can either have some specific named units in the mission it checks for, or a certain class (like engineers) that can approach safely. Share this post Link to post Share on other sites
g-man-853 10 Posted July 31, 2009 (edited) That would be much easier indeed. You can either have some specific named units in the mission it checks for, or a certain class (like engineers) that can approach safely. Excellent that would be good. I don't suppose you have any pointers or links that may help me achieve this. Edited July 31, 2009 by G-Man-853 Share this post Link to post Share on other sites
Inkompetent 0 Posted July 31, 2009 Well, if you have a trigger at the IED that should detonate at BLUFOR being close to it (but not the engineers that you have named in the mission), and with the requirements that the triggerman is alive and the bomb hasn't been disarmed, you should set up the trigger as follows: Activaton: BLUFOR PRESENT Condition: this && alive triggerman && bombActive && ( !(engineer1 in thisList) || !(engineer2 in thisList) ) On Activation: whatever bomb-script you do here I thought of bombActive as beeing defaulted as TRUE in the start of the mission (the bomb's own init field or something), but can be turned FALSE by the addAction "Disarm bomb" added to the object. This has some limitations, like even if ten people approach the IED, and an engineer is the first to enter, then the trigger will be FALSE (i.e. not executing the On Activation-stuff). If anyone else than an engineer is going first it'll go boom though. I'm not entirely sure how it'll act if the engineer enters first, but passes and leaves the trigger area, and only non-engineer BLUFOR is still in the zone though. Share this post Link to post Share on other sites
g-man-853 10 Posted July 31, 2009 (edited) Thank you Inkompetent I'll have a go with that. I shall post back my results. Edited July 31, 2009 by G-Man-853 Share this post Link to post Share on other sites
Inkompetent 0 Posted July 31, 2009 Oh, and btw. Another way to do the trigger for the bomb would be to have all BLUFOR units aside from the engineers in one group, and group the trigger to that large squad. That way the trigger will only trigger if that specific group triggers it. It won't react to anyone else. Share this post Link to post Share on other sites