Home   Help Search Login Register  

Author Topic: I.E.D (Improvised Explosive Device)-Is there a script out there?  (Read 2000 times)

0 Members and 1 Guest are viewing this topic.

docrptr

  • Guest
Hey all,

My friends and I wanted to know if there was a script for an IED. We just want an explosion that will disable a HMMWV, not totally destroy it. I'm familiar with the aspect that many HMMWV's are protected against all of these high powered explosives, but for our purpose, as stated above, we only want to be disabled, not killed.

Is there a way to script a grenade or something to do this. I love the claymores, and I think they're a perfect example of what we are needing. Thanks in advance.

yankme

  • Guest
id like to hear about this too, i set an IED and then put a script to aP setdammage 0.55 and that rebuilt it, i didnt try it with AI inside though,,,,,,,,,,,,,, but if your to close w/player or camera it doesn't look real. but with some work and timing it might,    '' not and answer just a thought or something to get someone's mind working ''  :-\

EDIT=

Quote
_AmmoType = "Shell125"
_Unit = _this select 0

_Explosion = GetPos _Unit

_cx = _Explosion select 0
_cy = _Explosion select 1
_cz = _Explosion select 2

_tempObj = _AmmoType camCreate[_cx, _cy, _cz]
~0.01
_tempobj = objNull

exit

i found this, in the 'AmmoType' you could replace it with "Cannon25HE" "Heat105" "Heat120" "Heat73" or some ammo value that will lessen the dammage
« Last Edit: 24 Nov 2005, 22:24:04 by yankme »

Offline Pilot

  • Contributing Member
  • **
Using HEAT alone won't damage the vehicle unless it actually hits the vehicle.  I suggest using a grenade for the damage and masking it with an explosion from a HEAT shell, ex:

_tempObj1 = "grenade" camcreate [_cx, _cy, _cz]
_tempObj2 = _AmmoType camCreate [_cx, _cy, _cz]

-Pilot
« Last Edit: 25 Nov 2005, 00:29:48 by Pilot »

yankme

  • Guest
 Pilot, how simple was that, i think maybe the Cannon25HE would work too, but the the way you have it, it would be just like thoughing one grenade at the hummer. but if he has personal in the ride and he dosent want them dead wouldnt a setdammage 0.5 or similar bring the aP back to life?!?, i was testing this and fail to set it up right ,,its all about MATH! augh :P    p.s. mission coming soon! cheers, Yank.

Offline Pilot

  • Contributing Member
  • **
The personel shouldn't die from the grenade blast.  They would be injured at most.  If you wanted the people in the hummer to be fully healed, you could use something like:
{_x setdammage 0} foreach units crew VehicleName

Not tested, that bit of code is definately not guarenteed to work, but I think you will see what I'm trying to accomplish.  That would heal the crew in the vehicle, but not the vehicle itself.

-Pilot

yankme

  • Guest
docrptr, i worked on this  ;D      Yank sticks tough out at Pilot :P

i didnt try grenade and Heat73 wasnt big enough but Pilots way might be easyer for you though , i dont know.

call the script what you want and use [hummer] exec "scriptname.sqs"

i ran over the scripted below with 3 men and myself in a hummer. two of my men got injured the jeep was disabled and it was like driving over a big bump jeep would not drive straight and cracked windshield
the Heat125 worked the best , try any thing else if you want....  

   EDIT= works best with slow moving vehicles
Quote
_AmmoType = "Heat125"
_Unit = _this select 0

_Explosion = GetPos _Unit

_cx = _Explosion select 0
_cy = _Explosion select 1
_cz = _Explosion select 2

_tempObj = _AmmoType camCreate[_cx, _cy, _cz]
~0.01
_tempobj = objNull

exit
« Last Edit: 25 Nov 2005, 11:30:32 by yankme »

docrptr

  • Guest
Thanks guys. I just got back from Thanksgiving Holidays here in the US, so I'll try and play around with it. Cheers mate.

Offline Wadmann

  • OFPEC Patron
  • ****
  • I'm the next evolutionary step after a llama!
I made just made such a script over the holiday weekend although I did not care if the lead unit was killed or wounded, although I wanted to give them a chance at survival.

I had the shells explode randomly within 5 meters of the HMMWV and about .5 meters below so the blast was large for effect but it would not get totally destroyed most of the time. My script then set off two other explosions at two different random points along the stopped convoy after a small delay. It is hardcoded for Nogova as I used object IDs for the array of secondary explosion positions, but could easily be modified to work with another island.

If anyone is interested, I could post it upon request (I would post it now but I am posting from work).

Wadmann
Check out my Camouflage Collection! New items added 31 July 2005.

yankme

  • Guest
Wadmann id like to see what youve done, give her a post :) cheers

LoTekK

  • Guest
Since I enjoy idly blowing stuff up ( ;D ), I whipped this up.
Code: [Select]
_vehicle = _this select 0
_ammo = _this select 1
_offset = _this select 2
_variance = _this select 3
_posX = (getPos _vehicle select 0) + (random _variance) - (_variance / 2)
_posY = (getPos _vehicle select 1) + (random _variance) - (_variance / 2)
_dir = getDir _vehicle
_speed = (speed _vehicle) / 15
_offset = _speed + (_offset + (random _variance) - (_variance / 2))
_cX = _posX + (sin(_dir) * _offset)
_cY = _posY + (cos(_dir) * _offset)

call format [{_boom = "%1" camCreate [%2,%3,0]},_ammo,_cX,_cY]
exit
Use a trigger to call the script with the following params:
_vehicle: the unit you intend to stop/destroy
_ammo: the type of explosive you wish to spawn
_offset: this is mainly to fine tune the specific location of the blast (forward/aft), and is useful for long vehicles
_variance: the number here will determine the radius in which the explosive will be spawned, if you want a bit of randomness

The script will take into account the unit's current speed (the divisor of 15 was non-empirical and based on trial and error) and should plop the explosive down roughly forward of center-mass, with adjustments for _offset and _variance.

Experiment with various types of ammo. I've found that "heat120" makes for a really spiffy-looking explosion without completely destroying the vehicle, if that's what you're after (it will almost always blow out at least one tire, though). The various "shell" types cause more damage, but are much less pyrotechnic in nature. I've found that using a "heat120" in conjunction with another ammo type provided for the best-looking results. So something like the following in the Activation field of your trigger:
Code: [Select]
[thislist select 0, "heat120", 0, 1] exec "ied.sqs"; [thislist select 0, "grenadehand", 0, 1] exec "ied.sqs"Alternatively, you can add an extra line in the script to save you the trouble, with the first line spawning a "heat120", and the next line spawning whatever you passed as _ammo.

You can get fancy and have the trigger set off another couple of ied's on a delay, if you want.
« Last Edit: 03 Dec 2005, 19:52:07 by LoTekK »

yankme

  • Guest
hey LoTekK, that looks good , i'll play with that, iam still trying to spice up my Day Patrol mission,
  its been a long road with this mission and iam trying to make it a bit more then just a playable one. what i think iam going to do is have an IED go off on a vehicle in front of the player, then have him radio in what happened,
  that should set the mood for the rest of the mission
   cheers

Offline Wadmann

  • OFPEC Patron
  • ****
  • I'm the next evolutionary step after a llama!
Now that school is over for awhile I finally had a chance to post my IED script.

Here is the script:

Code: [Select]
_bpos = []
_bpos1 = []
_bpos2 = []

_bpos = [(getpos j1 select 0) + (random (5*2)) - 5,(getpos j1 select 1) + (random (5*2)) - 5,-.95]
"HEAT120" camcreate _bpos
"SHELL120" camcreate _bpos
~random 2
_rndmObjNum1 = [3291,3294,125501,3289,3293,125510,3292,3290,125519] call RandomSelect
#ied2
_rndmObjNum2 = [3291,3294,125501,3289,3293,125510,3292,3290,125519] call RandomSelect
? (_rndmObjNum1 == _rndmObjNum2) : goto "ied2"
_rndmObj1 = object _rndmObjNum1  
_bpos1 = [(getpos _rndmObj1 select 0),(getpos _rndmObj1 select 1) + (random (5*2)) - 5,-.95]
"HEAT120" camcreate _bpos1
"SHELL120" camcreate _bpos1
~ random 3
_rndmObj2 = object _rndmObjNum2  
_bpos2 = [(getpos _rndmObj2 select 0) + (random (5*2)) - 5,(getpos _rndmObj2 select 1),-.95]
"HEAT120" camcreate _bpos2
"SHELL120" camcreate _bpos2
exit

You will also need this function by Joltan:

Code: [Select]
private ["_list","_ntotal","_random","_result","_target"];

_list=_this;
_ntotal=count _list;
_random=random(_ntotal);
_result=_random - ((_random) mod (1));
if (_result==_ntotal) then {_result=_result-1};

_target=_list select _result;

_target

I just used a side present trigger and on the activation line I put this in:

Code: [Select]
[] exec "randomIED.sqs"
Here is an addon free mission to see how this script works. It is a simple WIP ambush mission that gets right to the action.

Enjoy!

Wadmann
« Last Edit: 13 Dec 2005, 17:29:03 by Wadmann »
Check out my Camouflage Collection! New items added 31 July 2005.

yankme

  • Guest
Quote
Now that school is over for awhile I finally had a chance to post my IED script
cool Wadmann, i'll check that out too!!
  NOW that schools out for a bit i'll be bussy for awhile  >:(